Table chat_histories { id uuid [pk, default: `gen_random_uuid()`] session_id text [not null] title text channel text agent_id text project_id uuid [ref: > projects.guid] messages jsonb [not null, default: `'[]'`] summary text metadata jsonb [not null, default: `'{}'`] created_at timestamptz [not null, default: `now()`] updated_at timestamptz [not null, default: `now()`] indexes { session_id project_id channel agent_id created_at } } Table tool_annotations { id bigserial [pk] tool_name text [unique, not null] notes text [not null, default: ''] created_at timestamptz [not null, default: `now()`] updated_at timestamptz [not null, default: `now()`] } // Cross-file refs (for relspecgo merge) Ref: chat_histories.project_id > projects.guid [delete: set null]