A Tour of Agents
LearnCompareBlog
Source

Lesson 5: State = Dict — A Tour of Agents

Track structured data alongside LLM conversations with a plain Python dict. Build what LangGraph state channels do — no framework required.

State = Dict You know how Claude shows "Searched 5 files" or ChatGPT shows "Analyzed data" with a little summary? That's not from the messages — it's state tracked alongside the conversation. The messages array is the raw tape. But you often need structured answers: *which tools ran? how many turns? what were the results?* That's state — a dict updated inside the loop, returned alongside the answer. > Framework parallel: LangGraph calls these "state channels" with typed reducers. Strip the abstraction: it's a dict updated in a loop.

Concepts covered

  • state
  • structured tracking
  • metadata
  • observability

Framework comparison: LangGraph state channels, Redux store — structured data alongside the conversation.

All lessons in this course

  1. Lesson 1: The Agent Function
  2. Lesson 2: Tools = Dict
  3. Lesson 3: The Agent Loop
  4. Lesson 4: Conversation
  5. Lesson 5: State = Dict
  6. Lesson 6: Memory
  7. Lesson 7: Policy = Guardrails
  8. Lesson 8: Self-Scheduling
  9. Lesson 9: The Whole Thing
5 / 9