A fast, lightweight runtime for building production AI agents in Python and TypeScript. ⚡
Agent RT gives agents a clear execution boundary for tools, streaming, structured output, permissions, approvals, memory, checkpoints, sandboxing, observability, and deployment—without requiring a heavyweight orchestration stack.
One runtime. Two languages. Any model provider. Production controls built in. 🧩
Python
pip install agent-rtTypeScript / Node.js
npm install agent-rt➡️ Installation · Quickstart
- 🪶 Lightweight and measurable — start with the runtime core and add integrations only when needed; reproducible cross-framework benchmarks live in
comparison/. - 🛡️ Controlled — permissions, composable action blockers, approvals, deterministic PII morphing, limits, guardrails, and sandbox boundaries are runtime concepts, not add-ons.
- 🔌 Provider-neutral, two languages — OpenAI, Anthropic, compatible endpoints, or custom providers, with aligned contracts in
Python and
TypeScript.
- 🔄 Migration-tested — ongoing compatibility field testing has 69 third-party repositories passing their test suites both before and after migration to Agent RT.
Decision models (such as Laya and other Jev-compatible models) answer typed choice/score questions for runtime control-plane gates instead of generating text. Toolbase can combine local, deferred, and MCP tools, remove unsafe definitions with a Decision model, pass only the relevant subset to each turn, and keep tool_search available for safe fallback discovery; the same Decision layer also gates memory, reranks retrieval results with optional top-k selection, and classifies failures.
✅ Built-in · ◐ Available / integration-dependent · — Not a primary focus
📊 See reproducible benchmarks →
A tool the model may call, restricted by a capability grant and a model-call budget (Python shown; see the TypeScript package for the npm quick start):
registry = ToolRegistry()
registry.register(
ToolDefinition(
name="get_weather",
description="Get the current weather for a city.",
input_schema={
"type": "object",
"required": ["city"],
"properties": {"city": {"type": "string"}},
"additionalProperties": False,
},
side_effect="read",
),
handler=get_weather, # async (arguments, cancellation_token) -> dict
)
loop = AgentLoop(
load_model(), # OpenAI, Anthropic, or any compatible endpoint
tool_registry=registry,
capability_grant=CapabilityGrant(tools=("get_weather",)),
execution_budget=ExecutionBudget(ExecutionBudgetLimits(max_model_calls=5)),
)
result = await loop.run(agent, messages)Arguments are validated against the schema, tools outside the grant never run, and the budget stops runaway loops. Full runnable versions are in the examples.
| Topic | Documentation |
|---|---|
| Runtime model | How Agent RT executes agents |
| Tools & safety | Tools, policy, permissions, approvals, and guardrails |
| State & memory | State, memory, checkpoints, and artifacts |
| Production | Sandboxing, observability, evaluation, and deployment |
| Migration | LangChain, LlamaIndex, OpenAI, and Anthropic migration |
| Runtime guide | Providers, API server, CLI, sandboxes, skills, and migration entry points |
| Features | Features, defaults, and configuration |
| Architecture | Architecture and extension contracts |
| Development | Contributor setup and test workflows |
🌐 Full documentation: agent-rt-pro.github.io/docs
Python · TypeScript · Python examples · TypeScript examples
The inbound API server, terminal CLI, and AutoGen/CrewAI migration shims are Python-only.
MIT — see LICENSE.
