Week 05: LangGraph — Stateful Multi-Agent Systems
What You'll Learn
LangGraph is where serious agent orchestration happens. You'll understand state machines, node and edge composition, conditional branching, and how to build multi-agent networks that coordinate without getting into infinite loops.
Session Schedule
| Day | Time | Focus |
|---|---|---|
| Saturday | 8:00 - 11:00 PM WAT | LangGraph Architecture & State Machines |
| Sunday | 8:00 - 11:00 PM WAT | Multi-Agent Build |
Pre-Requisites
- Weeks 01-04 completed
- CORTEX M1 started
- Understanding of agent patterns from Week 02
Topics Covered
LangGraph State Machines
StateGraph, TypedDict state, node functions, compile & invoke. The foundation of building stateful, composable agent workflows.
StateGraph TypedDict NodesSupervisor & Specialist Patterns
Supervisor routing, specialist agents, delegation patterns. How to build a boss agent that knows which worker to call.
Supervisor Specialist DelegationConditional Edges & Branching
add_conditional_edges, router functions, dynamic routing based on state. Build graphs that make intelligent decisions at every node.
Conditional Edges Router Dynamic RoutingHuman-in-the-Loop Checkpoints
interrupt_before, interrupt_after, checkpoint persistence, approval flows. Let humans supervise and approve critical agent decisions.
HITL Checkpoints InterruptsParallel Agent Execution
Fan-out/fan-in, parallel node execution, result aggregation. Run multiple agents simultaneously and merge their outputs.
Parallel Fan-out AggregationWeekly Build: Supervisor Agent Network
Build a supervisor that routes queries to 3 specialist agents (Knowledge, Research, Action) based on intent classification.
Architecture
User Query + Context
|
v
SUPERVISOR NODE (intent classification)
|
├── condition: "knowledge" → KNOWLEDGE AGENT
├── condition: "research" → RESEARCH AGENT
├── condition: "action" → ACTION AGENT
└── condition: "unknown" → FALLBACK RESPONSE
|
v
RESPONSE NODE (format & return)
Key Files
| File | Purpose |
|---|---|
agents/supervisor.py | LangGraph state machine |
agents/knowledge_agent.py | Knowledge specialist agent |
agents/research_agent.py | Research specialist agent |
agents/action_agent.py | Action specialist agent |
graph.py | Graph definition & compilation |
Resources
Required Reading
- LangGraph Official Documentation
- LangGraph Multi-Agent Tutorial
- LangGraph Human-in-the-Loop Guide
Code Repository
Clone the bootcamp repo and switch to the week-05 branch:
git clone https://github.com/softbricks-academy/agentic-ai-bootcamp.git cd agentic-ai-bootcamp git checkout week-05
Session Recording
Recording will be available within 24 hours after the live session. Check the WhatsApp group for the link.
Homework
Due before Week 6 live session.
- Complete the supervisor agent network — push your code to the bootcamp repo
- Add a 4th specialist agent — extend the supervisor to route to a new specialist of your choice
- Implement checkpointing — add human-in-the-loop approval before the action agent executes
- Test with 10 diverse queries — document routing accuracy and share results in the WhatsApp group