Skip to main content

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
This separation allows for efficient retrieval of both full conversation context and quick access to key facts about the user.

Architecture Diagram

Firestore Structure


Part 1: Storing Conversations

Processing Flow

API Request

The app sends a POST request to /v1/conversations with transcript data

Processing

process_conversation() in utils/conversations/process_conversation.py handles the logic

Structure Extraction

LLM extracts title, overview, action items, and events from the transcript

Storage

upsert_conversation() in database/conversations.py saves to Firestore

Vector Embedding

Conversation is embedded and stored in Pinecone for semantic search

Conversation Model Fields

Structured Information

The structured field contains LLM-extracted information:

Transcript Segments

Each segment in transcript_segments includes:

Action Items

Action items are stored both inline (in structured.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

During process_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 conversation

Memory 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 + 2 system memories 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 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:
The save_structured_vector() function:
  1. Generates embedding from conversation.structured (title + overview + action_items + events)
  2. Extracts metadata via LLM (people, topics, entities, dates)
  3. Upserts to Pinecone with metadata filters
Vectors are created ONCE during initial processing. Reprocessed conversations do NOT update their vectors.

Key Code Locations


API Endpoints

Conversations

Memories


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