Agent RT for Python
Production AI agents without the framework tax. A lightweight, provider-neutral runtime with explicit control over tools, safety, state, and orchestration.
🌐 Website · Documentation · GitHub · Docker Hub
Meet Artie, the running robot, and its flagship features: Guard (blocks harmful tool calls before they run), Checkpoints (resume with budgets intact), and the migration Wall (65+ repositories passing their tests after migrating).
The agent-rt CLI also sends 6–22× fewer input tokens per prompt than Codex, Claude Code, opencode, and Copilot CLI, with 5–10× less memory. All numbers come from deterministic localhost mocks and measure runtime overhead, not model latency or task quality (method and data).
Start with an OpenAI-compatible endpoint, then add tools, approvals, memory, sandboxing, retrieval, and multi-agent orchestration without replacing your runtime. asyncio-native, with an optional API server and terminal CLI.
Why Agent RT?
- Provider-neutral. OpenAI-compatible endpoints, OpenAI, Anthropic, or your own
ModelProvider. - Safe by construction. Tool validation, permissions, composable action blockers, approvals, deterministic PII morphing, guardrails, budgets, and deadlines are runtime primitives.
- Scales large tool catalogs.
Toolbasecombines local/deferred and MCP tools, safety-screens them, sends only the relevant subset per turn, and keepstool_searchavailable for fallback discovery. - Small core. OpenAI support is included; Anthropic, API serving, CLI, and sandboxes are opt-in extras.
- Production-ready. Checkpoints, event streams, queues, tracing, cost ledgers, retrieval with post-retrieval reranking, and multi-agent patterns.
- Decision models. Jev-compatible models, or the OpenAI-compatible Decisions API answer typed questions that gate tool safety, tool relevance, memory, and retrieval (details).
- Easy to adopt. Migration-compatible entry points for supported subsets of OpenAI, Anthropic, OpenRouter, LiteLLM, LangChain, Deep Agents, LlamaIndex, OpenAI Agents, AutoGen, and CrewAI code; across Agent RT's ongoing migration field testing, 65+ third-party repositories pass before and after migration.
Install
Python 3.10–3.14. Runs on Linux, Windows, macOS (Intel and Apple M-series), and Raspberry Pi.
pip install agent-rt
pip install 'agent-rt[all]' # or pick extras: anthropic, observability, api, cli
Docker Hub: The prebuilt Python image includes the agent-rt CLI entrypoint and the provider, API, and web extras. Pull the latest tag (or a published version tag) and try the CLI:
docker pull praneeth1v/agent-rt-python:latest
docker run --rm praneeth1v/agent-rt-python:latest --help
Works with the openai (1.31+, including 2.x and 3.x) and anthropic (0.29+, including 1.x) SDK versions your project already pins — any release since mid-2024.
OpenLLMetry/Traceloop export is optional. Install agent-rt[observability] only when TRACELOOP-based telemetry is needed; the core runtime does not require it.
Try it in 10 seconds with the API key you already use for Claude Code, Codex, opencode, or Copilot CLI (no config file needed):
pip install 'agent-rt[cli,anthropic]'
agent-rt claude -p "explain this stack trace" # or: agent-rt codex exec "..." · agent-rt opencode run "..." · agent-rt copilot -p "..."
Only API-key setups are reused; subscription sign-ins stay with the official clients (details).
Migrate in one line
- from openai import OpenAI
+ from agent_rt.openai import OpenAI
Prepend agent_rt. to a supported import, for example from agent_rt.langchain_openai import ChatOpenAI. Across ongoing field testing, 65+ third-party repositories pass their own tests before and after this switch. See Migration.
Try it with no API key: uvx agent-rt demo runs a scripted mock model through a prompt-injection attack, shows the built-in action blocker stopping rm -rf ~ before the tool runs, totals tokens, and prints this process's peak RAM next to a competitor's published benchmark figure.
Or let Agent RT rewrite every supported import for you (install agent-rt and pytest in the project environment first):
uvx agent-rt migrate
It runs your tests before and after the rewrite and keeps it only if nothing new fails: every test that fails afterwards must have failed before, in the same test at the same line. Otherwise every file is restored. It then prints a before-and-after card (tests, test time, peak memory, package size) and, for a GitHub repository, a pre-filled issue link to add it to the migration wall.
Migrated? Add the opt-in Runs on Agent RT badge to your README.
Quick start
Configure models and vector stores in ~/.agent-rt/config.yaml, or explicitly select a project file with --config ./agent-rt.yaml / load_config("./agent-rt.yaml"). Secrets are referenced as os.environ/NAME; nothing else is read from the environment. Bedrock Knowledge Bases uses the optional agent-rt[bedrock] extra and AWS IAM credentials. See Configuration and the example file.
model_list:
- model_name: my-model
agent_rt_params:
model: openai/your-model # or anthropic/..., add api_base for compatible endpoints
api_key: os.environ/OPENAI_API_KEY
import asyncio
from agent_rt import (
AgentConfig,
AgentLoop,
ContentPart,
ModelMessage,
ModelSettings,
load_config,
load_model,
)
async def main() -> None:
# validate=False skips the startup model-list check, so no extra network call.
config = load_config() # ~/.agent-rt/config.yaml; project files require load_config("./agent-rt.yaml")
provider = load_model(config)
agent = AgentConfig(
name="assistant",
instructions="Answer clearly and concisely.",
model=ModelSettings(model="my-model"),
)
message = ModelMessage(
role="user",
content=(ContentPart(type="text", text="What can Agent RT do?"),),
)
result = await AgentLoop(provider).run(agent, [message])
if result.final_response:
print(
"".join(
part.text or ""
for part in result.final_response.message.content
if part.type == "text"
)
)
asyncio.run(main())
More examples: examples/.
Also included
- API server (
agent-rt[api]): OpenAI-compatible Chat Completions/Responses and Anthropic-compatible Messages endpoints. - Terminal CLI (
agent-rt[cli]):agent-rt -p "explain this stack trace"oragent-rt --config ./agent-rt.yaml -p "...". Reuse an existing agent CLI's models and API keys withagent-rt claude -p "...",agent-rt codex exec "...",agent-rt opencode run "...", oragent-rt copilot -p "...";artieis an alias for everyagent-rtcommand (details). It reads Codex and Claude Code project setup as is:AGENTS.md/CLAUDE.md, skills in.agents/,.claude/,.codex/, and MCP servers (details). - CLI updates: interactive sessions check for PyPI releases and automatically upgrade when possible; press Enter to restart. Run
/updatein a session oragent-rt upgradefrom your shell to check manually (details). - Task lists:
TodoListgives a model onetodotool with its own list per session; on by default in the CLI and web UI (details). - Agent memory (
agent-rt[memory], mem0 by default; ormem0,memu,zep,letta,supermemory):memory = load_memory()gives an agent long-term memory withAgentConfig(memory=[memory])andawait memory.remember(messages)(details). - Chat bots (beta):
agent-rt serve telegram,discordanswers allowed users on Telegram and Discord (details). - Web UI (
agent-rt[web]): runagent-rt webin a project folder to chat in your browser, with sessions shared with the terminal CLI (agent-rt session list,agent-rt session delete ID) and in-page approval for file edits, plus a time-travel debugger (agent-rt web --demo: token budget, tool calls, blocked actions, and fork-from-checkpoint on the offline demo) (details).
Learn more
- Website and documentation site
- Runtime guide — API server, CLI, sandboxes, skills, providers
- Architecture and Extensions · Introduction to Agent Harnesses
- Development · Comparisons
For reviewed, depth-limited task delegation, use SubagentSwarm and AgentLoopInvoker with explicit per-tool read/write permissions, prepaid reviewer budgets, cancellation, and per-swarm tracing. See the runtime guide.
Agent Swarm Eval: A two-way live OpenAI SDK versus configured Agent-RT
SubagentSwarm security comparison with mandatory Decision-model validation,
persistent successful-response caching and synthetic PII. Run make eval-agent-swarm-eval
from the repository root; see the benchmark documentation.
Metadata
Release files for agent-rt 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_rt-0.1.3.tar.gz | 595.1 kB | With provenance | Details for agent_rt-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_rt-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for agent_rt-0.1.3-py3-none-any.whl |
Total release size: 1.1 MB
Release files / agent_rt-0.1.3.tar.gz
| Download URL | agent_rt-0.1.3.tar.gz |
|---|---|
| Size | 595.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f1998fe9134c2a3e95ca68ee6a7266550b3c2e6167cf5eaa027821b547d0386
|
|
BLAKE2b-256 checksum How to use checksums |
e47021e4eae24875d2801d57891e6e3def76b576026f90a02cfd867da68cb778
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / agent_rt-0.1.3-py3-none-any.whl
| Download URL | agent_rt-0.1.3-py3-none-any.whl |
|---|---|
| Size | 472.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f970564a1d02352dc0e47fa2f2bb275c30e8107faf1086e3ce305cba07c09cb
|
|
BLAKE2b-256 checksum How to use checksums |
b1a2d934b494290bb58e84222ff902ad2775f3f85a8cbdc0f1223f7016c3c54d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for agent-rt 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_rt-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.