Chapter 6: Callback and Trace (observability)

Goal of this chapter: understand the Callback mechanism and integrate tracing/observability for the Agent execution.

Code location

Full tutorial

What you learn

  • How callbacks expose lifecycle hooks for key execution points (model calls, tool calls, streaming chunks).
  • How to build logging/metrics/tracing without coupling instrumentation into core logic.