Skip to content

Appendix D: Reference Frameworks ​

When you move from architecture to implementation, study mature frameworks to see how these concepts become real code.

What to Extract from Frameworks ​

Do not copy framework structure blindly. Extract architectural decisions:

  • How is state represented?
  • How is the loop controlled?
  • How are tools declared and validated?
  • How are observations returned?
  • How are errors handled?
  • How is tracing exposed?
  • Where are guardrails enforced?

A framework is a reference implementation, not a substitute for understanding the layers.

LangGraph ​

Use LangGraph as a reference for explicit stateful graph execution.

Look for:

  • State as a first-class object
  • Nodes as discrete steps
  • Edges as control-flow decisions
  • Conditional transitions
  • Tool execution as graph nodes
  • Checkpointing and recovery
  • Multi-agent graph composition

LangGraph is especially useful for seeing how agent control flow can be explicit, rather than hidden inside prompt logic.

smolagents ​

Use smolagents as a reference for minimal agent loops.

Look for:

  • Small core loop
  • Tool declaration and invocation
  • Observation handling
  • Final answer extraction
  • Lightweight harness design
  • Contrast between tool-calling and code-driven action styles

smolagents is useful for seeing the smallest useful agent architecture before adding production complexity.

pi ​

Use pi as a reference for a production-ready coding agent.

Look for:

  • File system access and read/write operations
  • Test-driven development cycles
  • Self-verification and error recovery
  • Context-aware code generation
  • Multi-step task decomposition

pi shows how the layers in this manual become a working production agent.