Changelog
Release notes for the AgentRoute Python SDK, newest first.
What changed in each release of the AgentRoute Python SDK. Versions follow semantic versioning. Install or upgrade with:
pip install --upgrade agentrouteCheck your installed version at any time:
import agentroute
print(agentroute.__version__) # "1.1.0"Multi-agent orchestration (Team/Company), guards, hosted MCP, agent-to-agent (A2A) calls, and managed deployment land in later phases. See the platform roadmap for what is coming next.
1.1.0 — Phase 2
The current release. Phase 2 builds on the Phase 1 foundation with persistent memory, conversation-history policies, and structured output.
Added
-
Memory.
Memorykeeps conversation turns and facts in RAM;MemorySQLitepersists them to a SQLite file with FTS5 full-text search. Attach either viaAgent(memory=...), and read or write from inside tools throughctx.memory. Both expose asyncget_messages,add_messages,clear_messages,remember(key, value),recall(query, limit=10), andforget(key). See Memory.from agentroute import Agent, MemorySQLite agent = Agent("bot", model="claude-sonnet-4", memory=MemorySQLite("agent.db")) agent.run("remember my favorite color is blue") agent.run("what is my favorite color?") # recalled across runs -
History policies. Three strategies for keeping long conversations within a model's context window, attached via
Agent(history=...):HistorySlidingWindow(window_size=20),HistoryTruncate(max_tokens=100_000)(char-heuristic, ~4 chars/token), andHistorySummarize(model=..., keep_recent=4), which compacts older turns with an LLM.HistorySummarizerequires a concreteModeland raisesRuntimeErrorif none is provided. See History.from agentroute import Agent, MemorySQLite, HistorySlidingWindow agent = Agent( "bot", model="claude-sonnet-4", memory=MemorySQLite("agent.db"), history=HistorySlidingWindow(20), ) -
Structured output. Pass
output=PydanticModelto get a validated model instance back onresult.outputinstead of free text. See Structured output.from agentroute import Agent from pydantic import BaseModel class WeatherReport(BaseModel): city: str temp_c: float agent = Agent("bot", model="claude-sonnet-4", output=WeatherReport) result = agent.run("Weather in Zurich?") print(result.output.city, result.output.temp_c) -
Output validators. The
@agent.output_validatordecorator registers a functionfn(ctx, output) -> outputthat runs after the model responds. It can transform the output or raiseRetryto ask the model to try again. See Results.from agentroute import Agent, Retry @agent.output_validator def sanity(ctx, output: WeatherReport) -> WeatherReport: if output.temp_c > 60: raise Retry("Temperature unrealistic, reconsider.") return output -
Retrysignal.Retry(message)is a control-flow signal — not anErrorAgent— raised from validators or tools to redo the current turn with a hint. Retries are bounded byAgent(retries=...). See Errors and retries. -
New
output_modesetting.Agent(output_mode="auto")controls how structured output is requested from the model. Modes are"auto","tool", and"text".
Exports
Memory, MemorySQLite, History, HistorySlidingWindow, HistorySummarize,
HistoryTruncate, and Retry are now part of the top-level agentroute
namespace.
1.0.0 — Phase 1 (foundation)
The first public release. Phase 1 established the core agent loop and the model layer that every later phase builds on.
Added
-
Agent.Agent(name, *, model=..., instructions=..., tools=..., max_turns=10, max_cost=None, retries=1, ...)with synchronousrun(prompt, *, deps=None, **kwargs)and asyncarun(...), both returning aResult. See Agents. -
Tools. The
@tooldecorator (and theToolclass) turn a Python function into an agent tool, with the JSON schema auto-derived from type hints and the docstring.@agent.toolregisters a tool directly on an agent. A parameter annotatedctx: Contextis auto-injected and hidden from the model. See Tools.from agentroute import Agent agent = Agent("weather-bot", model="claude-sonnet-4") @agent.tool def get_weather(city: str) -> str: """Get the current weather for a city.""" return "Sunny, 22C" print(agent.run("What's the weather in Zurich?")) -
ContextandUsage.Contextcarries per-run state (deps,usage,messages,retry,step,session_id,memory) into Context-taking tools and is never sent to the model.Usagetracksinput_tokens,output_tokens,total_cost_usd, andmodel_calls. See Context and usage. -
ResultandEvent.Resultexposesoutput,usage,messages, andinterrupted;str(result)returns the output text.Event(kind, data)describes streamed steps (text_delta,tool_call_start,tool_call_end,agent_start,agent_end); streaming is forthcoming. -
Model layer.
resolve_model(model, *, api_key=None, base_url=None)maps a model string to a concreteModel:http(s)://selects a custom OpenAI-compatible endpoint,ollama/NAMEtargets a local Ollama server, and a bare name routes through OpenRouter with vendor inference (claudeto anthropic,gpt/o1/o3to openai,geminito google, and so on). One OpenRouter key (AGENTROUTE_API_KEYorOPENROUTER_API_KEY) works for every model string. The transport typesMessage,LLMRequest, andLLMResponseround out the layer. See Models. -
Exception hierarchy.
ErrorAgentis the base, withErrorMaxTurns(*, turn, limit)raised when an agent exceedsmax_turnsandErrorBudget(*, spent, limit)raised when it exceedsmax_cost. See Errors and retries. -
ResultDeploy.ResultDeploy(url, status, agent_card_url)ships as a placeholder for managed deployment in a future phase.