Learn to build a production RAG pipeline: chunking, hybrid search, reranking, parent-child retrieval, citations, and how to debug wrong answers.
A customer in Jaipur asks the Acme Shop chatbot how long she has to return a laptop. The bot answers with confidence: 30 days.
Retrieval can only find what you indexed, so the quality of your cleaned text and metadata sets a ceiling that no clever search technique can lift.
A chunk is the unit of text you embed and retrieve, and choosing its size and boundaries decides whether the right fact is findable and whether it...
Vector search is the first retrieval stage, and it only works well when queries and documents are embedded the same way and when filters remove...
Vector search understands meaning but is weak on exact strings, so adding keyword search catches the product codes, form numbers, and names that...
Even good first-stage search returns a rough ordering, so rewriting the query before search and reranking the results after it are the two cheapest...
A customer in Jaipur asks the Acme Shop chatbot how long she has to return a laptop.
Retrieval can only find what you indexed, so the quality of your cleaned text and metadata sets a ceiling that no...
A chunk is the unit of text you embed and retrieve, and choosing its size and boundaries decides whether the right fact...
Vector search is the first retrieval stage, and it only works well when queries and documents are embedded the same way...
Vector search understands meaning but is weak on exact strings, so adding keyword search catches the product codes...
Even good first-stage search returns a rough ordering, so rewriting the query before search and reranking the results...
Small chunks are best for finding a fact and large chunks are best for answering a question, and parent-child retrieval...
The generation step is where a good retrieval result can still be ruined, so the prompt has to force the model to...
When an answer is wrong, the fastest fix comes from finding which stage lost the right passage, and you can do that by...
Without numbers, every change feels like an improvement, so a small fixed set of questions is the cheapest way to know...
This lab builds acme-assist, a policy chatbot that starts with a plain vector search and improves step by step, with a...
Keep this section open when you build or debug a pipeline, because it condenses the decisions from every topic into one...
These seven mistakes cause most failed RAG projects, and every one of them is cheaper to prevent than to debug.
Roles that use the skills in this module.
AI Engineer
MLOps Engineer
Platform Engineer
DevOps Engineer
Not a software engineer sheet. Every problem comes from real DevOps, SRE, Platform and Cloud interviews, from your first script to a system you build yourself.
Open the Coding SheetRAG stands for Retrieval Augmented Generation. Your code first searches your own documents for passages that relate to the question, then gives only those passages to a language model and asks it to answer from them. It works like an open-book exam: the model does not need to remember the facts because it can read them.
Yes, for most real systems. Sending hundreds of pages with every question is slow and expensive, and every user would see every document. Retrieval also lets you filter by permission and cite the exact source. Pasting the whole text is fine for one short document.
There is no universal size. Start by splitting along the structure of the document, such as sections and paragraphs, and keep each chunk to a few hundred tokens. Then measure on real questions and adjust, because the right size depends on how your documents are written.
Most of the time retrieval failed, not the model. The correct passage was never found, was ranked too low, or was filtered out. Check each stage in order: is the fact in the index, in the candidate list, in the final top results, and in the prompt?
Use RAG when answers must come from documents that change or must be cited. Use fine-tuning to change behaviour, such as tone or output format. Many teams try better prompting first, then RAG, and fine-tune only when the first two are not enough.