An assistant can produce a well-written answer from the wrong document. It can also retrieve the right document for someone who should never have been allowed to read it.
Connecting company knowledge to AI requires more than importing files and adding a chat box. You need to preserve what each source is, who may use it and which version is current.
What is retrieval-augmented generation?
Retrieval-augmented generation, often shortened to RAG, supplies relevant source material to a model when it answers a question. The model does not need every company document in every request.
A retrieval system typically prepares documents, stores searchable representations, finds relevant passages and supplies selected material to the answer step. Google's RAG overview describes this general pattern in its own platform.
Retrieval does not make a source correct. An old policy and a current policy can both contain the words the employee asked about. The application needs rules for deciding which material is appropriate.
Keep source identity through the ingestion pipeline
Each searchable passage should remain connected to its document, location, version and access scope. If preparation strips that information away, the answer interface cannot reliably explain where a statement came from.
For an illustrative product with a Next.js interface and a PostgreSQL-backed knowledge layer:
Documents -> Preparation service -> PostgreSQL knowledge records
|
Next.js question endpoint -> Access check -> Retrieval
|
v
Answer with source linksThese are responsibilities in a proposed design. The storage and search choices should follow the documents, query patterns and access model, rather than the diagram dictating one implementation.
Prefer passages that retain meaningful context. A table row without its column headings or a paragraph without the policy's effective date can become misleading even when the text was extracted accurately.
Apply access rules before exposing the retrieved material
Do not retrieve a mixed collection, pass everything to the model and ask it to hide confidential passages. The answer step should receive only material the requesting user is authorized to use.
Access rules also change. If a document becomes restricted or a user leaves a team, the searchable copies and cached answers need a policy for that change. Re-indexing is part of document lifecycle management, not merely a performance task.
A small acceptance set should include an employee with access, an employee without access, a revoked document and a revised policy. Check the returned sources as well as the final sentence.
Use explicit questions to evaluate the knowledge system
Pick questions whose answers are known and questions the collection cannot answer. For each supported answer, identify the source that should justify it.
| Test question | What to inspect |
|---|---|
| A fact stated in one current policy | Correct passage and version |
| A fact contradicted by an obsolete policy | Whether revision rules work |
| A question about a restricted document | No unauthorized source exposure |
| A question absent from the collection | An honest unsupported-answer response |
A useful evaluation can begin with a small, carefully reviewed set. Do not describe a handful of passing examples as a general accuracy benchmark.
What my knowledge-platform work contributes
At Nucleus, I worked across the application, APIs and retrieval model of a knowledge product. The case study describes that team contribution without claiming ownership of every connector or a measured retrieval-accuracy improvement.
That work is the relevant experience behind this guide. For a new project, I would first ask which sources the assistant should use and which user groups must remain separated. Those decisions affect the architecture before a model is selected.
Questions about company-document assistants
Do we need to train a model on our documents?
Not necessarily. Retrieval can supply selected material at question time. Training and retrieval solve different problems and have different update costs.
Can the assistant use a document immediately after it is edited?
Only if your synchronization and indexing path supports that. Define the expected delay and how users can recognize stale information.
Should we import every available source first?
I would start with a narrow, useful collection whose ownership and access rules are understood. Expanding a poorly governed collection makes errors harder to diagnose.
Before building, choose five real questions and the authorized documents that should answer them. Use those as the first review set for your knowledge workflow.