Architecture
The memory system consists of three components:- Vector Store - Supabase PostgreSQL with pgvector for semantic search
- Graph Store - Neo4j for knowledge graph relationships (optional)
- Memory Backend - FastAPI server running Mem0
Configuration
Backend Environment
Configure the memory backend inbackend/.env:
Frontend Configuration
Point the frontend and Next.js backend to the memory API:Mem0 Configuration
The memory backend uses the following configuration (frombackend/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
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
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
- Development
- Production (Azure)
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
Troubleshooting
Memory backend won't start
Memory backend won't start
Check OpenAI API key: The backend requires Check Python dependencies:
OPENAI_API_KEY in backend/.envVerify Supabase is running:Memories not persisting
Memories not persisting
Verify connection string: Ensure Test database connection: Visit Studio at
SUPABASE_CONNECTION_STRING points to the correct local databaseCheck Supabase logs:http://localhost:54323 → SQL EditorNeo4j graph not showing
Neo4j graph not showing
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 enabledVision memories failing
Vision memories failing
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
.envfiles with credentials
Next Steps
AI Providers
Configure OpenAI and other AI providers
Application Settings
Customize Tabby settings and preferences