RAG, Retrieval, and Data Pipelines
A grounded answer is only as trustworthy as the evidence that reached the model. Design ingestion, chunking, indexing, retrieval, generation, and citation boundaries. Match sparse, dense, hybrid, filtered, and iterative retrieval to the data shape. Diagnose retrieval failures before changing the model or prompt. Measure retrieval quality separately from answer quality. Preserve freshness, access control, and provenance through the pipeline. A policy assistant works for months. After a document refresh, it begins giving confident answers based on an old refund threshold. Model version, prompt, and latency have not changed. The team adds "use the latest policy" to the prompt. Nothing improves. The model cannot follow evidence it never received. The index contains both policy versions, metadata filters are missing, and the retriever ranks the obsolete chunk first because its wording matches the query more closely. This is a retrieval incident. Treating it as a model incident wastes time and can hide the real control failure. Retrieval-augmented generation has two connected systems with different failure modes. The model can be excellent while the system fails because: the source was never ingested. parsing dropped the relevant table. chunking split a condition from its exception. the index used stale or incompatible representations. filters ignored tenant, jurisdiction, date, or permission. ranking favored a keyword match over the authoritative source. context assembly truncated the best…
RAG, Retrieval, and Data Pipelines: A grounded answer is only as trustworthy as the evidence that reached the model. Design ingestion, chunking, indexing,…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.