跪拜 Guibai
← All articles
GitHub · Algorithm · Frontend

DocQuality: An Open-Source AI Tool That Audits Word Documents in Seconds

By 徐小夕 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Document review is still a manual bottleneck in legal, procurement, and compliance workflows. A lightweight, self-hosted tool that combines LLM reasoning with deterministic rules gives teams a repeatable audit process without sending sensitive contracts to a third-party SaaS.

Summary

Manual review of contracts, bids, and official documents is slow, error-prone, and leaves no quantitative audit trail. DocQuality attacks all three problems by combining a large language model with a configurable rules engine. A user uploads a .docx file, describes the review requirements in natural language, and the system returns a hundred-point score with a four-tier rating, a detailed problem list, and specific fix suggestions.

The inspection engine runs across three dimensions: format specification (heading levels, numbering, punctuation), compliance risk (sensitive data, missing clauses, placeholder detection), and content consistency (terminology drift, logical contradictions, redundancy). Six industry-specific rule templates ship out of the box for advertising compliance, privacy, and contract review, and users can add custom rules through a keyword mode or full regex editor.

Under the hood, the stack is React 18, TypeScript, and Vite on the frontend with NestJS and SQLite on the backend. The AI layer speaks the OpenAI-compatible protocol and works with DeepSeek, Kimi, Tongyi Qianwen, or any custom endpoint. Reports export to HTML, PDF, Word, or CSV, and a built-in JitWord engine renders .docx files in the browser so teams can review findings without downloading the original.

Takeaways
Upload a .docx and describe the review task in natural language; the system returns a scored report with specific issues and fix suggestions.
The inspection engine covers three dimensions: format specification, compliance risk, and content consistency.
Six built-in rule templates cover advertising compliance, privacy protection, and contract review, with custom rules configurable via keywords or regex.
Reports export to HTML, PDF, Word, or CSV, and historical reviews remain traceable and comparable.
The AI layer supports DeepSeek, Kimi, Tongyi Qianwen, OpenAI, and any OpenAI-protocol-compatible custom model.
The frontend uses React 18, TypeScript, Vite, and TailwindCSS; the backend runs on NestJS with SQLite.
Online .docx preview is handled by the JitWord engine, so reviewers never need to download the original file.
Conclusions

LLM-based document review is most credible when paired with a deterministic rules engine; the LLM handles fuzzy judgment while rules catch mechanical errors like missing placeholders or formatting violations.

Self-hosting is the differentiator here. Most AI document tools are SaaS products that require uploading sensitive contracts to external servers, which is a non-starter for legal and government use cases.

The keyword-to-regex dual-mode rule builder lowers the barrier for non-technical compliance staff while still giving engineers full control, a design pattern that generalizes to any domain-specific auditing tool.

Concepts & terms
JitWord
A collaborative document engine used for high-fidelity online preview and editing of Word (.docx) files directly in the browser, integrated into DocQuality for in-app document rendering.
OpenAI-compatible protocol
An API convention that mirrors OpenAI's chat completion endpoints, allowing tools to swap between different large language model providers without changing the integration code.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗