Skip to content

Durable agent runtime. Sessions survive crashes. Agents are just files. One binary, zero dependencies.

License

Notifications You must be signed in to change notification settings

giosakti/duragent

Duragent

CI Docs Rust License

Duragent — A durable, self-contained runtime for AI agents.

Sessions survive crashes. Agents are just files. One binary, zero dependencies.

Use it as a personal AI assistant, or as the foundation for agent-powered products.

What you get How
Sessions that survive crashes Append-only event log, attach/detach like tmux
Agents you can read and version YAML + Markdown — no code required
State you can inspect Just files on disk — cat, grep, git diff
Deploy anywhere Single binary, ~10MB, no Python/Node/Docker
Your choice of parts Swap LLM providers, gateways, and storage backends or bring your own

Quick Start

1. Install and initialize

git clone https://github.com/giosakti/duragent.git
cd duragent && make build

# Or: cargo install --git https://github.com/giosakti/duragent.git

duragent init
# Follow the interactive setup

2. Set up your API key and start the server

export OPENROUTER_API_KEY=your-key  # or: duragent login anthropic
duragent serve

3. Chat with your agent

duragent chat --agent <YOUR_AGENT_NAME>

4. Attach to a session later

duragent attach --list       # List attachable sessions
duragent attach SESSION_ID   # Reconnect to existing session

Features

  • Durable sessions — crash, restart, reconnect; your conversation survives
  • Portable agent format — define agents in YAML + Markdown; inspect, version, and share them
  • Memory — agents recall past conversations, remember experiences, and reflect on long-term knowledge
  • Tools — bash execution, CLI tools, and scheduled tasks, with configurable approval policies
  • Skills — modular capabilities defined as Markdown files (Agent Skills standard)
  • Multiple LLM providers — Anthropic, OpenAI, OpenRouter, Ollama
  • Platform gateways — Telegram and Discord via subprocess plugins
  • HTTP API — REST endpoints with SSE streaming

Modular by Design

Use the built-ins, or swap in your own:

Component Default Swappable
Gateways CLI, HTTP, SSE, Telegram, Discord Any platform via gateway plugins
LLM OpenRouter Anthropic, OpenAI, Ollama, or any provider
Sandbox Trust mode bubblewrap, Docker (planned)
Storage Filesystem Postgres, S3 (planned)

Workspace Layout

./.duragent/
├── agents/<agent-name>/
│   ├── agent.yaml           # Agent definition (Duragent Format)
│   ├── SOUL.md              # "Who the agent IS" (identity and personality)
│   ├── SYSTEM_PROMPT.md     # "What the agent DOES" (core system prompt)
│   ├── INSTRUCTIONS.md      # Additional runtime instructions (optional)
│   ├── policy.yaml          # Tool execution policy (optional)
│   ├── skills/              # Modular capabilities (SKILL.md files)
│   └── memory/
│       ├── MEMORY.md        # Curated long-term memory
│       └── daily/           # Daily experience logs
├── sessions/
│   └── <session_id>/
│       ├── events.jsonl     # Append-only event log
│       └── state.yaml       # Snapshot for fast resume
├── schedules/               # Scheduled tasks and run logs
└── memory/
    └── world/               # Shared knowledge across all agents

Documentation

Read the Duragent Guide for installation, configuration, and usage.

For contributors: CONTRIBUTING.md | Project Status | Internal Specs

License

MIT

About

Durable agent runtime. Sessions survive crashes. Agents are just files. One binary, zero dependencies.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks