Every lab ships as runnable code
TypeScript and OpenAI, behind one provider seam you can swap. The four-week repo carries all six labs, grouped into the four weeks below, so nothing is dropped for the shorter format.
github.com/ehsangazar/maven-llms-and-agents-4-weeks ↗A field guide to the tools
Each week ends with the common tools for that stage of the stack. Every tool has a decision-first page: what it is, the one job it does, when to reach for it, when to skip it, and where it fits your labs. The tools are a means; the architecture is the lesson.
Week 1 · Foundations: workflows, agents & the code/model boundary
Oct 5 – 11
S1 · Why demos die in production, and when you even need an agent
The failure modes that show up the moment a demo meets real traffic. Workflows vs agents: start simple, because most tasks want a workflow, not an autonomous agent. The five workflow patterns (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer) and the decision map for choosing between them. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s1-why-demos-die Thu Oct 8S2 · Workshop: decide what the model should never touch
What to hand the model versus keep in code, the single decision that most shapes reliability. Place your own system on the workflow-to-agent spectrum, draw its boundary, and write down what stays deterministic no matter how good the model gets. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s2-model-boundary cheat sheet Reference · cheat sheetWorkflow Patterns Cheat Sheet
Week 1 on one page: workflow vs agent, the five patterns, the three-gate decision map, the four ways demos die, and the antipatterns. Skim before you reach for an agent.
/cheatsheets/workflow-patterns hands-on lab Lab 1 · build itBuild a Workflow Router
Classify each request and route it to a rules handler, a small model, or a big model, with validation and a fallback. Starter code, steps, acceptance criteria. Report your cost split.
/llms-and-agents-4-weeks/lab-workflow-routerWeek 2 · Context engineering & retrieval
Oct 12 – 18
S3 · Why your agent gets worse the longer it runs
Context engineering as the real lever, not prompt wording. The window as a budget and lost-in-the-middle. RAG done properly: hybrid search, re-ranking, chunking, and agentic retrieval that decides for itself when and what to fetch. Memory, and exactly how multi-turn context degrades over a long session. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s3-context-engineering Thu Oct 15S4 · Workshop: build a context pipeline that survives a long session
For your system: what to fetch, how to rank it, how to compact a growing history, and what to deliberately keep out of the window. You leave with the pipeline drawn end to end. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s4-context-pipeline artifact Project 1 · submit by Wed Oct 14P1 · Context & Retrieval Design
A design for what your model sees on every request: sources, ranking, chunking, and the exclusions you can defend. The first of the three artifacts.
/llms-and-agents-4-weeks/p1-context-retrieval-design cheat sheet Reference · cheat sheetRAG & Context Engineering Cheat Sheet
The window as a budget, lost-in-the-middle, the pipeline, hybrid search, chunking, re-ranking, agentic retrieval, memory, and a params quick-reference.
/cheatsheets/rag-context hands-on lab Lab 2 · build itBuild a Hybrid-Search RAG Pipeline
Chunk, retrieve with dense + BM25, fuse, re-rank to a few, assemble to a token budget, and refuse to answer when nothing is relevant. Starter code included.
/llms-and-agents-4-weeks/lab-hybrid-ragWeek 3 · Agent architecture, cost & security
Oct 19 – 25 · the double week: architecture and cost decided together
S5 · How each agent pattern breaks, and what each one costs
Tool use, planning loops, memory, and single versus multi-agent, with tools and outputs treated as contracts. Each pattern mapped to exactly how it breaks, and priced: per-request cost and latency ceilings, and the levers that hold them (caching, batching, streaming, model routing, right-sizing). You choose the pattern with both the failure mode and the bill in view. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s5-agent-patterns-cost Thu Oct 22S6 · Workshop: threat-model your agent and cap its spend
Prompt injection (OWASP LLM01), tool poisoning, and indirect injection through retrieved content. Tool approvals, allow-lists, least-privilege tooling, and output guardrails. Then put numbers on it: a cost and latency budget, the retry and fallback ladder, and a first pass at how each part fails. 7:30 – 8:45 PM (GMT+1).
/llms-and-agents-4-weeks/s6-threat-model-budget artifact Project 2 · submit by Wed Oct 21P2 · Cost & Latency Budget
Ceilings you can defend, the levers you would pull first, and the failure-mode runbook you start here and finish in Week 4.
/llms-and-agents-4-weeks/p2-cost-latency-budget cheat sheet Reference · cheat sheetCost, Latency & Reliability Cheat Sheet
The cost formula and pricing math, the five levers, caching, routing, the fallback ladder, the retry-idempotency trap, and a request-budget template.
/cheatsheets/cost-latency cheat sheet Reference · cheat sheetAgent Patterns & Prompt-Injection Cheat Sheet
Agent anatomy, tools as contracts, the ReAct loop, single vs multi-agent, prompt injection (OWASP LLM01), defense-in-depth, the trust boundary, and real cases.
/cheatsheets/agent-security hands-on lab Lab 3 · build itAdd a Budget, Cache & Fallback Ladder
Wrap a model call with a cost/latency budget, a semantic cache, a retry-and-fallback ladder, and an idempotency key so a retry can't double-charge. Starter code included.
/llms-and-agents-4-weeks/lab-budget-cache-fallback hands-on lab Lab 4 · build itBuild a Tool-Using Agent with Guardrails
A ReAct agent with least-privilege tools, a step cap, an approval gate before writes, and an injected document it must refuse. Starter code plus a threat model.
/llms-and-agents-4-weeks/lab-guardrailed-agentWeek 4 · Prove it, then defend it
Oct 26 – Nov 1 · evals, observability and the capstone
S7 · Prove it works before someone senior asks you to
Why grading the final answer isn't enough for agents: tool-calling, task-completion and trajectory evals. Offline eval sets plus online evals on sampled traffic, and the loop where failed production traces become new eval cases. Then the observability half: tracing, cost / latency / quality dashboards, prompt versioning, and finishing the failure-mode runbook. 7:30 – 8:45 PM (GMT).
/llms-and-agents-4-weeks/s7-prove-it Thu Oct 29S8 · Capstone: defend your design to the room
Present the end-to-end design that pulls every decision from the four weeks together, and defend it the way you would to a staff panel: the boundary, the context pipeline, the pattern, the budget, the threats, the evals. Live feedback in the room, then what to practise next. 7:30 – 8:45 PM (GMT).
/llms-and-agents-4-weeks/s8-capstone-defence-part2 artifact Project 3 · submit by Wed Oct 28P3 · Agent Architecture Decision + Threat Model
The pattern you chose, why you chose it, the threats it exposes, and the mitigations you'll rely on. The last of the three artifacts, and the spine of your capstone.
/llms-and-agents-4-weeks/p3-agent-architecture-threat-model cheat sheet Reference · cheat sheetEvals & Observability Cheat Sheet
Output vs trajectory evals, the three graders, the four metrics, offline vs online, the flywheel, an eval-case and a trace in JSON, and the three dashboards.
/cheatsheets/evals-observability cheat sheet Reference · cheat sheetProduction LLM System Design Checklist
The seven-section design document, the whole system on one page, the reviewer's hard questions, the common gaps, and a pre-ship checklist. Bring it to the Thursday defence.
/cheatsheets/production-checklist hands-on lab Lab 5 · build itBuild an Eval Harness
A golden set, a runner, rule + LLM-judge graders, a trajectory check, and a pass-rate report that catches a regression you deliberately introduce. Starter code included.
/llms-and-agents-4-weeks/lab-eval-harness hands-on lab Lab 6 · bring it togetherCapstone: Integrate & Defend
Combine Labs 1-5 into one system behind a single entry point, write the seven-section design doc, run your eval harness on it, and prepare the five-minute walkthrough for Thursday.
/llms-and-agents-4-weeks/lab-capstone-integration