Skip to main content
An agent server keeps its tasks in PostgreSQL when POSTGRES_URL is set. In that mode the server runs a2a-sdk’s cluster mode, and any number of servers of one agent can share the database: any of them executes, follows and cancels any task. Without POSTGRES_URL tasks are kept in memory, in one process. Run a single server then: a second one shares nothing with the first.

Requirements

How requests are served

Every stream opens and closes with a Task, whichever server serves it.

Behaviour to plan for

  • Two executions of one task. A second message sent to another server while the task is running is executed there. Each write carries the task’s version, so the outcome that is written first stands; the other execution stops when it next writes. Send a task’s next message after its current turn ends.
  • Live-only updates. Response and thinking deltas and ephemeral progress are never stored, so a subscriber on another server does not receive them; it receives the stored messages, statuses and artifacts.
  • A server that dies. Its tasks keep the state they had; nothing settles them on its own. Cancel such a task from any server. A server that shuts down in an orderly way settles its running tasks as FAILED with aion:settledReason set to server_shutdown.
  • The journal grows. Every stored event is kept in task_events, also after its task is deleted.

Database tables

All of them are created in the aion schema by the SDK’s migrations at startup.