Designing retrieval systems that hold up in production
Most disappointing enterprise RAG systems are not model problems. They are information architecture problems with a language model attached.
A retrieval-augmented system answers questions using your own content. The demonstration is easy: embed some documents, run a similarity search, pass the results to a model. Production is harder, because real content is messy, permissions are uneven and the questions people ask do not match the way documents are written.
When such a system disappoints, the instinct is to change the model. Usually the more useful work is upstream.
Ingestion determines what can be found
Documents carry structure that naive ingestion destroys: headings, tables, defined terms, version history, cross-references. Flattening a policy document into uniform text chunks removes the context that makes a passage meaningful.
Good ingestion preserves structure, records provenance, handles updates and deletions, and keeps the metadata needed for filtering. It is unglamorous and it accounts for more of the quality difference than most model choices.
Permissions must survive retrieval
In an enterprise, the same index usually serves users with different entitlements. If permissions are applied after retrieval, a system can leak the existence of a document even when it withholds the content. If they are ignored, it leaks the content.
The reliable approach is to filter during retrieval using identity attributes derived from your existing access model, and to log both the query and the documents returned. This has to be designed with the index, not bolted on.
Evaluate retrieval separately from generation
When an answer is wrong, there are two possible causes: the right passage was not retrieved, or it was retrieved and misused. Measuring them together makes improvement guesswork.
We evaluate retrieval on its own — recall of the correct passage for a set of real questions — and generation separately. That distinction usually reveals that the cheapest gains are in chunking, metadata and query expansion rather than in a larger model.
Design for the answer that should not be given
A useful enterprise knowledge system must decline well. It needs a path for questions outside its corpus, a way to signal low confidence, and a route to a human or a source document. Answers without provenance are difficult to trust and impossible to audit.
The strongest systems we build show their sources by default. It changes user behaviour: people verify, correct and contribute, which improves the corpus over time.
Editorial attribution
Insights are written by the Tunnels engineering team from current client work and internal research. They are editorial perspectives, not client case studies. No confidential engagement detail, client identity or unverified performance claim is published.
Key points
- Preserve document structure and provenance during ingestion.
- Apply permissions inside retrieval, not after it.
- Measure retrieval and generation as separate problems.
- Make declining and citing sources first-class behaviours.
This perspective reflects how we approach the problem in client work. If it is close to a decision you are facing, we are happy to discuss it directly.
Discuss a Project