Agent Loop docs
API reference
This reference covers the main public interfaces. Start with the top-level package for common imports, or use the lower-level modules when you need direct control of clients, tools, observers, or conversation results.
| Module | Purpose |
|---|---|
agentloop | Ergonomic re-exports |
agentloop.agent | High-level agent and tool decorator |
agentloop.collector | SummaryCollector, the loop's per-conversation usage and tool counter |
agentloop.config | Settings and client construction |
agentloop.errors | Exception hierarchy |
agentloop.loop | Core conversation loop |
agentloop.observer | Lifecycle callbacks |
agentloop.summary | Conversation outcomes, usage, timing, and limits |
agentloop.events | Ordered JSONL event traces |
agentloop.metrics | OpenTelemetry counters and histograms |
agentloop.provider | Shared request, response, and client types |
agentloop.retry | Retry policy and wrapper |
agentloop.stall | RepeatTracker, used for SummaryOptions.stall_threshold reporting |
agentloop.tooling | Registry and tool execution |
agentloop.tracing | OpenTelemetry observer and setup |
agentloop.transcript | Conversation messages and parts |
agentloop.providers | Built-in provider integrations |
The provider index compares the built-in adapters and links to
their constructors. The custom providers guide explains
how to implement LLMClient.
Pydantic models in this package validate construction. Models described as frozen reject attribute assignment after construction.