Skip to content

Architecture Persistence

Devrajsinh Gohil edited this page Aug 30, 2026 · 1 revision

Persistence & Crash Recovery

AgentMesh provides transactional persistence via the IStateRepository interface.


PostgreSQL Implementation (PostgresStateRepository)

  • Implemented using native libpq C bindings for minimal overhead.
  • Serializes workflow state and task execution logs into PostgreSQL tables.
  • Supports ACID transactional updates after every completed wave.

Crash Resumption Guarantee

If the host process is killed via SIGKILL or power outage:

  1. On restart, the engine queries PostgreSQL for workflows in Running state.
  2. Orphaned tasks are reset to Ready.
  3. In-flight state is restored in <4.8 ms with 0% data corruption.\n

Clone this wiki locally