Features¶
What Agent Adapter does, grouped by area, with a link to each guide. Everything is available since 1.0; rows marked 1.1 are new in 1.1. Runnable code for each area is in the Examples gallery. Not sure where to start? See Which feature do I need?. Planned work is on the Roadmap. No agent framework is needed: a FastAPI service calling an LLM gets tools, approvals, budgets, cost, cache and compression directly.
Tools, registry and schemas¶
| Feature | Guide |
|---|---|
@registry.tool decorator; function stays callable |
Tools |
registry.wrap() for code you cannot edit; bound methods, callable objects, functools.partial |
Wrap existing code |
Default registry: agent_adapter.tool, agent_adapter.wrap |
Registry |
One function as several tools (different fixed=); sync tools run in a worker thread (contextvars copied) |
Wrap existing code, Wrap a legacy class |
Shaping: fixed, hide, rename, result, name, description |
Tools |
Descriptions from Google docstrings, Annotated/Field(); ToolSpec.returns, result_schema() |
Tools, Schemas |
Policy options stored and type-checked, incl. cache_scope, targets, effects, idempotent |
Tools |
wrap(..., args_model=...) escape hatch; spec_from_schema, input_schema / output_schema (tools from a raw JSON schema) |
Tools, Schemas |
ToolContext: run_id, call_id, thread_id, state, extras, ports; child(); ToolContext.ledger, .cache, .emit filled by the executor |
Context, Executor |
Typed errors under AdapterError, each with a stable kind |
Errors |
ToolTimeout, ToolFailed, ApprovalDenied, ApprovalPending raised by the executor; BudgetExceeded, FlowError |
Executor, Hooks, Flows |
Importers: import_langchain, import_openapi, import_mcp |
LangChain, OpenAPI, MCP |
Registry: add, get, remove, names, in, len, iteration; add_many (all or nothing), for_target |
Registry, Targets |
subset(names=, tags=, kinds=) (filters combine with AND); catalogue(): Markdown tool list with prompt_hint |
Registry, Registry |
Portable-subset check at registration; portable=False opt-out; Stable rendered schemas per provider (pinned by snapshot tests) |
Schemas, Schemas |
| OpenAI strict, Gemini and Anthropic transforms; defaults written into descriptions (OpenAI strict, Gemini) | Schema pipeline, Where defaults go |
Strict-mode null means "use the default" |
Strict mode |
Execution and flows¶
| Feature | Guide |
|---|---|
run, run_many(concurrency=), parallel(*coros), as_completed |
Batches, Parallel retrieval |
run_plan(steps): depends_on waves, cycle check |
Plans |
on_error="collect" / "fail_fast", ToolResult |
Batches |
| Retry with backoff and jitter; timeout; never retry control flow | Retry |
Run guards: once_per_run, max calls per run, concurrency per kind |
Runs and guards |
Hook base class and dispatch (before_* / after_* / on_*_error, short-circuit), run by the executor |
Runtime, One call |
GuardrailHook, RateLimitHook, BudgetHook(max_usd); 1.1 team budgets per user, team or all, per day or month, shared across processes (SQLite, Redis, SQL) |
Hooks, Budgets, Team budgets |
1.1 Guardrails: PII and secret checks with no model (PIIGuard), any guard service (CallableGuard), Presidio, NeMo Guardrails; block, redact or approve |
Guardrails |
1.1 Policy file: access, approvals, guards, budgets and limits per tool, team and environment, for every surface; agent-adapter policy check |
Policy file |
1.1 Multi-agent: agents as tools (agent_tool, LoopAgent), handoffs (handoff, HandoffModel), flow routing, depth guard |
Multi-agent |
Flow builder, Map / Join / Route / max_loops, pause, keyed merges, local runner; 1.1 sub-flows (SubFlow) and a per-node cache (NodeCache); 1.1 crash-safe runs (a checkpoint per superstep, recover, no repeated side effects) and Temporal or DBOS as the engine |
Flows, Pause and resume, Sub-flows and the node cache, Durable runs, Temporal or DBOS |
Executor() uses the default registry; run takes the tool function; run_sync / resume_sync twins; configure, call, acall |
Executor, Quickstart |
LoopRunner: one warm event loop for sync code in long-lived processes (agent_adapter.runtime) |
Runtime |
Compile flows to LangGraph and to ADK Workflow (parity with the local runner) |
LangGraph, ADK |
HITL (approval)¶
| Feature | Guide |
|---|---|
ApprovalPort protocol, ApprovalRequest, ApprovalDecision types |
Context |
| Approval enforced by the executor (may edit args); one-use decisions bound to run, call, tool and argument digest | Approval, Human in the loop |
AutoApprove, AutoDeny, CallbackApproval(fn), DeferredApproval, ApprovalStore |
Approval |
approval.batch.ask_each, PreparedApproval (two-phase batch approval) |
Approval batches |
Durable approval stores: SQLiteApprovalStore (one host, many processes), RedisApprovalStore (many hosts, TTL), SQLAlchemyApprovalStore (Postgres), DynamoDBApprovalStore (AWS serverless, TTL); corrupt rows fail closed (ApprovalStoreCorrupt) |
Approval stores, Database stores |
executor.resume(approval_id, decision) in one call; DeferredApproval.sqlite(path) |
Resume a parked call |
1.1 Approval memory: similar past decisions on approval cards and GET /approvals/{id} (approval_context), proposed confirm rules a person accepts (propose_rules, accept); never approves |
Approval memory |
| 1.1 Audit log: a signed, tamper-evident record of approvals, budget stops, guard blocks and memory erases; verify, and export to JSONL or CSV | Audit log |
| Bridges: LangGraph, ADK, Agents SDK, Pydantic AI, Agent Framework, Agno, Strands, Haystack, Claude Agent SDK, Semantic Kernel | LangGraph, ADK, Agents SDK, Pydantic AI, Agent Framework, Agno, Strands, Haystack, Claude Agent SDK, Semantic Kernel |
Cost and cache¶
| Feature | Guide |
|---|---|
LedgerEntry per LLM and paid-API call |
Instrumented models |
| Usage normalisers: OpenAI, Gemini, Anthropic | Model ports |
Versioned price table Prices.load(dict|path); 1.1 context windows and reply ceilings for known models (ModelCaps.prompt_window()) |
Cost, Context compression |
Prices for your own models: * patterns, free, per_call and per_second, Prices.empty() |
Cost |
Sinks: memory, callback, JSON lines; ledger.summary(run_id) |
Cost |
CachePort, MemoryCache, RedisCache (extra) |
Cache |
Cache keys, versioned JSON envelopes, ToolResultCache |
Runtime |
Tool-result cache used by the executor (cache_scope: run / thread / global) |
Executor, Caching |
| LLM response cache | Cache |
PromptLayout(static=, dynamic=) |
Cache |
| Provider prefix-cache plug-ins (OpenAI, Gemini, Anthropic) | Cache |
Models¶
| Feature | Guide |
|---|---|
LLMRequest, LLMResponse, Message, ToolDef types; LLMPort protocol |
Context |
LLMPort.generate(request) and stream(request) implementations; 1.1 partial structured output and tool-call deltas while streaming |
Model ports, Streaming |
OpenAIModel, GeminiModel, AnthropicModel, CallableModel(fn), FallbackModel |
Model ports · Bring your own model |
Bring your own model: CallableModel on a sync or async function (sync runs in a thread); OpenAIModel on Ollama, vLLM, LM Studio or llama.cpp server |
Bring your own model |
1.1 Model recipes: Amazon Bedrock, Azure OpenAI, Mistral, Groq, OpenRouter as CallableModels with usage, prices and typed errors |
Model recipes |
Bring your own embedder: EmbeddingPort, CallableEmbedder (sync or async fn, batching, per-text cache, one ledger entry and trace events per call, OTel spans) |
Embeddings |
1.1 Memory: MemoryPort, SQLiteMemory (keyword and vector search), CallableMemory, Mem0, Zep, Graphiti; memory_tools() scoped by ctx.user_id, never by the model; retention, export and per-user erase |
Memory |
1.1 Retrieval (RAG): retriever_tool over any RetrieverPort (callable, embedding, LlamaIndex, LangChain); citations; host-set scope filters re-checked on every result |
Retrieval (RAG) |
1.1 Sandboxed code: code_tool over Docker, a hosted sandbox (CallableSandbox: E2B, Modal) or a dev-only local process; approval always required; time, output and network limits |
Sandboxed code |
InstrumentedModel, executor.model() |
Instrumented models |
run_tool_loop(model, registry, messages, max_steps) |
Tool loop |
Context compression with your own models: CompressionPolicy per call (LLMRequest(compression=)), CompressingModel, run_tool_loop(compression=); trim, cut, shrink tool results, de-duplicate, rank, summarise; ModelContextOverflow retried once |
Context compression, Compress a long context |
compress_for(messages, policy): every framework's own message list back in its own type (LangChain, OpenAI, Anthropic, Gemini and every agent framework; the Claude Agent SDK compacts on its own); langgraph_compressor and per-framework hooks |
Compression by framework |
Integrations¶
| Feature | Guide |
|---|---|
OpenAI, Gemini, Anthropic renderers (honour targets) |
OpenAI, Gemini, Anthropic |
genai automatic function calling callables, run_function_calls |
Gemini |
| LangGraph, Google ADK 2.x | LangGraph, ADK |
| LangChain export and import, OpenAPI importer | LangChain, OpenAPI |
| MCP server and importer (annotations, pending approval, client approval round trip); tasks extension, URL approval links, client OAuth (CIMD) | MCP, MCP tasks and OAuth |
| OpenAI Agents SDK, Pydantic AI, LlamaIndex, CrewAI | Agents SDK, Pydantic AI, LlamaIndex, CrewAI |
| Microsoft Agent Framework, Agno, Strands Agents, Haystack | Agent Framework, Agno, Strands, Haystack |
| Claude Agent SDK, Semantic Kernel, DSPy, smolagents, AutoGen | Claude Agent SDK, Semantic Kernel, DSPy, smolagents, AutoGen |
CAMEL-AI (the executor's port decides confirm tools), AG2 1.x (optional token gate in tool middleware) |
CAMEL-AI, AG2 |
A2A: a2a_app, a2a_executor, agent_card, connect_a2a, import_a2a; approvals via input-required, resumed only through the port or a one-use token |
A2A |
AG-UI bridge: stream runs to AG-UI UIs (CopilotKit); interrupt/resume HITL through the ApprovalPort |
AG-UI |
attach(target_or_name, registry): one call for any installed integration; never takes an approval; attach to plain code, web apps, workers, frameworks, other languages |
Attach anywhere |
agent-adapter CLI: init project templates, doctor environment check (1.1: optional backends too); 1.1 framework templates (pydantic-ai, adk, agno, strands, crewai) and migrate |
CLI, The migrate command |
Integration protocol and entry points (third-party) |
Writing an integration |
all extra: every integration that co-installs cleanly |
Integrations, Support matrix |
Cross-language and backends¶
| Feature | Guide |
|---|---|
| MCP stateless Streamable HTTP app | Cross-language: MCP |
| HTTP tool server: routes, RFC 9457 problems, auth hooks, idempotency, SSE events, cost | HTTP server, Security model |
WSGI app, /openapi.json, server CLI |
HTTP server, OpenAPI |
TypeScript client: every server route, typed RFC 9457 errors, safe retries with Idempotency-Key, SSE events with reconnect, Vercel AI SDK adapter |
TypeScript client |
Async apps (FastAPI, Django async views): await executor.run(...); run_sync() for Flask, Django under WSGI, Celery, RQ, notebooks; LoopLocal clients |
Sync code and backends, Runtime |
Queue and serverless handlers (agent_adapter.handlers): tool_handler (Lambda: SQS partial-batch failure, FIFO order, EventBridge, direct), handle_envelope (any broker); idempotent ids from delivery ids; messages never approve |
Serverless, Queues |
| Backend guides: FastAPI, Flask, Django, Celery, scripts, data pipelines, other web frameworks, notebooks and apps | FastAPI, Flask, Django, Celery, Scripts, Pipelines, Other web frameworks, Notebooks |
/readyz readiness probe; Docker and Kubernetes recipe |
Deploy |
| Connect anywhere recipes (12 stacks) | Connect anywhere |
Observability¶
| Feature | Guide |
|---|---|
Standard logging (agent_adapter.* loggers); LoggingHook (structured, redacts secrets) |
Logging, Hooks |
Event catalogue (EventType, make_event), ToolContext.emit; events emitted by the executor |
Context, Executor |
Event sinks and OpenTelemetry; run viewer: record() then agent-adapter ui (navigable flow graph with replay, parallel-call timeline, events, state, compare, approvals, offline export), Flow.graph(), Flow.to_mermaid(); chat with any agent or the built-in tool loop (agent-adapter ui --agent, serve(...)): streaming, tool and approval cards, state, files, replay, eval cases; 1.1 search, tags and OTLP import in the run viewer |
Tracing, See your runs, Navigate the graph, Chat with your agent, Search and tag runs |
1.1 Chat memory across chats: serve(memory=, user_id=, memory_save=) / ui --memory sqlite:PATH --user NAME; recall each turn (session.memories), opt-in saving, a Memory tab to see and delete records |
Remember users across chats |
1.1 Traces to Langfuse, Arize Phoenix, OpenLLMetry or any OTLP backend over OTelSink |
Send traces |
Evals, optimiser and documentation¶
| Feature | Guide |
|---|---|
1.1 Evals: run cases on any agent, graders (exact, regex, JSON schema, tools, cost, latency, LLM judge), JUnit/Markdown/JSON reports, regressions, agent-adapter eval, a pytest plugin, an Evals tab in the viewer; a production checklist; recorded runs become eval cases (viewer button, CLI, Python); a cost advisor picks a cheaper model per flow node or stage that keeps the score |
Evaluate your agent, See your evals, Production checklist, Evals from production, Cut model costs per step |
Offline Propose → Probe → Compose loop; outputs a reviewable diff; CallableHost makes any agent optimisable |
Optimiser, Optimise your agent |
Documentation with an API reference; every code snippet is a runnable, tested example; one guide for AI coding agents generated from the code (AGENTS.md, llms-full.txt, agent-adapter guide) |
Home, API reference, Quickstart, For AI coding agents |
| How-to guides (legacy classes, parallel retrieval, HITL, budgets, caching, sync, testing) and tutorials (a research agent, migrating from LangGraph); the golden path: a FastAPI desk with approvals, budgets, guards, memory, RAG, a durable flow and evals in CI | Wrap a legacy class, Testing tools, Research agent, Migrate from LangGraph, Tutorial: the golden path |
| Cookbook, guides (security, performance, observability, versioning), migration, troubleshooting, glossary; contributing (integrations, performance tests, releases); a threat model and the API stability policy | Cookbook, Security, Migration, Troubleshooting, Glossary, Writing an integration, Performance tests, Cutting a release, Threat model, API stability policy |