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 agentroute

Check your installed version at any time:

import agentroute
print(agentroute.__version__)  # "1.1.0"
Roadmap

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. Memory keeps conversation turns and facts in RAM; MemorySQLite persists them to a SQLite file with FTS5 full-text search. Attach either via Agent(memory=...), and read or write from inside tools through ctx.memory. Both expose async get_messages, add_messages, clear_messages, remember(key, value), recall(query, limit=10), and forget(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), and HistorySummarize(model=..., keep_recent=4), which compacts older turns with an LLM. HistorySummarize requires a concrete Model and raises RuntimeError if 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=PydanticModel to get a validated model instance back on result.output instead 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_validator decorator registers a function fn(ctx, output) -> output that runs after the model responds. It can transform the output or raise Retry to 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
  • Retry signal. Retry(message) is a control-flow signal — not an ErrorAgent — raised from validators or tools to redo the current turn with a hint. Retries are bounded by Agent(retries=...). See Errors and retries.

  • New output_mode setting. 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 synchronous run(prompt, *, deps=None, **kwargs) and async arun(...), both returning a Result. See Agents.

  • Tools. The @tool decorator (and the Tool class) turn a Python function into an agent tool, with the JSON schema auto-derived from type hints and the docstring. @agent.tool registers a tool directly on an agent. A parameter annotated ctx: Context is 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?"))
  • Context and Usage. Context carries per-run state (deps, usage, messages, retry, step, session_id, memory) into Context-taking tools and is never sent to the model. Usage tracks input_tokens, output_tokens, total_cost_usd, and model_calls. See Context and usage.

  • Result and Event. Result exposes output, usage, messages, and interrupted; 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 concrete Model: http(s):// selects a custom OpenAI-compatible endpoint, ollama/NAME targets a local Ollama server, and a bare name routes through OpenRouter with vendor inference (claude to anthropic, gpt/o1/o3 to openai, gemini to google, and so on). One OpenRouter key (AGENTROUTE_API_KEY or OPENROUTER_API_KEY) works for every model string. The transport types Message, LLMRequest, and LLMResponse round out the layer. See Models.

  • Exception hierarchy. ErrorAgent is the base, with ErrorMaxTurns(*, turn, limit) raised when an agent exceeds max_turns and ErrorBudget(*, spent, limit) raised when it exceeds max_cost. See Errors and retries.

  • ResultDeploy. ResultDeploy(url, status, agent_card_url) ships as a placeholder for managed deployment in a future phase.