Skip to content

yai-dev/agentrail

Agentrail Agentrail

Build, host, and orchestrate tool-using AI agents.

Pre-GA License Stars PRs Welcome

Website & Docs → agentrail.run


Agentrail is an open-source agent harness framework for building, hosting, and orchestrating tool-using AI agents.

It provides a composable runtime core, a hosted server layer, a prompt SDK, multi-agent orchestration, filesystem-backed memory, sandboxed execution, and optional plugins and workflows.

Note

Agentrail is in pre-GA development. Public APIs and package boundaries may change before the first stable release. See ROADMAP.md for current status and planned milestones.

Why Agentrail

Agentrail grew out of patterns developed in a production AI agent system, distilled into a composable open-source framework.

It is designed for developers who want more structure than ad hoc agent scripts, but less product lock-in than a hosted platform.

  • Production-proven — built from real-world agent infrastructure, not a proof-of-concept
  • Code-first, no platform lock-in — define everything in code, no hosted platform or GUI required
  • Complete host layer — goes beyond an agent loop with a full chat and streaming request lifecycle
  • Pluggable LLM providers — unified abstraction over Anthropic, OpenAI, and others; swap without rewriting agent logic
  • Multi-agent orchestration — delegate work to sub-agents with mailboxing, structured waits, and failure recovery
  • Profile and plugin extension model — package agent behavior in profiles, extend the runtime through plugins with clear boundaries
  • Session memory and knowledge — built-in message history compaction, knowledge-base indexing, and retrieval
  • Docker sandbox isolation — run LLM-generated code safely, fully isolated from the host environment

Package Map

  • npm @agentrail/runtime-core: agent definition, execution loop, tool contracts, provider abstractions
  • npm @agentrail/host: hosted request primitives for chat and stream lifecycles
  • npm @agentrail/host/defaults: recommended hosted SDK and default capability builders
  • npm @agentrail/prompts: prompt fragments, bundles, rendering, and file loading
  • npm @agentrail/orchestration: managed sub-agents, mailboxing, waits, and recovery
  • npm @agentrail/memo: session storage, message history, and compaction
  • npm @agentrail/knowledge: knowledge-base indexing and reading tools
  • npm @agentrail/skills: skill discovery and skill tool execution
  • npm @agentrail/sandbox: sandbox lifecycle and execution/browser tools
  • npm @agentrail/tools: general-purpose tools such as ask-user and todo writing
  • npm @agentrail/events: shared event contracts
  • npm @agentrail/config: typed YAML config loading, defaults, and validation for Agentrail apps
  • npm @agentrail/plugin-user-memory: plugin for persistent user memory across sessions
  • npm @agentrail/slash-commands: slash command parsing and dispatch
  • npm @agentrail/deep-research: deep research workflow built on top of Agentrail
  • npm @agentrail/create-agentrail-app: scaffolding CLI for new Agentrail projects

Examples

  • examples/playground-server: full hosted reference server
  • examples/playground-ui: companion UI for the playground server
  • examples/deep-research: dedicated workflow example built on top of Agentrail

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build
pnpm dev:playground-server
pnpm dev:playground-ui
pnpm dev:deep-research

For contributor workflow details, see CONTRIBUTING.md.

Useful verification commands while working on the framework:

pnpm --filter @agentrail/host test
pnpm --filter @agentrail/prompts test
pnpm --filter @agentrail/playground-server typecheck

Quick Start

The fastest way to get started is the Quickstart guide on the documentation site.

For a full local reference setup, see the examples/playground-server and examples/playground-ui packages.

Community

License

Agentrail is licensed under Apache-2.0.

About

Agentrail is an open-source agent harness framework for building, hosting, and orchestrating tool-using AI agents.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors