Week 4
Week 4: RAG, Context, and Agentic Systems
RAG, retrieval quality, orchestration, and attack-aware agent design.
This lesson explains why retrieval-augmented generation exists and, more importantly, when it is the wrong answer.
Week 4
RAG, retrieval quality, orchestration, and attack-aware agent design.
This lesson explains why retrieval-augmented generation exists and, more importantly, when it is the wrong answer.
Checkpoint
Retrieval and Agent GateThis week ends with a gated checkpoint. You progress by shipping a real artifact, not by reading passively.
Deliverable
A retrieval architecture brief and an agent threat model.Each week leaves behind portfolio evidence that compounds into the final SaaS and its operating narrative.
Week Thesis
This lesson explains why retrieval-augmented generation exists and, more importantly, when it is the wrong answer.
RAG adds operational complexity. If you do not need external knowledge grounding, retrieval may just add latency, cost, and new failure modes.
Use RAG when the model needs fresh or proprietary context at inference time and the answer quality depends on retrieving the right evidence first.
This lesson focuses on the pre-generation layer of RAG: how documents are split, embedded, retrieved, and used to support grounded answers.
Lesson Stack
Lesson Preview
RAG is a product design choice, not a mandatory AI ingredient.
This lesson explains why retrieval-augmented generation exists and, more importantly, when it is the wrong answer.
RAG adds operational complexity. If you do not need external knowledge grounding, retrieval may just add latency, cost, and new failure modes.
Use RAG when the model needs fresh or proprietary context at inference time and the answer quality depends on retrieving the right evidence first.
Lesson Preview
Retrieval quality is determined long before the generation step.
This lesson focuses on the pre-generation layer of RAG: how documents are split, embedded, retrieved, and used to support grounded answers.
If retrieval quality is poor, the generator is forced to hallucinate or overfit to irrelevant snippets. Most “RAG is bad” complaints are actually retrieval design failures.
Generation quality is downstream of retrieval quality. Retrieval quality is downstream of document structure, chunking strategy, metadata discipline, and ranking logic.
Lesson Preview
Agent systems inherit every application security problem plus new orchestration ones.
This lesson studies agentic systems as orchestrated workflows with memory, tools, and state transitions, not as magic “autonomous” entities.
Agents multiply failure surfaces: prompt injection, over-broad tool access, bad intermediate state, poisoned retrieval, and unclear authority boundaries.
An agent is a policy-constrained state machine wrapped around a model. The model reasons; the surrounding system must decide what actions are permitted and what evidence is trusted.
Portfolio Artifact
brief
A design memo covering chunking, indexing, retrieval quality, and answer grounding.