Documentation
Docs
Coordination

State Management

How to keep memory when processes are ephemeral.

The State Problem

When an agent crashes, its memory (RAM) is gone. If you were storing conversation history in a Python list, it's lost forever.

Persistent Context

Consonant maintains the Workflow State in the Control Plane (backed by Etcd/Postgres). When the Control Plane calls an Agent, it passes the relevant Context (conversation history, previous tool outputs) as input.

json
// Input passed to Agent
{
  "goal": "Summarize this",
  "context": {
    "file_content": "...",
    "previous_summary": "..."
  },
  "state_id": "run_123"
}

The Agent performs its task and returns the State Update. It does *not* persist state locally.

json
// Output from Agent
{
  "result": "Here is the summary...",
  "state_update": {
    "summary_completed": true
  }
}
Stateless Agents = Scalable Agents

Because Agents store no local state, we can run 100 replicas of "Researcher". Any request can go to any replica. If a replica dies mid-request, we just retry on another one.