Examples
A gallery of runnable AgentRoute agents, from a one-file hello world to multi-agent orchestration, each built on the real SDK.
These examples go from a single-file hello world to a multi-agent workflow, and every one is built on the real agentroute SDK — the code on each page runs as written against Agent, @agent.tool, structured output=, Memory, History, and plain Python for concurrency. Each page explains what the agent does, shows the full source in one block, gives you a short snippet to run it, and links the concepts and reference pages it draws on. New to the SDK? Start with minimal, then work down the grid as you need tools, structured output, memory, and orchestration.
The gallery
The smallest possible agent: construct, run, print the result. Your hello world.
Route a user message into a fixed set of intents with a typed output= model.
Draft a structured email — subject, body, tone — and read it back off result.output.
Score text against a policy and return a structured verdict you can act on.
Reshape messy input into clean, validated records using a Pydantic output schema.
Read a diff and emit structured review comments with severity and line references.
Answer questions over a document set, retrieving passages with a Context-aware tool.
Plan a search, call a web-search tool, and synthesize a sourced answer.
Call a real HTTP API from a tool with httpx and let the agent reason over the response.
Ingest documents into persistent MemorySQLite and query them across runs.
Coordinate several specialized agents from plain Python to run a multi-step pipeline.
Every page rewrites its domain on the current SDK — no aspirational APIs. Set AGENTROUTE_API_KEY (one OpenRouter key works for every model string), install the SDK, and the code runs as printed. See getting started for setup, the SDK reference for exact signatures, and the concepts for the bigger picture.