Table

messages

One turn. Tool turns store the retrieval trace as JSON in content.

id bigserial PK
conversation_id varchar not null
role message_role not null
content text not null
tokens int Model-reported usage for this turn.
sent_at timestamptz not null
index conversation_id, sent_at