Skip to content
Pro-GenAIPublic

About

A really fast and lightweight harness for AI agents

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Agent RT — AI agent runtime

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. 🧩

PyPI npm Docs License: MIT PyPI Downloads NPM Downloads

🚀 Quick Start

Python

pip install agent-rt

TypeScript / Node.js

npm install agent-rt

➡️ Installation · Quickstart

✨ Why Agent RT?

  • 🪶 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 Python and TypeScript 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.

⚖️ Quick Comparison

⚡ Agent RT 🦜 LangChain 🗂️ LlamaIndex
🎯 Primary focus 🧠 Agent runtime 🧩 App/orchestration framework 📚 Data & RAG framework
Python Python + TypeScript TypeScript ✅ ✅ ✅
🛠️ Tools & agent loop ✅ Built-in ✅ ✅
🔐 Permissions & approvals ✅ Built-in ◐ ◐
🛡️ Agent Action Guard ✅ Built-in integration (opt-in) — —
🧰 API & CLI tools ✅ Built-in (optional packages) — —
🌐 OpenAI + Anthropic compatible API ✅ Built-in server adapters ◐ Integration-dependent ◐ Integration-dependent
🧠 Decision-model control gates ✅ Tool pruning, memory/retrieval gates, failure classification — —
✂️ Tool catalog pruning before model call ✅ Built-in ◐ Integration-dependent ◐ Integration-dependent
📦 Sandboxing ✅ Fail-closed backend selection ◐ ◐
♻️ Budget-preserving checkpoints ✅ Resume with prior turn/tool/token budgets ◐ ◐
💾 Memory & checkpoints ✅ Built-in ✅ ✅
🗃️ Switch vector DBs ✅ Simple env/registry switch ◐ Integration-dependent ◐ Integration-dependent
Post-retrieval reranking Built-in provider-neutral hook + optional top-k Available Available
🔌 Provider-neutral ✅ ✅ ✅
🪶 Lightweight runtime focus ✅ ◐ ◐
Python Fresh install footprint 46.43 MiB 69.87 MiB 219.91 MiB
Python Warm latency 1.56 ms 9.03 ms 4.26 ms
Python Runtime memory +5.86 MiB +19.77 MiB +22.42 MiB
TypeScript Fresh install footprint 1.24 MiB 82.44 MiB 60.38 MiB
TypeScript Warm latency 1.85 ms 2.60 ms 2.23 ms
TypeScript Runtime memory +14.33 MiB +17.27 MiB +16.79 MiB

✅ Built-in · ◐ Available / integration-dependent · — Not a primary focus

📊 See reproducible benchmarks →

🧪 See It in Action

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.

📚 Learn More

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

📦 Packages

Python · TypeScript · Python examples · TypeScript examples

The inbound API server, terminal CLI, and AutoGen/CrewAI migration shims are Python-only.

📄 License

MIT — see LICENSE.


Pro-GenAI
Projects for Next-Gen AI

About

A really fast and lightweight harness for AI agents

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages