pub struct Message {Show 16 fields
pub message_id: Uuid,
pub session_id: Uuid,
pub tenant_id: Option<TenantId>,
pub user_id: Option<UserId>,
pub parent_message_id: Option<Uuid>,
pub variant_index: u32,
pub is_active: bool,
pub role: MessageRole,
pub parts: Vec<MessagePart>,
pub file_ids: Vec<Uuid>,
pub metadata: Option<Value>,
pub is_complete: bool,
pub is_hidden_from_user: bool,
pub is_hidden_from_backend: bool,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
}Expand description
A message node in the immutable conversation tree.
Messages form a DAG rooted at the session: each message (except the first)
has a parent_message_id, and siblings sharing the same parent are
variants differentiated by variant_index. Exactly one sibling per parent
is is_active=true, which defines the current conversation path.
Fields§
§message_id: UuidUnique message identifier (primary key).
session_id: UuidSession this message belongs to.
tenant_id: Option<TenantId>Owning tenant, denormalized from the parent session so message-scoped
queries and sharding don’t require a join. When set, always equals the
session’s tenant_id. None only for legacy rows persisted before the
column existed (not yet backfilled).
user_id: Option<UserId>Author of this specific message (not the session owner). Set to the
authenticated user for user-role messages; None for assistant /
system messages (machine-generated, no human author) and un-backfilled
legacy rows. Enables author attribution in multi-user / shared sessions.
parent_message_id: Option<Uuid>Parent message in the tree; None for the first (root) message.
variant_index: u32Ordinal among siblings sharing the same parent_message_id within the
same session. Starts at 0 and increments per recreate.
is_active: boolTrue if this variant is currently on the active conversation path. Exactly one sibling per parent should be active.
role: MessageRoleWho produced the message: user / assistant / system.
parts: Vec<MessagePart>Ordered, typed body fragments. The parts in number order form the
message body (replaces the former single content blob). Empty only
for a freshly-created assistant stub before its text part is persisted.
file_ids: Vec<Uuid>External file UUIDs referenced by this message. Chat Engine forwards them opaquely — file content is never fetched by Chat Engine itself.
metadata: Option<Value>Per-message metadata (model used, finish_reason, usage, etc.). Typed as JSON because it is plugin-defined.
is_complete: booltrue once the assistant finished streaming (or the message was
persisted whole). User messages are always complete on creation.
Hide this message from client UIs (e.g., system messages, internal summaries that should not appear in the transcript).
Exclude this message from the history sent to backend plugins (e.g., messages already covered by a newer summary).
created_at: OffsetDateTimeCreation timestamp (UTC).
updated_at: OffsetDateTimeLast-modified timestamp (UTC). Typically changes only when an assistant placeholder is filled in.