Week 7. RAG pipeline: chunk, retrieve, cite using the corpus.
Problem statement
You ship an internal Q&A bot over policy docs. Engineering asks you for chunk size, metadata, and citation behavior.
Outcomes
Explain ingest → chunk → embed → retrieve → generate; run a minimal RAG over practice-env/corpus.
Deliverables
- Working minimal RAG or detailed manual simulation (keyword overlap) if no API key—state which.
rag_trace.md: 5 questions with retrieved spans + answers + citations.
Links
- [ ] Embeddings + vector search explainer (vendor-neutral or provider).
- [ ] Skim LlamaIndex or LangChain RAG tutorial intro (architecture diagram only ok).
Time: ~3 h.
Corpus: ../../practice-env/corpus/ (product_faq.md, internal_rfc_ai_sidebar.md).
Task A — Chunking plan
Write chunking_plan.md: chunk boundaries (by heading vs fixed size), overlap, what metadata you store per chunk.
Task B — Retrieval + answers
Build minimal RAG or scripted retrieval (TF-IDF/keyword) + LLM answer or hand-written answers from chunks only.
Task C — Traces
rag_trace.md: 5 user questions. For each: top chunks used, final answer, citation to file + heading or chunk id.
Submit: my-submissions/week-07/.
30 min. Closed notes.
1
List the five stages of a typical RAG pipeline (verbs ok).
2
Why does chunking affect both precision and recall?
3
Name two RAG failure modes that don’t require a “bad model.”
Self-grade: Phase 4 checklist.
Concepts & curated links: read the Learn chapter RAG first (topic path, not calendar-only). This file is the weekly practice bank — extra drills and a checklist on top of Readings → Practice → Exam.
1. Practice bank
| # | Problem | Data / materials | Expected outcome |
|---|---|---|---|
| P1 | Write a chunking plan for practice-env/corpus/*.md. |
practice-env/corpus/ |
chunking_plan.md |
| P2 | Run minimal RAG or keyword fallback + answer 5 questions with citations. | Corpus files | rag_trace.md |
2. Week checklist
- [ ] RAG + embeddings reads done
- [ ]
PRACTICE.md+EXAM.md