Overview
Omi uses a dual-collection architecture for storing user data:Conversations
Primary storage for recorded interactions - transcripts, audio, structured summaries
Memories
Secondary storage for extracted facts/learnings FROM conversations
Architecture Diagram
Firestore Structure
Part 1: Storing Conversations
Processing Flow
API Request
The app sends a POST request to
/v1/conversations with transcript dataProcessing
process_conversation() in utils/conversations/process_conversation.py handles the logicStructure Extraction
LLM extracts title, overview, action items, and events from the transcript
Storage
upsert_conversation() in database/conversations.py saves to FirestoreVector Embedding
Conversation is embedded and stored in Pinecone for semantic search
Conversation Model Fields
Structured Information
Thestructured field contains LLM-extracted information:
Transcript Segments
Each segment intranscript_segments includes:
Action Items
Action items are stored both inline (instructured.action_items) and in a standalone collection:
Events
Calendar events extracted from conversations:Part 2: Extracting & Storing Memories
Memories are facts about the user extracted from conversations. They represent learnings, preferences, habits, and other personal information.Memory Extraction Process
Duringprocess_conversation(), the system:
Analyze Transcript
Reviews the conversation transcript for personal information
Extract Facts
Identifies facts worth remembering about the user (~15 words max)
Store with Link
Saves to
memories collection with a link back to the source conversationMemory Model Fields
Memory Categories
Interesting
Notable facts about the user: hobbies, opinions, stories
System
Preferences and patterns: work habits, sleep schedule
Manual
User-created memories: explicitly added facts
Legacy categories (
core, hobbies, lifestyle, interests, habits, work, skills, learnings, other) are automatically mapped to the new primary categories for backward compatibility.Memory Extraction Rules
The system follows these guidelines when extracting memories:- Maximum ~15 words per memory
- Must pass the “shareability test” - would this be worth telling someone?
- Maximum 2
interesting+ 2systemmemories per conversation - No duplicate or near-duplicate facts
- Skip mundane details (eating, sleeping, commuting)
Part 3: Data Protection & Encryption
Both conversations and memories support encryption for sensitive data.- Standard
- Enhanced
Standard Protection Level
No encryption, stored as plaintext. This is the default for most users.- Fastest read/write performance
- Data visible in Firestore console
- Suitable for general use
Implementation
Part 4: Vector Embeddings
Conversations are also stored as vector embeddings in Pinecone for semantic search.What Gets Embedded
Vector Creation
Vectors are created in a background thread after conversation processing:save_structured_vector() function:
- Generates embedding from
conversation.structured(title + overview + action_items + events) - Extracts metadata via LLM (people, topics, entities, dates)
- Upserts to Pinecone with metadata filters
Key Code Locations
API Endpoints
Conversations
Memories
Related Documentation
Chat System Architecture
How conversations are retrieved for chat using LangGraph
Real-time Transcription
WebSocket-based real-time speech-to-text
Backend Deep Dive
General backend architecture overview
Backend Setup
Environment setup and configuration