Grounded question answering
The model receives selected source passages instead of the entire document and is instructed to answer from those passages.
DocAI is a document-intelligence assistant for PDF and TXT files. It retrieves relevant passages, generates concise answers from those sources, and stores citations so you can inspect the evidence behind every response.
The document identifies three main limitations: restricted input coverage, dependence on text quality, and the need for human review in high-stakes settings. [1] [2]
DocAI keeps the retrieval path understandable: uploaded documents are processed into searchable passages, relevant passages are selected, and the answer is generated from those sources.
The model receives selected source passages instead of the entire document and is instructed to answer from those passages.
Answers keep references to the source document, passage, filename, and excerpt so the evidence trail remains available for review.
Current retrieval is deliberately lexical and explainable, using direct terms, related terms, title matches, and exact-phrase bonuses.
Protected procedures check the signed-in user before accessing documents, conversations, messages, and citations.
PDF and TXT uploads are validated by extension, MIME type, file size, and readable text before processing.
React, TypeScript, tRPC, Express, MySQL/Drizzle, object storage, and automated tests form the current implementation.
DocAI is designed to keep the path between a document and an answer explicit.
An authenticated user uploads a text-based PDF or TXT file. Unsupported or unreadable files are rejected.
Readable text is normalized and divided into overlapping chunks for search and retrieval.
The current ranking system scores lexical signals to select passages related to the user's question.
Only the selected passages are sent to the configured language-model integration with grounding instructions.
The response, conversation history, and citations are persisted so users can return to the answer and inspect its sources.
A generated answer should make it easier—not harder—to inspect the material it relies on.
A citation does not make an answer automatically correct. Users should review original documents and cited excerpts.
DocAI is in active development. Current limitations include no OCR for scanned image-only PDFs and lexical rather than embedding-based retrieval.
Read the code, architecture notes, tests, and current limitations in the public repository.