Path · 8 steps
Enterprise RAG, from problem to production
- Steps
- 8
- Reading
- About 11 min
- Disciplines
- 4
New to the words? The glossary explains terms like RAG, grounding and eval harness in a paragraph each.
The problem
Fifty thousand internal documents, answers that must cite their source, and an audience that will stop trusting the system after one confident wrong answer.
When you finish
You can draw the retrieval architecture, test retrieval apart from generation, keep the index honest on access and freshness, and catch drift before users do.
- 1ProblemYou cannot run RAG on user complaints
- 2ArchitectureAI Application
- 3DecisionChunk for the question, not for the token limit
- 4DeployIngestion is a data product, not a loader script
- 5ObserveTest retrieval on its own or you will tune the wrong thing
- 6SecureYour vector index does not know who is allowed to read it
- 7CodeRAG starter with hybrid search and recall at k
- 8LessonsThe retrieval cache that served stale policies
Problem · step 1 · Explainer
You cannot run RAG on user complaints
Start with what breaks after launch. The only quality signal is a user annoyed enough to escalate, and nobody can say how long the answers have been wrong.
Architecture · step 2 · System
Place retrieval on the map. It is one component among nineteen, and ingestion, the index, identity and the gateway around it decide whether it works.
Decision · step 3 · Explainer
Chunk for the question, not for the token limit
The first design call that shows in every answer. Chunk size is a decision about what a complete answer looks like, not a number from a blog post.
Deploy · step 4 · Explainer
Ingestion is a data product, not a loader script
Run ingestion like a product. Parsing sets the quality ceiling, failures need somewhere to go, and the update and delete paths are the half nobody tests.
Observe · step 5 · Explainer
Test retrieval on its own or you will tune the wrong thing
Give retrieval its own test set and its own number, so a wrong answer is traced to recall or to generation before anyone edits the prompt.
Secure · step 6 · Explainer
Your vector index does not know who is allowed to read it
Embeddings carry no access control lists. Ownership, permissions and freshness are designed before anything is indexed, not patched after a leak.
Code · step 7
RAG starter with hybrid search and recall at k
Run the whole loop on a laptop. Structure-aware chunks, hybrid retrieval with citations, and a recall-at-k gate on twenty labelled questions you can extend with your own.
Lessons · step 8 · Failure story
The retrieval cache that served stale policies
A cache keyed on the question alone kept serving last quarter's policy after a re-index. The fix and the test that would have caught it.