Distributed Agent Runtime (DAgR) - The Distributed Harness for Autonomous Agents
npm install @addbrain/dagr> A serverless execution environment for autonomous AI agents.
DAgR provides a runtime where agents can schedule themselves, spawn sub-agents, and coordinate across time without keeping a process alive. It decouples agent logic from execution infrastructure, enabling truly ephemeral, distributed agent swarms.
* Ephemeral Agents: Agents that run, act, and exit—persisting only their state and schedule.
* Time Travel: Native scheduling. Agents can suspend themselves and wake up minutes or days later.
* Swarm Coordination: Spawn sub-agents to parallelize work across a distributed mesh.
* Serverless Native: Built on NATS JetStream for durability, exactly-once delivery, and scale.
``bash`
npm install -g @addbrain/dagr
The dagr CLI is your gateway to the runtime. It is designed to be used by both humans and agents (via bash tool use).
`bash`
dagr start --agent claude-code
`bash`
dagr register specialist \
--name stock-analyst \
--description "Analyzes stock market data and Reddit sentiment" \
--topic agents.specialist.stock-analyst \
--config ./agents/stock-analyst/config.md
`bash`
dagr list specialistsOutput:
- stock-analyst: "Analyzes stock market data..."
`bash`
dagr spawn stock-analyst \
--context "Check GME sentiment on Reddit" \
--reply-to agents.main.results
`bash`
dagr suspend \
--until "2026-01-22T18:00:00" \
--resume-context "Check for stock analyst results"
The agent process terminates. The runtime schedules a wake-up event. When the time comes, a fresh container is spun up with the restored state.
DAgR is built on NATS JetStream and Synadia Nex.
* Messaging: All agent coordination happens via NATS subjects (agents.{type}.{id}`).
* State: Persistent state is stored in NATS Key-Value (KV) buckets.
* Execution: Nex (NATS Execution Engine) listens to topics and spawns workloads (containers/WASM) on demand.
---
Distributed Agent Runtime (DAgR) — The Distributed Harness for Autonomous Agents