Skip to main content

Overview

Tabby’s memory system is what makes it truly intelligent. Instead of starting from scratch every conversation, it remembers your preferences, coding style, past interactions, and context to provide increasingly personalized assistance. The memory layer is powered by Mem0 with a hybrid storage architecture:

Mem0

Intelligent memory extraction and retrieval

Supabase

Vector embeddings for semantic search

Neo4j

Knowledge graph for relationships (optional)

What is Mem0?

Mem0 is an intelligent memory layer for AI applications that automatically:
  1. Extracts facts from conversations (“User prefers dark mode”)
  2. Stores embeddings for semantic search
  3. Retrieves relevant memories based on context
  4. Updates existing memories instead of duplicating
  5. Tracks memory history and changes over time
Think of Mem0 as giving your AI a long-term memory system, similar to how humans remember context from past conversations.

Memory Lifecycle

Architecture Components

1. Memory Backend (FastAPI)

The memory service runs as a separate FastAPI server on port 8000:
Why Separate Service?
Mem0 is a Python library. The FastAPI service acts as a bridge to the JavaScript/TypeScript frontend.
Memory operations can be resource-intensive. Running as a separate service allows independent scaling.
Crashes in the memory service don’t affect the main Electron app.

2. Supabase Vector Store

Supabase stores vector embeddings of memories for semantic search. Database Schema:
Vector Search:
Why HNSW Index?
HNSW (Hierarchical Navigable Small World) is a graph-based algorithm for approximate nearest neighbor search. It’s much faster than brute-force vector search with minimal accuracy loss.
  • Speed: Sub-millisecond queries even with 100k+ memories
  • Accuracy: 95%+ recall compared to exact search
  • Scalability: Handles millions of vectors efficiently

3. Neo4j Knowledge Graph (Optional)

Neo4j creates a visual knowledge graph showing relationships between memories. Graph Schema:
Example Graph: Visualization in Brain Panel:

Memory Types

Tabby classifies memories into 5 types using LLM-based classification:

LONG_TERM

Permanent facts and preferencesExamples:
  • “User prefers dark mode”
  • “My name is John”
  • “I like pizza”
  • “I’m a software engineer”

SHORT_TERM

Temporary states and current activitiesExamples:
  • “Currently working on auth feature”
  • “Right now debugging a bug”
  • “Need to finish this today”
  • “In a meeting”

EPISODIC

Past events with time contextExamples:
  • “Yesterday I had a meeting”
  • “Last week I deployed v2”
  • “Met John at conference”
  • “Fixed the bug on Monday”

SEMANTIC

General knowledge and factsExamples:
  • “Python uses indentation”
  • “Capital of France is Paris”
  • “React is a JS library”
  • “HTTP 404 means Not Found”

PROCEDURAL

How-to knowledge and processesExamples:
  • “To deploy, run npm build”
  • “First boil water, then add pasta”
  • “Steps to create PR: commit, push, open PR”

Classification System

LLM-Based Classifier:
Automatic Classification:

API Endpoints

The Memory API exposes RESTful endpoints:

Add Memory

Search Memories

Get All Memories

Add Image Memory

Update Memory

Delete Memory

Memory History

Integration with Tabby

Automatic Context Capture

Tabby automatically captures context and stores it as memories: 1. Periodic Screenshots (Interview Mode):
2. Conversation Memory:
3. User Preference Tracking:

Memory Retrieval in AI Context

Enhancing AI Responses with Memories:

Brain Panel UI

The Brain Panel (Ctrl+Shift+B) provides a visual interface for memory management:
Brain Panel Interface
Features:
  • View all memories by type (LONG_TERM, SHORT_TERM, etc.)
  • Search and filter memories
  • Edit or delete individual memories
  • See memory scores and relevance

Performance Optimization

Memory Search Caching

Batching Memory Additions

Privacy & Data Control

All memories are stored locally in your Supabase instance. No data is sent to external servers (except AI provider APIs for processing).
User Data Isolation:
  • Every memory tagged with user_id
  • Queries filtered by user_id (no cross-user leakage)
  • Users can delete all their memories via UI
Data Deletion:

Advanced Features

Memory Deduplication

Mem0 automatically deduplicates similar memories:
This is done via content hashing and semantic similarity checks.

Memory Versioning

Every memory update is tracked:

Cross-Session Context

Memories persist across:
  • App restarts
  • Different windows (Action Menu, Brain Panel, etc.)
  • Different features (Chat, Interview Copilot, Suggestions)
This creates a unified user experience where the AI truly knows you.

Troubleshooting

Check:
  1. Python 3.12+ installed
  2. uv sync ran successfully
  3. .env file has SUPABASE_CONNECTION_STRING
  4. Supabase is running (npx supabase status)
Fix:
Check:
  1. User ID is consistent across requests
  2. Vector embeddings are being generated (check Supabase)
  3. HNSW index is created on embedding column
Debug:
Check:
  1. Neo4j credentials in .env are correct
  2. Neo4j instance is running and accessible
  3. Graph store is enabled in Mem0 config
Test connection:

Next Steps

System Architecture

See how memory fits into the overall system

Technology Stack

Learn about Mem0 and other technologies used