Open Source · Pre-GA · Apache 2.0
Agentrail gives you a composable runtime, a hosted server layer, multi-agent orchestration, and a clear extension model — without locking you into any platform.
import { defineAgent } from "@agentrail/runtime-core"; import { createWebSearchTool } from "@agentrail/tools"; export const researchAgent = defineAgent({ name: "researcher", model: { provider: "anthropic", modelId: "claude-opus-4-5", apiKey: process.env.ANTHROPIC_API_KEY, }, systemPrompt: "You are a research assistant.", tools: [createWebSearchTool()], }); // stream a response const result = await researchAgent.stream( "What are the latest advances in agentic AI?", );
Why Agentrail
Most teams land between two extremes — scripts that break at scale and platforms that make you dependent. Agentrail is designed to sit in between.
Too little structure
Just right
Too much lock-in
What's included
A focused set of packages — each with a clear responsibility, each independently usable.
@agentrail/runtime-core
Define agents with typed tool contracts. The LLM loop, tool dispatch, provider abstractions, and usage tracking — all in one stable core.
@agentrail/host
Chat and stream request lifecycles, profile resolution, session context assembly, and a plugin system for cross-cutting behavior.
@agentrail/orchestration
Spawn sub-agents, send typed work, wait on conditions, and recover from failures. Persistent state across restarts via JSONL-backed mailboxes.
@agentrail/prompts
Compose system prompts from versioned fragments and bundles. File-based prompt authoring with hot-reload and variable interpolation.
@agentrail/memo
Filesystem-backed session storage with append-only JSONL history, automatic context compaction, and conversation branching.
@agentrail/sandbox
Docker-based isolated execution environment. Browser automation, shell commands, and file I/O — all safely contained per session.
Architecture
Start with the opinionated SDK, then drop to lower-level primitives only when you need tighter control.