Local-first infrastructure for agent state

agentd

An out-of-process state machine daemon for AI agents. It owns durable task state, strict DAG transitions, leases, heartbeats, and an append-only event journal.

What it does

One local source of truth for long-running agent work.

Durable state

SQLite stores global tasks, DAG nodes, result payloads, and event history under ~/.agentd.

Strict transitions

Nodes move through PENDING, RUNNING, COMPLETED, or FAILED.

Lease safety

Workers acquire leases, heartbeat while running, and stale work rolls back to PENDING.

Model agnostic

Python, Node, Rust, and shell clients can coordinate through Unix Domain Socket JSON Lines IPC.

Low overhead

No network service is required. The daemon runs locally as a small Rust binary.

Runtime discovery

Agents can call DescribeInterface to learn supported methods and payload shapes.

Runtime interface

Ask the daemon what it supports.

The IPC contract is discoverable at runtime. Send one JSON object per line to the Unix socket and read one JSON response per line.

DescribeInterface
RegisterTask
AcquireNextNode
CommitEvent
HeartbeatNode
CompleteNode
FailNode
TaskStatus
printf '%s\n' '{"id":1,"method":"DescribeInterface","params":{}}' \
  | nc -U ~/.agentd/agentd.sock \
  | python3 -m json.tool