Explicit control
Termination, retries, deadlines, budgets, routing, and tool visibility are runtime decisions you can inspect and test.
Agent RT is a lightweight, provider-neutral runtime for Python and TypeScript. Tools, streaming, policy, memory, sandboxing, orchestration, and observability stay explicit—so your agent remains understandable when the prototype becomes a system.
A production agent is more than a prompt and an API call. It has to decide what can run, preserve state, recover from failure, stream useful progress, keep side effects bounded, and explain what happened afterward. Agent RT turns those concerns into explicit contracts instead of hidden framework behavior.
Termination, retries, deadlines, budgets, routing, and tool visibility are runtime decisions you can inspect and test.
Tools, secrets, sandboxes, approvals, and data egress sit behind policy—not model-generated intent.
Python and TypeScript share the same conceptual runtime while provider-specific behavior stays at the edge.
Use the pieces you need. Keep optional integrations optional.
Provider-neutral text, reasoning, status, and tool-call deltas flow through the same multi-turn runtime semantics.
Typed schemas, deny-overrides permissions, model guardrails, approval gates, rate limits, deadlines, and side-effect classes execute outside the model.
Versioned workflow state, session memory, durable checkpoints, event streams, idempotency, and deterministic replay. Long-term memory plugs in from mem0, Zep, Letta, Supermemory, or memU.
Command and code execution runs behind explicit resource and network policies with fail-closed backend selection.
Hierarchical traces, privacy-aware logs, runtime metrics, token and cost ledgers, plus replay bundles for reproducible debugging.
Agents-as-tools, isolated subagents, supervisor/worker teams, routers, swarms, map/reduce, and speculative branches share bounded execution contracts.
The optional Python server package maps configured agents to OpenAI model IDs while keeping Agent RT tools, guardrails, routing, and run limits in control.
pip install "agent-rt[api]"
/v1/modelsmodels/v1/chat/completionsSSE/v1/responsesSSE · WS
Decision models served over a Jev-compatible API, or the OpenAI-compatible Decisions API, answer typed choice and score questions with calibrated outputs instead of generating text. Agent RT uses them as optional gates that feed deterministic runtime policy. They never replace that policy. Prefer to self-host? Run an open-source Jev-compatible endpoint with Ollaya and point decision_model.base_url at it.
tool_search too.Local, deferred, and MCP-discovered tools
Safety screen asks a typed question: block delete_record(scope="all")?
p = 0.97 ≥ threshold 0.85, so the tool is removed
Relevance picks this turn's subset; tool_search stays available
The generative model sees only safe, relevant tools
Every CI run swaps the model for a deterministic attacker and checks that both runtimes contain it. No real LLM is called.
Prepend agent_rt. in Python or agent-rt/ in TypeScript. Common LangChain, LlamaIndex, OpenAI, and Anthropic entry points keep their shape and run through Agent RT. Or run uvx agent-rt migrate / npx agent-rt migrate: it keeps the rewrite only if no new test fails.
-from langchain_openai import ChatOpenAI
+from agent_rt.langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="your-model")
response = await llm.ainvoke("Hello")
print(response.content)
-import OpenAI from "openai";
+import OpenAI from "agent-rt/openai";
const client = new OpenAI();
const response = await client.chat.completions.create({
model: "your-model",
messages: [{ role: "user", content: "Hello" }],
});
agent-rt/@langchain/openaithird-party repositories pass their own test suites both before and after migration, in Agent RT's ongoing Python and TypeScript field testing. Compatibility is a focused subset of each SDK, not full parity. Read the migration guide ↗ Migrated? Add the opt-in Runs on Agent RT badge.
Public repositories at the tested commit. Listed as test targets only; inclusion is not an endorsement by their authors.
Put agent-rt in front of a Claude Code, Codex, opencode, or Copilot CLI one-shot command. It accepts that tool's own flags and reads its model, provider, and API-key settings, so no agent-rt.yaml is needed.
agent-rt demo runs a scripted prompt-injection attack with no API key; agent-rt web --demo replays it in a time-travel debugger.AGENTS.md, CLAUDE.md, skills in .agents/, .claude/, and .codex/, and MCP servers from Codex and Claude Code configs load as is. Skills are re-scanned whenever their files change.agent-rt web shares sessions and per-session todo lists with the terminal CLI.agent-rt serve telegram,discord answers allowed users, with no workspace tools.pip install "agent-rt[cli]"
agent-rt claude -p "explain this stack trace" --model opus
agent-rt codex exec "explain this stack trace" -m gpt-5.5
agent-rt opencode run "explain this stack trace"
agent-rt copilot -p "explain this stack trace"
Keep application logic stable while models, tools, storage, and deployment backends evolve independently.
Agent RT ships reproducible localhost benchmarks so runtime overhead can be inspected separately from provider and network latency.
Median framework/transport overhead against a deterministic localhost OpenAI-compatible mock.
Median framework/transport overhead against the same class of deterministic local mock.
One two-request tool cycle with serialized JSON tool output and common wire-level work.
Bars are normalized within each metric and language; printed values use the native unit for that metric.
Each CLI answered hi against a localhost mock model, called as its plain one-shot command. OpenHuman boots its headless core for each turn, as its own benchmark does. Full table and feature comparison.
Runtime and feature values are checked-in 30-run medians captured on September 28, 2026 against deterministic localhost OpenAI-compatible mocks. Warm completion comes from the retained historical HTTP/SSE runtime baseline; tool round trip comes from the HTTP/SSE feature benchmark. Fresh-install footprints were measured on October 3, 2026 and include transitive dependencies: Python uses clean Python 3.13.13 uv environments with copy mode and reports logical bytes above the empty-venv baseline; TypeScript uses clean Node.js 22.22.2/npm 10.9.7 projects and reports logical node_modules bytes, with Agent RT installed from its npm-pack tarball. Agent RT's runtime runner now defaults to the persistent Responses WebSocket path, so new WebSocket runs are not compared against that historical baseline until a new 30-run WebSocket baseline is promoted. These measurements are scenario-specific framework/adapter overhead, not model latency or an overall framework score. The agent CLI comparison uses 30 sequential runs per CLI plus an eight-way batch, measured on October 29, 2026 on 16-thread Linux x86_64 with each CLI's default tools and real credentials removed; it measures per-prompt harness overhead, not task quality.
Start with the provider-neutral loop, then add tools, policies, storage, sandboxes, or orchestration only when the application needs them.
Moving an existing app? Change one import and keep your LangChain, LlamaIndex, OpenAI, or Anthropic code.
Install agent-rt.
Describe your models and vector stores in agent-rt.yaml (secrets via os.environ/NAME).
Run the agent through AgentLoop.
Prefer a container? Pull praneeth1v/agent-rt-python:latest or praneeth1v/agent-rt-typescript:latest from Docker Hub. Docker instructions.
import asyncio
from agent_rt import (
AgentConfig, AgentLoop, ContentPart,
ModelMessage, ModelSettings, load_config, load_model,
)
async def main():
provider = load_model(load_config())
agent = AgentConfig(
name="assistant",
instructions="Be concise and precise.",
model=ModelSettings(model="my-model"),
)
message = ModelMessage(
role="user",
content=(ContentPart(type="text", text="Hello."),),
)
result = await AgentLoop(provider).run(agent, [message])
print(result.termination_reason)
asyncio.run(main())
const {
AgentLoop,
loadConfig,
loadModel,
} = require("agent-rt");
async function main() {
const provider = await loadModel(await loadConfig());
const agent = {
name: "assistant",
instructions: "Be concise and precise.",
model: { model: "my-model" },
};
const message = {
role: "user",
content: [{ type: "text", text: "Hello." }],
};
const result =
await new AgentLoop(provider).run(agent, [message]);
console.log(result.terminationReason);
}
main();
One configured provider, one run.
Register a read-only tool and let the model call it.
Consume text deltas as they arrive.
Schema-validated JSON with one repair attempt.
Bound turns, tool calls, time, and tokens.
Namespaces, direct execution, enable and disable.
Query Chroma, Milvus, Pinecone, Qdrant, or Weaviate.
agent-rt webBuild agents with explicit state, boundaries, recovery, and observability from the first serious version.