RAG
Retrieval-augmented generation across the AISL material: the classic pipeline, where it breaks, and how agentic search fixes it.
RAG answers questions from documents the model was never trained on: retrieve relevant chunks, stuff them into the prompt, generate an answer grounded in them. Almost every AISL course and workshop touches it. The material's central claim about RAG is also its most useful lesson: a fixed pipeline searches once and hopes, and the interesting failures begin exactly there.
The classic pipeline
The recipe appears first in AI Hero: 7-Day AI Agents Crash-Course: download a real GitHub repository, chunk the documentation, index it, retrieve, generate with citations. The AI Engineering Buildcamp module 2 repeats it over real use cases — a FAQ chatbot, content management, YouTube transcripts, PDF books — with a reusable RAG class.
Agentic RAG
builds the classic version first, over the Evidently AI documentation with
minsearch, precisely so you can watch it break.
Where fixed RAG breaks
Two failures show up consistently across the material:
- A typo or unusual phrasing derails keyword retrieval, and the pipeline has no second chance. The Agentic Loop from Scratch starts from exactly this failure.
- Chunking loses context: the retrieved snippet is not the document, and the answer inherits the gap.
Retrieval quality itself is a separate discipline — see Vector Search for TF-IDF, boosting, and embeddings.
Agentic search: RAG with tools
The fix the material converges on is to stop fixing the pipeline and give the
decision to the model. In Agentic
RAG the agent
gets search (highlighted snippets) and get_file (the full document), and
mirrors how a human reads docs: search, scan, open the promising one. The
same pattern powers the FAQ agents in End-to-End Agent
Deployment
and Building AI Agents with MCP, PydanticAI, and
OpenAI.
The buildcamp module 3 formalizes it as agentic RAG with tool calling, on the way from RAG into full Agents.
Where to go next
- The retrieval layer underneath: Vector Search
- Giving the model control of the loop: Agents
- Keeping a RAG agent on topic and safe: Guardrails
Keep building with a membership
Every topic guide is free to read. Members get structured courses, live workshops, and feedback on real projects.