Guides · Series · 8 parts

RAG Engineering in Production

Most RAG failures happen upstream of the LLM, accumulate invisibly, and only surface as an incident. This series names each one.

The answer is wrong long before the model sees it

A RAG system that returns a confident, well-written, wrong answer looks like a generation problem. It almost never is. By the time the model writes anything, every consequential decision has already been made: which retrieval strategy ran, how the documents were split, whether the embedding model understands your domain, whether anything reranked the candidates, and what actually got assembled into the prompt.

The model is the last component in the chain and the only one most teams instrument. That is why RAG problems are so hard to debug — the failure is visible at the end and caused at the beginning, and the standard pipeline raises no flag in between.

This series works through those upstream decisions one at a time. Each part names a specific, recurring cost — the retrieval tax, chunking debt, the precision gap, the evals blind spot, the staleness gap, the context assembly gap — because a failure with a name is a failure you can budget for and argue about, and an unnamed one just gets absorbed as "RAG is hard."

What makes these production problems

Every one of these failures is invisible at demo scale. Fifty curated documents and a handful of test queries will not surface a chunking strategy that severs claims from their qualifiers, an embedding model that has never seen your jargon, or an index that has been quietly wrong for eighteen months. They surface at production scale, on real queries, usually via a user who noticed before you did.

They also compound. Bad chunks degrade retrieval, which makes reranking look useless, which hides the fact that your evals only measure answer quality and never retrieval quality. Fixing one layer in isolation often changes nothing measurable, which is exactly why teams conclude that RAG tuning is guesswork. It is not — but you have to see the stack as a stack.

Which part solves my problem

The series reads in order, but if something is already broken, start here.

  • I picked vector search by default and never asked whether it fits my queries.Part 1
  • Retrieval returns chunks that are technically relevant but missing the qualifier that changes the answer.Part 2
  • Similarity scores look fine but the results do not match what a domain expert would pick.Part 3
  • The right document is in the top 50 and never in the top 5.Part 4
  • I cannot tell whether a change to the pipeline made things better or worse.Part 5
  • Wrapping retrieval in an agent loop multiplied my bill and nobody set a ceiling.Part 6
  • A document from 18 months ago scores 0.94 and is completely wrong today.Part 7
  • Retrieval finds the right document and the model still does not use it.Part 8

The series

8 of 8 published

Part1

Why Your RAG System Is Using the Wrong Retrieval Strategy

A practitioner's guide to vector-based, vectorless, hybrid, corrective, and agentic retrieval architectures.

Part2

Why Your RAG Chunks Are Lying to Your Retriever

Chunking strategy is the upstream failure that no retrieval optimization can fix - a practitioner's guide to fixed-size, recursive, semantic, hierarchical, late, and contextual chunking and when each one silently breaks.

Part3

Why Your Embeddings Are the Wrong Shape for Your Domain

Your embedding model was trained on the internet. Your documents are not the internet. Here is what that mismatch costs in production and how to fix it.

Part4

Why Your Reranker Is the Last Line You Forgot to Build

Retrieval gets you recall. Reranking gets you precision. Skipping it means your LLM reads the wrong documents with complete confidence - and you will not know until production.

Part5

Why Your RAG System Cannot Tell When It Is Wrong

Most RAG pipelines measure answer quality and ignore retrieval quality - which means the Retrieval Tax, Chunking Debt, and Precision Gap from Parts 1 through 4 are accumulating invisibly, query by query, until a production incident forces the question.

Part6

Why Your Agentic RAG System Costs 10x More Than It Should

Wrapping a well-built RAG pipeline in an agent loop multiplies every cost in the stack by the number of retrieval iterations - and most teams have no budget ceiling, no per-session spend tracking, and no circuit breaker.

Part7

Why Your RAG Knowledge Base Is Lying About What It Knows

The vector index is a snapshot of your documents at ingestion time. Semantic similarity has no relationship to temporal validity. A document from 18 months ago can score 0.94 cosine similarity and still be completely wrong today - and nothing in the standard RAG pipeline raises a flag.

Part8

Why Your RAG Pipeline Assembles Context Wrong

Retrieval finds the right document. Context assembly decides whether the LLM reads it. Most teams treat this as a pass-through - and pay for it in accuracy, cost, and latency.

Other guide series

Books by Ranjan Kumar

Building Real-World Agentic AI Systems with LangGraph cover

Building Real-World Agentic AI Systems

The Chat Templates Handbook cover

The Chat Templates Handbook