LangGraph & Agents
This chapter models agents as state machines whose nodes, routes, reducers, checkpoints, tool boundaries, and human approvals can be inspected and resumed.
- Explain Graph architecture by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain State & checkpointing by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Multi-agent patterns by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Compilation, tools & handoff by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
How to use this chapter
For LangGraph & Agents, read the explanations first and predict every example before running it. Keep a learning repository containing code, tests, command output, and the short written submission. The roadmap checklist at the end audits coverage; the chapter itself follows the architecture learning arc appropriate to this subject.
The problem this chapter solves
This chapter models agents as state machines whose nodes, routes, reducers, checkpoints, tool boundaries, and human approvals can be inspected and resumed.
A model alone has limited freshness, reliability, context, and agency. Engineering layers constrain outputs, ground claims in data, and make decisions inspectable and recoverable.
Learning outcomes
- Explain Graph architecture by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain State & checkpointing by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Multi-agent patterns by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Compilation, tools & handoff by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
Chapter progression
The order below is intentional: later sections depend on guarantees established earlier.
Runtime or system overview
Text is tokenized and processed autoregressively: each output token is sampled from a conditional distribution. Retrieval adds selected external context; tool calling asks normal code to perform actions; agent graphs persist explicit state and routes. None of these mechanisms guarantee truth, so evaluation and validation remain mandatory. In LangGraph & Agents, use that execution model to decide where the chapter's validation, state ownership, cleanup, and evidence belong.
Execution trace
- Deterministic code validates the request, identity, tenant, budgets, schemas, and permitted tools before assembling model context.
- Retrieval or memory selection chooses bounded, provenance-bearing evidence; tokenization converts the assembled messages into the model's input sequence.
- The provider generates or streams tokens, or proposes typed tool arguments; application code validates every output and executes only authorized bounded actions.
- Parsers and business rules accept, repair once under policy, route, or reject the result; citations and state transitions are persisted with model, prompt, index, and dataset versions.
- Offline evaluation and production telemetry measure retrieval, faithfulness, latency, token cost, tool errors, safety outcomes, and regressions by cohort.
Memory and performance lens
Context windows hold tokens, not durable memory. Conversation memory is application-managed storage that is selected and inserted into later prompts. Embedding indexes store vectors plus metadata; agent checkpoints store state transitions. Token budgets, cache policy, and data retention must be designed explicitly. For LangGraph & Agents, connect those costs to the concrete operations in the topic sections rather than assuming the friendly surface syntax is cheap.
When tuning LangGraph & Agents, measure capacity per critical path, tail latency, availability/error budget, consistency lag, recovery objectives, cost per outcome, and evaluation quality rather than optimizing from source-code appearance.
1. Graph architecture
The Graph architecture unit begins with StateGraph vs MessageGraph: A LangGraph application defines explicit typed state, node transitions, conditional routing, and termination. Keep nodes small, deterministic where possible, and explicit about side effects. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Requirements, ownership, and trade-offs: Graph architecture
| Concept | Meaning | Engineering decision |
|---|---|---|
| StateGraph vs MessageGraph | A LangGraph application defines explicit typed state, node transitions, conditional routing, and termination. | Keep nodes small, deterministic where possible, and explicit about side effects. |
| TypedDict for state definition | A LangGraph application defines explicit typed state, node transitions, conditional routing, and termination. | Keep nodes small, deterministic where possible, and explicit about side effects. |
| node functions: (state) → state update | A LangGraph node is a named callable that reads the current typed graph state and returns only the fields it intends to update. | Keep nodes small, make inputs/outputs explicit, isolate side effects behind idempotent tools, and unit-test the node as a state transformation. |
| conditional edges with routing functions | A LangGraph application defines explicit typed state, node transitions, conditional routing, and termination. | Keep nodes small, deterministic where possible, and explicit about side effects. |
| END node and termination | A LangGraph application defines explicit typed state, node transitions, conditional routing, and termination. | Keep nodes small, deterministic where possible, and explicit about side effects. |
Critical path and failure behavior: Graph architecture
StateGraph vs MessageGraph. Each node returns a state update; reducers resolve concurrent updates; routing functions select edges; the compiled graph drives execution.
TypedDict for state definition. Each node returns a state update; reducers resolve concurrent updates; routing functions select edges; the compiled graph drives execution.
node functions: (state) → state update. The compiled runtime invokes the node at a scheduled transition, applies configured reducers to its update, checkpoints the new state when enabled, and routes along outgoing or conditional edges.
conditional edges with routing functions. Each node returns a state update; reducers resolve concurrent updates; routing functions select edges; the compiled graph drives execution.
END node and termination. Each node returns a state update; reducers resolve concurrent updates; routing functions select edges; the compiled graph drives execution.
Read these as one system: StateGraph vs MessageGraph establishes the starting contract, TypedDict for state definition changes how that contract is executed or represented, and END node and termination exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
A concrete design decision: Graph architecture
1graph = StateGraph(State); graph.add_node("retrieve", retrieve); graph.add_conditional_edges(...)This Graph architecture slice makes StateGraph vs MessageGraph observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward END node and termination, predict its behavior for empty, invalid, repeated, and large input.
Designs that fail under real load: Graph architecture
| Risk | Why it matters |
|---|---|
| StateGraph vs MessageGraph | A route without a bounded termination condition can loop indefinitely. |
| TypedDict for state definition | A route without a bounded termination condition can loop indefinitely. |
| node functions: (state) → state update | Mutating shared state in place or hiding output in globals breaks reducers, replay, parallel branches, and deterministic tests. |
| conditional edges with routing functions | A route without a bounded termination condition can loop indefinitely. |
| END node and termination | A route without a bounded termination condition can loop indefinitely. |
Design review exercise: Graph architecture
- Foundation: implement or demonstrate StateGraph vs MessageGraph with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine StateGraph vs MessageGraph with TypedDict for state definition. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for END node and termination. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
2. State & checkpointing
The State & checkpointing unit begins with Annotated state with reducers (add_messages): Checkpointing persists graph state at execution boundaries so a thread can resume, inspect history, or branch from a prior state. Use durable storage for production, isolate tenants, and version the state schema. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Requirements, ownership, and trade-offs: State & checkpointing
| Concept | Meaning | Engineering decision |
|---|---|---|
| Annotated state with reducers (add_messages) | Checkpointing persists graph state at execution boundaries so a thread can resume, inspect history, or branch from a prior state. | Use durable storage for production, isolate tenants, and version the state schema. |
| MemorySaver/SqliteSaver/PostgresSaver checkpointers | A repository gives domain code a stable persistence interface while a transaction makes a group of changes atomic. | Use parameterized SQL and short transactions. |
| thread IDs for conversation isolation | Checkpointing persists graph state at execution boundaries so a thread can resume, inspect history, or branch from a prior state. | Use durable storage for production, isolate tenants, and version the state schema. |
| time-travel: replaying from checkpoint | Checkpointing persists graph state at execution boundaries so a thread can resume, inspect history, or branch from a prior state. | Use durable storage for production, isolate tenants, and version the state schema. |
Critical path and failure behavior: State & checkpointing
Annotated state with reducers (add_messages). The checkpointer associates state snapshots and pending transitions with a thread identifier and checkpoint lineage.
MemorySaver/SqliteSaver/PostgresSaver checkpointers. SQLite serializes writes through database locks and uses a journal or WAL for atomic recovery. A context manager should commit on success and roll back on failure.
thread IDs for conversation isolation. The checkpointer associates state snapshots and pending transitions with a thread identifier and checkpoint lineage.
time-travel: replaying from checkpoint. The checkpointer associates state snapshots and pending transitions with a thread identifier and checkpoint lineage.
Read these as one system: Annotated state with reducers (add_messages) establishes the starting contract, MemorySaver/SqliteSaver/PostgresSaver checkpointers changes how that contract is executed or represented, and time-travel: replaying from checkpoint exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
A concrete design decision: State & checkpointing
1Category.objects.annotate(review_count=Count("products__reviews"))This State & checkpointing slice makes Annotated state with reducers (add_messages) observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward time-travel: replaying from checkpoint, predict its behavior for empty, invalid, repeated, and large input.
Designs that fail under real load: State & checkpointing
| Risk | Why it matters |
|---|---|
| Annotated state with reducers (add_messages) | Replaying a checkpoint can repeat side effects unless nodes use idempotency records. |
| MemorySaver/SqliteSaver/PostgresSaver checkpointers | Sharing one connection across unrelated threads or holding a transaction during user input causes contention. |
| thread IDs for conversation isolation | Replaying a checkpoint can repeat side effects unless nodes use idempotency records. |
| time-travel: replaying from checkpoint | Replaying a checkpoint can repeat side effects unless nodes use idempotency records. |
Design review exercise: State & checkpointing
- Foundation: implement or demonstrate Annotated state with reducers (add_messages) with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine Annotated state with reducers (add_messages) with MemorySaver/SqliteSaver/PostgresSaver checkpointers. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for time-travel: replaying from checkpoint. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
3. Multi-agent patterns
The Multi-agent patterns unit begins with ToolNode + @tool decorator + tools_condition: A decorator receives a callable or class and returns a replacement, usually adding cross-cutting behavior. Use it for orthogonal policy such as timing, authorization, validation, retry, or caching. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Requirements, ownership, and trade-offs: Multi-agent patterns
| Concept | Meaning | Engineering decision |
|---|---|---|
| ToolNode + @tool decorator + tools_condition | A decorator receives a callable or class and returns a replacement, usually adding cross-cutting behavior. | Use it for orthogonal policy such as timing, authorization, validation, retry, or caching. |
| supervisor agent pattern routes to subagents | Agent networks route work among specialized nodes while human interrupts create explicit approval or correction points. | Use the smallest network that improves measurable quality and make authority narrower than reasoning scope. |
| hierarchical agent networks | Agent networks route work among specialized nodes while human interrupts create explicit approval or correction points. | Use the smallest network that improves measurable quality and make authority narrower than reasoning scope. |
| interrupt_before/after for human-in-the-loop | Agent networks route work among specialized nodes while human interrupts create explicit approval or correction points. | Use the smallest network that improves measurable quality and make authority narrower than reasoning scope. |
Critical path and failure behavior: Multi-agent patterns
ToolNode + @tool decorator + tools_condition. Decoration runs when the definition is executed, not at each call; the returned wrapper is what the name references. wraps preserves metadata and the wrapped chain.
supervisor agent pattern routes to subagents. A supervisor reads shared state and selects a worker; tool nodes execute validated calls; an interrupt persists state before returning control.
hierarchical agent networks. A supervisor reads shared state and selects a worker; tool nodes execute validated calls; an interrupt persists state before returning control.
interrupt_before/after for human-in-the-loop. A supervisor reads shared state and selects a worker; tool nodes execute validated calls; an interrupt persists state before returning control.
Read these as one system: ToolNode + @tool decorator + tools_condition establishes the starting contract, supervisor agent pattern routes to subagents changes how that contract is executed or represented, and interrupt_before/after for human-in-the-loop exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Designs that fail under real load: Multi-agent patterns
| Risk | Why it matters |
|---|---|
| ToolNode + @tool decorator + tools_condition | Keep retries bounded and restricted to transient, idempotent operations. |
| supervisor agent pattern routes to subagents | More agents increase latency, cost, coordination errors, and prompt-injection surface. |
| hierarchical agent networks | More agents increase latency, cost, coordination errors, and prompt-injection surface. |
| interrupt_before/after for human-in-the-loop | More agents increase latency, cost, coordination errors, and prompt-injection surface. |
Design review exercise: Multi-agent patterns
- Foundation: implement or demonstrate ToolNode + @tool decorator + tools_condition with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine ToolNode + @tool decorator + tools_condition with supervisor agent pattern routes to subagents. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for interrupt_before/after for human-in-the-loop. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
4. Compilation, tools & handoff
The Compilation, tools & handoff unit begins with compile and Mermaid graph visualization: Compiling a LangGraph validates and turns declared nodes, edges, reducers, entry points, and checkpoint behavior into an executable graph; visualization exposes that topology for review. Compile during startup/tests, render the graph in documentation, and pair visual review with route and termination tests. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
Requirements, ownership, and trade-offs: Compilation, tools & handoff
| Concept | Meaning | Engineering decision |
|---|---|---|
| compile and Mermaid graph visualization | Compiling a LangGraph validates and turns declared nodes, edges, reducers, entry points, and checkpoint behavior into an executable graph; visualization exposes that topology for review. | Compile during startup/tests, render the graph in documentation, and pair visual review with route and termination tests. |
| parallel tool call aggregation | Tool calling lets the model propose typed arguments while ordinary code validates authorization and performs the action. | Validate twice, use idempotency keys for side effects, and require confirmation for high-impact actions. |
| agent handoff messages and ownership | An agent handoff is a typed transfer of a bounded task, relevant evidence, authority, and expected result from one graph node or specialist to another. | Use handoffs when specialization measurably helps, keep one supervisor or state machine responsible for termination, and include provenance plus failure status. |
| interrupt resume with Command | An interrupt pauses a LangGraph run at a durable approval or input boundary; a Command resumes that same thread with an explicit update and routing instruction. | Use interrupts for high-impact actions, missing information, or review decisions and record approver identity, scope, time, and submitted value. |
| researcher/writer/critic state contract | A researcher/writer/critic workflow separates evidence collection, grounded drafting, and quality review through a shared typed state contract. | Define ownership for every field, preserve source provenance, use bounded revision cycles, and make the critic evaluate explicit criteria. |
Critical path and failure behavior: Compilation, tools & handoff
compile and Mermaid graph visualization. Compilation resolves routes and creates a runtime plan. A Mermaid representation is derived from graph metadata, but it does not execute tools or prove that conditional routes terminate.
parallel tool call aggregation. The application sends JSON schemas, receives zero or more calls, executes allowed functions, appends results, and asks the model to continue until a bounded stop condition.
agent handoff messages and ownership. The sender writes a handoff record into shared state; routing selects the receiver; the receiver returns a structured result without inheriting broader tool permissions automatically. Checkpoints preserve who owned each transition.
interrupt resume with Command. The checkpointer stores the state and pending transition before control returns to the application. Resume identifies the thread/checkpoint, validates the human or external input, applies the command, and continues from the recorded point.
researcher/writer/critic state contract. The researcher writes sources and findings, the writer consumes only approved evidence to produce claims and citations, and the critic records structured defects or approval. Reducers and routes determine revision limits and termination.
Read these as one system: compile and Mermaid graph visualization establishes the starting contract, parallel tool call aggregation changes how that contract is executed or represented, and researcher/writer/critic state contract exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Designs that fail under real load: Compilation, tools & handoff
| Risk | Why it matters |
|---|---|
| compile and Mermaid graph visualization | A diagram can look correct while a routing function creates an infinite loop or an unreachable recovery node. |
| parallel tool call aggregation | The model's tool choice and arguments are untrusted input. |
| agent handoff messages and ownership | Free-form prose handoffs lose constraints and can let one agent smuggle untrusted instructions or authority into another. |
| interrupt resume with Command | Resuming the wrong tenant/thread or replaying a side-effecting pre-interrupt node can duplicate actions or bypass approval. |
| researcher/writer/critic state contract | Allowing every agent to overwrite every field creates circular revisions, lost evidence, and no auditable reason for the final answer. |
Design review exercise: Compilation, tools & handoff
- Foundation: implement or demonstrate compile and Mermaid graph visualization with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine compile and Mermaid graph visualization with parallel tool call aggregation. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for researcher/writer/critic state contract. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
Complete worked example
This example integrates the chapter rather than demonstrating an isolated method.
1from typing import Annotated, TypedDict2from langgraph.graph import END, StateGraph3from langgraph.graph.message import add_messages4
5class State(TypedDict):6 messages: Annotated[list, add_messages]7 evidence: list[dict]8 approved: bool9
10graph = StateGraph(State)11graph.add_node("retrieve", retrieve)12graph.add_node("answer", answer)13graph.add_edge("retrieve", "answer")14graph.add_conditional_edges("answer", route_after_answer, {"done": END, "review": "human_review"})15graph.set_entry_point("retrieve")16app = graph.compile(checkpointer=checkpointer, interrupt_before=["human_review"])Expected result
1Execution persists state and pauses before human_review when the routing function requires approval.Line-by-line reading
| Line | Code | Explanation |
|---|---|---|
| 1 | from typing import Annotated, TypedDict | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 2 | from langgraph.graph import END, StateGraph | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 3 | from langgraph.graph.message import add_messages | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 5 | class State(TypedDict): | Creates a class namespace and binds the resulting class object to this name. |
| 6 | messages: Annotated[list, add_messages] | Implements the next python statement in the example's data flow. |
| 7 | evidence: list[dict] | Implements the next python statement in the example's data flow. |
| 8 | approved: bool | Implements the next python statement in the example's data flow. |
| 10 | graph = StateGraph(State) | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 11 | graph.add_node("retrieve", retrieve) | Implements the next python statement in the example's data flow. |
| 12 | graph.add_node("answer", answer) | Implements the next python statement in the example's data flow. |
| 13 | graph.add_edge("retrieve", "answer") | Implements the next python statement in the example's data flow. |
| 14 | graph.add_conditional_edges("answer", route_after_answer, {"done": END, "review": "human_review"}) | Implements the next python statement in the example's data flow. |
| 15 | graph.set_entry_point("retrieve") | Implements the next python statement in the example's data flow. |
| 16 | app = graph.compile(checkpointer=checkpointer, interrupt_before=["human_review"]) | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
Step-by-step execution
- Deterministic code validates the request, identity, tenant, budgets, schemas, and permitted tools before assembling model context.
- Retrieval or memory selection chooses bounded, provenance-bearing evidence; tokenization converts the assembled messages into the model's input sequence.
- The provider generates or streams tokens, or proposes typed tool arguments; application code validates every output and executes only authorized bounded actions.
- Parsers and business rules accept, repair once under policy, route, or reject the result; citations and state transitions are persisted with model, prompt, index, and dataset versions.
- Offline evaluation and production telemetry measure retrieval, faithfulness, latency, token cost, tool errors, safety outcomes, and regressions by cohort.
Common mistakes and professional corrections
| Area | Common failure | Better engineering choice |
|---|---|---|
| Graph architecture | A route without a bounded termination condition can loop indefinitely. | Keep nodes small, deterministic where possible, and explicit about side effects. |
| State & checkpointing | Replaying a checkpoint can repeat side effects unless nodes use idempotency records. | Use durable storage for production, isolate tenants, and version the state schema. |
| Multi-agent patterns | Keep retries bounded and restricted to transient, idempotent operations. | Use it for orthogonal policy such as timing, authorization, validation, retry, or caching. |
| Compilation, tools & handoff | A diagram can look correct while a routing function creates an infinite loop or an unreachable recovery node. | Compile during startup/tests, render the graph in documentation, and pair visual review with route and termination tests. |
Interview and review notes
- Define the central abstraction without naming a library function.
- Trace one request, call, query, message, render, or state transition from input to observable result.
- Compare two alternatives from this chapter by guarantee, cost, and failure behavior.
- Explain the most likely production bug and the test or metric that reveals it.
- State what remains authoritative after process loss, retry, reconnect, or deployment.
Practice set
Easy
- Define every bold term in the concept tables in one precise sentence.
- Reproduce the focused examples and annotate the value or state after each important line.
- Explain the chapter progression diagram aloud in two minutes.
Medium
- Replace one convenient default with an explicit policy for validation, timeout, ordering, pagination, cleanup, or error handling.
- Write a negative test for each topic group.
- Compare the measured behavior before and after one justified change.
Hard
- Combine all topic groups into one thin vertical slice.
- Inject a realistic failure at the most important external boundary and prove recovery.
- Write a one-page design note covering ownership, trade-offs, security, observability, and rollback.
Chapter submission
Submit:
- source code or reproducible commands;
- automated tests plus one deliberately failing-before-fix test;
- captured output, query plan, trace, screenshot, or metric;
- a 300–500 word explanation of the execution flow and one rejected alternative;
- a short README with setup, versions, limitations, and cleanup steps.
- Continue with the LangGraph Research Assistant project workshop.
Self-review rubric
| Dimension | Beginning | Competent | Professional |
|---|---|---|---|
| Explanation | Names APIs | Explains behavior | Connects guarantees, internals, and trade-offs |
| Implementation | Happy path only | Validated and tested | Clear ownership, failure recovery, and cleanup |
| Evidence | Manual claim | Repeatable output | Tests plus meaningful measurement or inspection |
| Communication | Steps missing | Reproducible README | Decisions, limits, and alternatives are explicit |
Roadmap coverage checklist
- To do: Graph architecture: StateGraph vs MessageGraph
- To do: Graph architecture: TypedDict for state definition
- To do: Graph architecture: node functions: (state) → state update
- To do: Graph architecture: conditional edges with routing functions
- To do: Graph architecture: END node and termination
- To do: State & checkpointing: Annotated state with reducers (add_messages)
- To do: State & checkpointing: MemorySaver/SqliteSaver/PostgresSaver checkpointers
- To do: State & checkpointing: thread IDs for conversation isolation
- To do: State & checkpointing: time-travel: replaying from checkpoint
- To do: Multi-agent patterns: ToolNode + @tool decorator + tools_condition
- To do: Multi-agent patterns: supervisor agent pattern routes to subagents
- To do: Multi-agent patterns: hierarchical agent networks
- To do: Multi-agent patterns: interrupt_before/after for human-in-the-loop
- To do: Compilation, tools & handoff: compile and Mermaid graph visualization
- To do: Compilation, tools & handoff: parallel tool call aggregation
- To do: Compilation, tools & handoff: agent handoff messages and ownership
- To do: Compilation, tools & handoff: interrupt resume with Command
- To do: Compilation, tools & handoff: researcher/writer/critic state contract
Quick revision
- Graph architecture: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- State & checkpointing: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Multi-agent patterns: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Compilation, tools & handoff: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Re-read the worked-example execution trace instead of memorizing isolated syntax.
- If you cannot name the owner of state and cleanup, the design is not yet complete.
Mastery check
How well can you recall this?
Finished this lesson?