Skip to content

Conversations Schema

The Conversations schema defines the normalized format for provider-agnostic conversation storage. Raw provider exports (OpenAI, Anthropic, Google, Microsoft, xAI) are parsed and normalized into this format. Conversations stored in this format are referenced by conversations_index in the memory store.

This format preserves the full message graph including branching (DAG) from providers like OpenAI.

portable-ai-memory-conversation.schema.json

Schema: JSON Schema Draft 2020-12 · License: Apache 2.0

FieldTypeDescription
schemastringMUST be "portable-ai-memory-conversation"
schema_versionstringSchema version. MUST match the memory-store schema version
idstringUnique conversation identifier. SHOULD be UUID v4. Referenced by conversations_index
providerProviderInfoSource provider information and original identifiers
temporalobjectTimestamps. Required field: created_at (ISO 8601). Optional: updated_at
messagesMessage[]Array of normalized messages
FieldTypeDefaultDescription
titlestring | nullnullHuman-readable conversation title from provider export
participantsParticipant[][]Participants — typically user + assistant, may include system or tool
modelstring | nullnullPrimary model used (e.g., gpt-4o, claude-3-opus-20240229). May change per-message
system_instructionstring | nullnullSystem prompt or instruction active for this conversation
is_archivedbooleanfalseWhether archived by the user in the source platform
tagsstring[][]Tags or topics. Pattern: ^[a-z0-9][a-z0-9_-]*$
raw_metadataobject{}Provider-specific metadata preserved verbatim. Not interpreted by PAM
import_metadataImportMetadataMetadata about the import process

Source provider information. Preserves original identifiers for traceability.

FieldTypeRequiredDescription
namestringyesProvider identifier. MUST use product names (chatgpt, claude, gemini, copilot, grok), not company names. Same namespace as provenance.platform in the memory-store schema. Pattern: ^[a-z0-9_-]{2,32}$
conversation_idstring | nullnoOriginal conversation ID from the provider export
account_idstring | nullnoUser account ID on the provider platform
export_format_versionstring | nullnoVersion of the provider export format (e.g., 2025-01-export). Used to select the correct parser
FieldTypeRequiredDescription
rolestringyes"user", "assistant", "system", or "tool"
namestring | nullnoDisplay name if available
provider_idstring | nullnoProvider-specific participant identifier

A single normalized message. For linear conversations, messages are in chronological order. For branching conversations (e.g., OpenAI), use parent_id and children_ids to reconstruct the DAG.

FieldTypeDescription
idstringUnique message ID within this conversation. SHOULD be UUID v4
rolestringNormalized role: "user", "assistant", "system", "tool". Provider-specific values are mapped (e.g., humanuser, AIassistant). See Provider Mappings for the full table
created_atstringISO 8601 timestamp. Converted from provider format (Unix epoch for OpenAI, ISO for others)
FieldTypeDefaultDescription
provider_message_idstring | nullnullOriginal message ID from the provider export
contentMessageContentMessage content. May be text or multipart
parent_idstring | nullnullParent message ID for DAG reconstruction. null for root messages
children_idsstring[][]Child message IDs. Multiple children indicate branching
modelstring | nullnullModel that generated this message (assistant messages)
is_thoughtbooleanfalseInternal thinking/reasoning step (Gemini isThought, Claude extended thinking). Not part of visible conversation
token_countinteger | nullnullToken count if available from provider
attachmentsAttachment[][]Files, images, or other attachments
citationsCitation[][]Citations or sources referenced by this message
tool_callsToolCall[][]Tool/function calls made by the assistant
raw_metadataobject{}Provider-specific metadata preserved verbatim

Normalized message content. Supports both simple text and multipart content.

FieldTypeRequiredDescription
typestringyes"text" (content in text field) or "multipart" (content in parts array)
textstring | nullnoSimple text content. Used when type is "text"
partsContentPart[]noArray of content parts. Used when type is "multipart"

A single part of multipart content.

FieldTypeRequiredDescription
typestringyes"text", "image", "code", "file", "audio", "video"
textstring | nullnoText content (for text and code parts)
languagestring | nullnoProgramming language (for code parts)
mime_typestring | nullnoMIME type (for binary content parts)
refstring | nullnoReference to external file (path, URL, or storage ref)

File or media attachment on a message.

FieldTypeRequiredDescription
typestringyes"file", "image", "audio", "video", "document"
namestring | nullnoOriginal filename
mime_typestring | nullnoMIME type
size_bytesinteger | nullnoFile size in bytes
refstring | nullnoReference to the stored file
provider_idstring | nullnoProvider-specific attachment identifier

A citation or source referenced by a message.

FieldTypeRequiredDescription
titlestring | nullnoTitle of the cited source
urlstring | nullnoURL of the cited source
snippetstring | nullnoRelevant excerpt from the source

A tool or function call made by the assistant.

FieldTypeRequiredDescription
idstring | nullnoTool call identifier
namestringyesName of the tool or function called
inputobject | string | nullnoInput parameters passed to the tool
outputstring | nullnoOutput returned by the tool

Metadata about the import process. Enables debugging and re-import.

FieldTypeRequiredDescription
importerstring | nullnoImporter system identifier. Format: system/version
importer_versionstring | nullnoProvider-specific importer version (e.g., openai-importer/2025.01)
imported_atstring | nullnoISO 8601 timestamp of import
source_filestring | nullnoOriginal source file path or identifier
source_checksumstring | nullnoSHA-256 of the original source file. Pattern: ^sha256:[a-f0-9]{64}$