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/core"; import { defineProfile } from "@agentrail/app"; export const researchAgent = defineAgent({ id: "researcher", model: { provider: "anthropic", modelId: "claude-sonnet-4-5", apiKey: process.env.ANTHROPIC_API_KEY, }, system: "You are a research assistant.", }); // 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 create lock-in. 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 has a clear responsibility and can be used independently.
@agentrail/core
Define agents with typed tool contracts. The LLM loop, tool dispatch, provider abstractions, prompt SDK, and usage tracking sit in one stable core.
@agentrail/capabilities
Sandboxed filesystem and browser tools, knowledge-base retrieval, skills registry, and multi-agent orchestration. They can be mounted with defineProfile({ capabilities: [...] }).
@agentrail/app
createAgentApp mounts chat and stream endpoints in one call. defineProfile wires model, prompt, and capabilities. Session management, plugins, slash commands, and typed config loading are included.
@agentrail/capabilities · orchestration
Spawn sub-agents, send typed work, wait on conditions, and recover from failures. State can persist across restarts through JSONL-backed mailboxes.
@agentrail/app · SessionManager
Filesystem-backed session storage with append-only JSONL history, automatic context compaction, and conversation branching.
@agentrail/capabilities · sandbox
Docker-based isolated execution for browser automation, shell commands, and file I/O. Execution is contained per session.
Architecture
Start with the recommended SDK path, then drop to lower-level primitives only when tighter control is needed.