Skip to main content
PostgreSQL is the canonical store for an agent’s persona, memory, execution history, and configuration. Markdown and model prompts are views of that state, not a second source of truth.

What is versioned

These records are not one universal version history. Some configuration rows are updated in place; memory and persona have their own revision contracts. A prompt snapshot records an invocation’s context, not a restorable snapshot of the whole deployment.

Memory changes

remember creates an entry. amend creates a new revision of an existing entry. forget retires the entry while retaining its operation history. The current entry and its revision commit together. Subject, source, and visibility are separate structured references. An amendment preserves prior source restrictions and adds any new evidence; changing prose cannot strip private provenance. Sharing grants are revision-specific, so changed text needs new permission to reach an audience outside its source permissions. Both automatic context and recall use current, live, authorized revisions. Optional semantic indexes attach to immutable revisions and never override canonical state. See memory retrieval and memory privacy.

Execution state

A run’s model calls, tool observations, and outcomes are durable audit records. Checkpoints additionally save the execution frontier needed to recover after a worker exits. Continuation saves task context for another authorized stretch of work. Recovery reconstructs current system policy and permissions. It does not turn old prompt instructions into new authority, reset spent budgets, or assume that an unconfirmed external operation failed. Implementation: db/queries/versioned_state.sql (repository), internal/memory (repository), and internal/run (repository).