Agent Harness Tutorial · End to end · Zoom level 2
The tables
All of it fits in one small Azure PostgreSQL server with two databases. The left one is ours. The right one belongs to the claims system; the harness never touches it directly.
| Table | One row is | Key columns |
|---|---|---|
| requests | one message, or one write tool call | name (the key), scope, state, outcome, expires_at |
| checkpoints | the conversation after one turn | run_id, conversation_id, customer_id, state (JSON) |
| sessions | one signed-in person | subject, refresh_token (encrypted with a Key Vault key) |
| approvals | one payout waiting for a person | id (= the DBOS workflow id), action, args, status, decided_by |
| escalations | one hand-off | id (E-…), question, found, missing, status, sla_due_at |
Not built yet: tables for long-term memory, for document knowledge with vector search, and for online eval findings. They are designed in the Series.
Want every detail? The long version is in the Series: the data model, table by table.
How it is done: the real code
Cut from the live repositories each time the site is built, so it always matches what runs.
claims_fnol_app/migrations/001_agent_state.sql:1The agent's tables-- The agent's own state (Tier 2), in the agent's database (claims_agent), -- beside the DBOS system tables the approval and escalation waits keep there. -- Never the claims system's database: the agent reaches the claims system only -- over MCP. -- -- The tables the harness's PostgreSQL adapters write (agent_harness.state.postgres -- and agent_harness.requests.postgres), as the reference agent's sql/001_schemas.sql -- declares them. Applied by `claims_fnol_app.store.migrate`. CREATE SCHEMA IF NOT EXISTS agent_state; -- One row per run; read back by conversation (F-006), erasable by customer (F-056). CREATE TABLE IF NOT EXISTS agent_state.checkpoints ( run_id text PRIMARY KEY, conversation_id text, customer_id text, state bytea NOT NULL, updated_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX IF NOT EXISTS checkpoints_customer ON agent_state.checkpoints (customer_id); CREATE INDEX IF NOT EXISTS checkpoints_conversation ON agent_state.checkpoints (conversation_id, updated_at DESC); -- One name, one outcome (T-062): the delivery claim and the tool-call ledger. CREATE TABLE IF NOT EXISTS agent_state.requests ( name text PRIMARY KEY, scope text NOT NULL, state text NOT NULL, outcome jsonb, expires_at timestamptz, recorded_at timestamptz NOT NULL DEFAULT now() );