Examples#
Small, complete programs you can run, read, and copy. Each one uses the real runtime with a deterministic adapter, so it produces the same output without credentials — and teaches framework behavior rather than model quality.
Start with Your first agent, then build your own extension in Write your first extension. For a real provider, follow Connect a model provider.
Watch a tool call, its result, and the final answer in one stream.
Restore a conversation from SQLite in a new process.
Read one skill’s instructions through a real tool round trip.
Replace older turns with a checkpoint when context grows.
Pause a privileged tool until the UI answers.
Record model usage, cache counts, and message timing for diagnostics.
Delegate one task to a child profile with its own tools.
Start children without waiting, then read their reports.
Stop mid-stream and keep the runtime reusable.
Keep working until an evaluator agrees the goal is met.
Back sessions with your own storage implementation.
Run every offline example with make docs-examples. Tests disable network
connections and use a temporary working directory for each program.