Artificial intelligence

Designing a document assistant with retrieval-augmented generation

Separate text extraction, indexing, retrieval and answer generation, with visible evidence.

General editorial guide prepared with AI assistance. Examples are hypothetical; implementation depends on project requirements and qualified review.

Decision and problem

A language model alone does not know an organization's documents. Start by reading files and extracting text or using OCR where needed, then chunk content while preserving file and page references. Retrieve relevant passages before passing them to the model.

Designing the solution

Enforce access before retrieval and treat document text as untrusted data, not system instructions. Keep the index separate from originals and use file fingerprints for updates and deletion. Require evidence or an explicit statement that information is unavailable.

Practical acceptance test

Use synthetic questions including unanswerable ones and requests for restricted documents. Manually check each citation against the file and page. Do not use fluency as a proxy for accuracy.

Technical references

Discuss your project requirements

Define workflows, data and deployment before requesting a quote or customization.

Request a project assessment