Logo
Search
Docs

Database reference

The exact tables and columns the Agents API reads and writes.

Identity mapping

The public id of an agent, chat, or connector is the uid column (a UUID), never the numeric primary key. Files are the exception: their public id is the numeric ai_project_files.id.

ai_projects (agents)

ColumnTypeNullableNotes
uidchar(36)yesThe public agent id
namevarchar(255)noDisplay name
descriptiontextyesOptional description
instructionslongtextyesPersistent system prompt
last_activity_attimestampyesBumped on conversation activity
is_publictinyint(1)no (default 0)Globally shared read-only flag; managed from the dashboard, read-only here
created_at / updated_attimestampyes

ai_chats (chats)

ColumnTypeNullableNotes
uidchar(36)yesThe public chat id
titlevarchar(255)no (default New chat)Renameable
modelvarchar(255)yesModel id chosen for the thread
providervarchar(255)noModel provider identifier (informational)
last_message_attimestampyes

ai_chat_messages (messages)

ColumnTypeNullableNotes
idbigint unsignednoThe public message id; also the before_id cursor
roleenum(user,assistant)no
contentlongtextnoMax 20,000 characters at the API boundary
modelvarchar(255)yes
prompt_tokens / completion_tokens / total_tokensint unsignedno (default 0)Billing counters; surfaced as usage on fresh replies

ai_project_files (knowledge files)

ColumnTypeNullableNotes
idbigint unsignednoThe public file id
original_namevarchar(255)noAs uploaded
mimevarchar(255)yes
sizebigint unsignedno (default 0)Bytes
vector_countint unsignedno (default 0)> 0 means indexed for retrieval

ai_mcp_connectors + ai_project_mcp_connectors

ai_mcp_connectors (the connector registry — only API-exposed columns listed):

ColumnTypeNullableNotes
uidchar(36)noThe public connector id
namevarchar(255)no
descriptiontextyes
server_urlvarchar(255)noThe connector’s tool-server endpoint
tools_countint unsignedno (default 0)
is_activetinyint(1)no (default 1)Inactive connectors are never offered

ai_project_mcp_connectors (per-agent state):

ColumnTypeNullableNotes
is_enabledtinyint(1)no (default 1)Written by the connector toggle
disabled_toolsjsonyesList of tool names switched off for this agent