MODULE 5 · DAY 2
Docs Assistant — Naive RAG
Grounding an LLM in your own documents
Gourav Shah · School of DevOps & AI · Hands-on
M5·01
What you'll learn
The anatomy of a real GenAI app — and how to wire it in containers.
By the end you have a containerised Docs Assistant that answers grounded questions about Acme's runbooks.
M5·02
A model alone can't answer about YOUR docs
It answers confidently from training data that predates your runbooks — and gets it wrong.
RAG gives the model a cheat sheet at query time — it generates from context, not from stale weights.
M5·03
Anatomy of a GenAI application
Four parts, wired together. You already built the first two in M2 and M3.
LLM endpoint + embedding model + vector DB + application — M5 adds the vector DB and the app layer.
M5·04
A vector DB shelves by meaning, not title
A filing cabinet needs the exact name. A librarian understands what you mean.
Embeddings are coordinates that encode meaning — similar passages land near each other, so similarity search finds them.
M5·05
Embeddings: text becomes coordinates
An embedding model turns each passage into 768 numbers that place it in meaning-space.
The same model embeds both your documents and your questions — that shared space is what makes retrieval work.
M5·06
The naive-RAG pipeline
Ingest once. Then answer every question with the same embedding step.
Load → chunk → embed → store, then embed → retrieve → augment → generate. The embedding step is shared.
M5·07
Where the pieces run
Models stay native for Metal; the vector store and app are containers.
The M2 pattern continues: model servers native, everything else containerised over the host bridge.
M5·08
ChromaDB — the lightest vector store
Zero-config and under 2 GB — the right default for a 16 GB laptop. Scale up when you outgrow it.
The API you learn — add_documents, similarity_search — is nearly identical across every alternative.
M5·09
Wired via environment variables
Hand-author the compose service by service. Endpoints are just env vars — portable across runtimes.
Swap the endpoint values and the same stack runs anywhere — the wiring is configuration, not code.
M5·10
Learning Mode — watch the pipeline run
The app surfaces each step live, with timings, so the invisible parts of RAG become visible.
Trace which sentence in which document produced the answer — the single best tool for building RAG intuition.
M5·11
Where naive RAG breaks down
It works when the question matches the wording. It fails in predictable ways.
An agent can rewrite queries, retry retrieval, and judge sufficiency — understanding these failures motivates M6.
M5·12
TO THE LAB
Retrieve, then generate — grounded.
Hand-author the compose, ingest Acme's runbooks, and watch Learning Mode reveal the answer.
Next: Lab — build the Docs Assistant. · Gourav Shah · School of DevOps & AI
M5·13