@addbrain/dagr
v0.0.2
Published
Distributed Agent Runtime (DAgR) - The Distributed Harness for Autonomous Agents
Maintainers
Readme
DAgR: Distributed Agent Runtime
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.
✨ Features
- 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.
🚀 Installation
npm install -g @addbrain/dagr💻 Usage
The dagr CLI is your gateway to the runtime. It is designed to be used by both humans and agents (via bash tool use).
Starting an Agent
Start a local agent session (similar to Claude Code) but with DAgR superpowers enabled.
dagr start --agent claude-codeRegistration (Service Discovery)
Register a specialist agent so others can find it. This uses NATS KV for service discovery.
dagr register specialist \
--name stock-analyst \
--description "Analyzes stock market data and Reddit sentiment" \
--topic agents.specialist.stock-analyst \
--config ./agents/stock-analyst/config.mdDiscovery
Find available specialists in the mesh.
dagr list specialists
# Output:
# - stock-analyst: "Analyzes stock market data..."Spawning Sub-Agents
Trigger a specialist to perform a task.
dagr spawn stock-analyst \
--context "Check GME sentiment on Reddit" \
--reply-to agents.main.resultsLifecycle Management
Agents can choose to suspend execution and satisfy the "Context Penalty" by exiting completely.
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.
🏗 Architecture
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
