On this page
Learning objectives
- Design ingestion, retrieval, reranking, and citation as separate stages
- Apply access controls before retrieved content reaches the model
- Evaluate retrieval quality independently from answer quality
Prerequisites
Embeddings and search basics · A document source with known permissions
Answer first
Canonical definition
Retrieval-augmented generation supplies a model with selected evidence from an external knowledge source at run time so the response can be grounded, current, and traceable.
Operating context
Why it matters
The model cannot compensate for missing, stale, or unauthorized evidence. Retrieval quality is an upstream product decision.
Enterprise RAG must preserve document and user permissions throughout indexing, retrieval, caching, and citation.
Method
Step by step
- 01
Prepare the corpus
Track source, owner, version, effective date, access policy, and deletion behavior before chunking content.
- 02
Retrieve with filters
Apply tenant, user, document, time, and policy filters before semantic or lexical ranking.
- 03
Assemble evidence
Rerank for the question, deduplicate, preserve citations, and fit evidence within a bounded context budget.
- 04
Evaluate both layers
Measure whether the right evidence was retrieved and whether the final answer used it faithfully.
Hands-on lab
Build a permission-aware answer flow
Create two users with different document access and verify that retrieval and citations never cross the boundary.
Deliverable
An ingestion schema, retrieval pipeline, access tests, citation UI, and a small eval set.
What breaks
Common failure modes
- F1Filtering documents after retrieval or generation
- F2Embedding stale content without version and deletion propagation
- F3Evaluating fluent answers without checking retrieved evidence
Beyond the demo
Production notes
- Permission metadata must survive chunking, vector storage, reranking, caches, and generated citations.
- Monitor retrieval misses, empty results, source freshness, and unauthorized-hit tests as first-class signals.
Further reading
Sources
Related Tenten resources