Goldie Blocks

Messages Schema

Individual messages owned by the Convex Agent component

Ownership

Messages are owned and persisted by the Convex Agent component in its own database namespace — not the root app schema.

To list messages for a thread, call listUIMessages(ctx, components.agent, { threadId, paginationOpts }).

Fields

These fields reflect the Agent component's message model:

FieldTypeDescription
_idstringConvex document ID
threadIdstringParent thread
role"user" | "assistant" | "system" | "tool"Message sender
textstringPlain text content of the message
agentNamestringName of the agent that produced this message
status"success" | "failed"Whether the message was generated successfully
modelstringLLM model used (e.g. gpt-4o-mini)
usageobjectToken counts for the generation

Notes

  • Do not define a messages table in the root app schema — the Agent component manages its own storage.
  • Access message data via queries that delegate to components.agent and check the caller's access first (e.g. goldie/threads:listMessages).

On this page