Retrace Docs
Developer

Database Schema

How Retrace stores data in SQLite.

Overview

Retrace stores all data in a single SQLite database on your machine. The schema is managed by Drizzle ORM with versioned migrations.

The database file is located at ~/Library/Application Support/retrace/retrace.db.

Core tables

conversations

ColumnTypeDescription
idtextUnique conversation ID
platformtextSource platform (whatsapp, messenger, chatgpt, etc.)
titletextConversation title or participant names
participant_countintegerNumber of participants
message_countintegerNumber of messages
first_message_attextTimestamp of first message
last_message_attextTimestamp of last message
metadatatextJSON blob with platform-specific data

messages

ColumnTypeDescription
idtextUnique message ID
conversation_idtextFK to conversations
sender_nametextDisplay name of the sender
contenttextMessage text
timestamptextISO timestamp
is_from_meintegerWhether the message is from the user
person_idtextFK to people (nullable)
metadatatextJSON blob with original payload

people

ColumnTypeDescription
idtextUnique person ID
nametextDisplay name
avatar_urltextProfile picture URL

segments

ColumnTypeDescription
idtextUnique segment ID
conversation_idtextFK to conversations
summarytextLLM-generated summary
topicstextJSON array of extracted topics
sentimenttextSentiment label
start_attextSegment start timestamp
end_attextSegment end timestamp

embeddings

Vector embeddings for semantic search.

ColumnTypeDescription
idtextReferences segment ID
embeddingblobFloat vector

labels

ColumnTypeDescription
idtextUnique label ID
nametextLabel display name
typetextsystem, topic, or custom
colortextHex color code

label_assignments

Many-to-many join between labels and resources (conversations or people).

consumers + permission_rules

Permission profiles controlling which labels each consumer (MCP server, Claude chat, etc.) can access.

Metadata preservation

Every parser stores the complete original payload in the metadata JSON column. Fields not used today are preserved for future features. Storage is cheap; throwing away metadata is irreversible.

On this page