Skip to main content
Tabby uses Mem0 for persistent AI memory, allowing the assistant to remember your preferences, coding style, and past interactions across sessions.

Architecture

The memory system consists of three components:
  1. Vector Store - Supabase PostgreSQL with pgvector for semantic search
  2. Graph Store - Neo4j for knowledge graph relationships (optional)
  3. Memory Backend - FastAPI server running Mem0

Configuration

Backend Environment

Configure the memory backend in backend/.env:

Frontend Configuration

Point the frontend and Next.js backend to the memory API:

Mem0 Configuration

The memory backend uses the following configuration (from backend/main.py:36-76):
backend/main.py

Configuration Options

Vector Store Setup

Tabby uses a local Supabase instance running in Docker for vector storage.
1

Start Docker Desktop

Ensure Docker Desktop is running before proceeding.
2

Initialize Supabase

Run this command once in the project root:
3

Start Supabase

The first run downloads ~13 Docker images. Subsequent starts take ~10 seconds.
4

Note Credentials

Copy the DB URL from the output:
Look for DB URL (format: postgresql://postgres:postgres@127.0.0.1:54322/postgres)
5

Update Backend Environment

Add the connection string to backend/.env:
The database schema is automatically applied from supabase/migrations/ when Supabase starts.

Supabase Commands

Docker Desktop must be running before executing npx supabase start.

Neo4j Knowledge Graph (Optional)

Neo4j provides a knowledge graph visualization of memory relationships, enhancing contextual understanding.

Setup Neo4j AuraDB

1

Create Free Instance

Visit Neo4j AuraDB and create a free instance.
2

Save Credentials

Download the credentials text file when creating the instance. It contains:
  • URI (e.g., neo4j+s://xxx.databases.neo4j.io)
  • Username (usually neo4j)
  • Password
3

Get Instance Details

Note your Instance ID and Instance Name from the dashboard.
4

Configure Backend

Add credentials to backend/.env:
The graph store is automatically enabled when NEO4J_URL and NEO4J_PASSWORD are set.

Benefits of Neo4j Integration

  • Relationship Mapping - Visualize connections between memories
  • Contextual Retrieval - Better understanding of related concepts
  • Knowledge Graph - See how information connects over time
  • Brain Panel Visualization - Interactive graph view in the app

Memory Types

Tabby automatically classifies memories into five types using AI:
Memory classification uses OpenAI’s gpt-4.1-nano-2025-04-14 model and happens automatically when memories are added.

Starting the Memory Backend

The server runs on http://localhost:8000 with auto-reload enabled.

Memory API Endpoints

The FastAPI backend provides the following endpoints:

Core Operations

Special Features

All memory operations support automatic type classification and metadata filtering.

Alternative Vector Store

Mem0 also supports ChromaDB as an alternative to Supabase. To use Chroma:
backend/main.py
Using ChromaDB requires modifying backend/main.py. Supabase is recommended for production use.

Troubleshooting

Check OpenAI API key: The backend requires OPENAI_API_KEY in backend/.envVerify Supabase is running:
Check Python dependencies:
Verify connection string: Ensure SUPABASE_CONNECTION_STRING points to the correct local databaseCheck Supabase logs:
Test database connection: Visit Studio at http://localhost:54323 → SQL Editor
Verify credentials: Check that all NEO4J_* variables are set in backend/.envTest connection: Visit your Neo4j instance dashboard to verify it’s activeCheck backend logs: The startup message shows if graph store is enabled
Verify image URLs: Ensure image URLs are accessibleCheck OpenAI API: Vision features require enable_vision: True and proper API accessReview request format: Image URLs must be in the correct format (see API endpoint docs)

Best Practices

Memory Management

  • Use memory types to organize and filter memories effectively
  • Enable auto-classification for automatic memory categorization
  • Add metadata for better search and filtering
  • Regularly review memories in the Brain Panel

Performance

  • Use HNSW indexing for faster similarity search (default)
  • Set appropriate search limits to avoid overwhelming results
  • Consider Neo4j for complex relationship queries
  • Monitor vector store size and clean up old memories

Security

  • Keep Supabase local for development (Docker)
  • Use secure connections for production Neo4j (SSL/TLS)
  • Rotate database passwords regularly
  • Never commit .env files with credentials

Next Steps

AI Providers

Configure OpenAI and other AI providers

Application Settings

Customize Tabby settings and preferences