diff --git a/.env.example b/.env.example index 92e534b..6ec9968 100644 --- a/.env.example +++ b/.env.example @@ -5,11 +5,9 @@ OPENAI_BASE_URL=https://your-openai-compatible-endpoint.com/v1 EMBEDDER_API_KEY=AIzaSy-your-google-gemini-api-key-here # Database Configuration -POSTGRES_DB=mem0_db -POSTGRES_USER=mem0_user -POSTGRES_PASSWORD=mem0_password -POSTGRES_HOST=postgres -POSTGRES_PORT=5432 +QDRANT_HOST=qdrant +QDRANT_PORT=6333 +QDRANT_COLLECTION_NAME=mem0 # Neo4j Configuration NEO4J_AUTH=neo4j/mem0_neo4j_password @@ -36,4 +34,5 @@ EXPERT_MODEL=o3 # Expert-level comprehensive analysis # - Ensure all models are available on your OpenAI-compatible endpoint # - Verify model availability: curl -H "Authorization: Bearer $API_KEY" $BASE_URL/v1/models # - Neo4j must be version 5.18+ for vector.similarity.cosine() function -# - Ollama must be running locally with nomic-embed-text:latest model \ No newline at end of file +# - Qdrant vector database for embeddings storage (replaces PostgreSQL+pgvector) +# - Ollama must be running locally with nomic-embed-text:latest model diff --git a/README.md b/README.md index 95dee41..5a2a807 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Mem0 Interface - Production Ready -A fully operational Mem0 interface with PostgreSQL and Neo4j integration, featuring intelligent model routing, comprehensive memory management, and production-grade monitoring. +A fully operational Mem0 interface with Qdrant and Neo4j integration, featuring intelligent model routing, comprehensive memory management, and production-grade monitoring. ## Features ### Core Memory System - ✅ **Mem0 OSS Integration**: Complete hybrid datastore (Vector + Graph + KV storage) -- ✅ **PostgreSQL + pgvector**: High-performance vector embeddings storage +- ✅ **Qdrant**: Purpose-built vector database for high-performance embeddings storage - ✅ **Neo4j 5.18**: Graph relationships with native vector similarity functions - ✅ **Google Gemini Embeddings**: Enterprise-grade embedding generation - ✅ **Memory Operations**: Store, search, update, delete memories with semantic search @@ -62,7 +62,7 @@ curl http://localhost:8000/health ### Core Components - **FastAPI Backend**: Production-ready API with comprehensive monitoring - **Mem0 OSS**: Hybrid memory management (vector + graph + key-value) -- **PostgreSQL + pgvector**: Vector embeddings storage and similarity search +- **Qdrant**: Purpose-built vector database for embeddings storage and similarity search - **Neo4j 5.18**: Graph relationships with native vector functions - **Google Gemini**: Enterprise-grade embedding generation @@ -203,13 +203,13 @@ curl http://localhost:8000/graph/relationships/alice ### Service Dependencies - **Neo4j**: Must start before backend for vector functions -- **PostgreSQL**: Required for vector storage initialization +- **Qdrant**: Required for vector storage initialization - **Ollama**: Must be running locally on port 11434 - **API Endpoint**: Must have valid models available ## Production Notes -- **Memory Usage**: Neo4j and PostgreSQL require adequate RAM for vector operations +- **Memory Usage**: Neo4j and Qdrant require adequate RAM for vector operations - **API Rate Limits**: Monitor usage on custom endpoint - **Data Persistence**: All data stored in Docker volumes - **Scaling**: Individual services can be scaled independently @@ -217,4 +217,4 @@ curl http://localhost:8000/graph/relationships/alice ## Development -See individual README files in `backend/` and `frontend/` directories for development setup. \ No newline at end of file +See individual README files in `backend/` and `frontend/` directories for development setup. diff --git a/backend/README.md b/backend/README.md index 9ecca2c..5bd3736 100644 --- a/backend/README.md +++ b/backend/README.md @@ -9,7 +9,7 @@ A production-ready FastAPI backend that provides intelligent memory integration 1. **Mem0Manager** (`mem0_manager.py`) - Central orchestration of memory operations - Integration with custom OpenAI-compatible endpoint - - Memory persistence across PostgreSQL and Neo4j + - Memory persistence across Qdrant and Neo4j - Performance timing and operation tracking 2. **Configuration System** (`config.py`) @@ -39,8 +39,8 @@ A production-ready FastAPI backend that provides intelligent memory integration ``` ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ -│ PostgreSQL │ │ Neo4j │ │ Custom LLM │ -│ (pgvector) │ │ (APOC) │ │ Endpoint │ +│ Qdrant │ │ Neo4j │ │ Custom LLM │ +│ (Vector DB) │ │ (APOC) │ │ Endpoint │ ├─────────────────┤ ├─────────────────┤ ├─────────────────┤ │ • Vector Store │ │ • Graph Store │ │ • claude-sonnet-4│ │ • Embeddings │ │ • Relationships │ │ • Gemini Embed │ @@ -134,11 +134,9 @@ backend/ | `OPENAI_COMPAT_API_KEY` | Your custom endpoint API key | - | ✅ | | `OPENAI_BASE_URL` | Custom endpoint URL | - | ✅ | | `EMBEDDER_API_KEY` | Google Gemini API key for embeddings | - | ✅ | -| `POSTGRES_HOST` | PostgreSQL host | postgres | ✅ | -| `POSTGRES_PORT` | PostgreSQL port | 5432 | ✅ | -| `POSTGRES_DB` | Database name | mem0_db | ✅ | -| `POSTGRES_USER` | Database user | mem0_user | ✅ | -| `POSTGRES_PASSWORD` | Database password | - | ✅ | +| `QDRANT_HOST` | Qdrant vector database host | qdrant | ✅ | +| `QDRANT_PORT` | Qdrant vector database port | 6333 | ✅ | +| `QDRANT_COLLECTION_NAME` | Qdrant collection name | mem0 | ✅ | | `NEO4J_URI` | Neo4j connection URI | bolt://neo4j:7687 | ✅ | | `NEO4J_USERNAME` | Neo4j username | neo4j | ✅ | | `NEO4J_PASSWORD` | Neo4j password | - | ✅ | @@ -283,7 +281,7 @@ docker exec mem0-neo4j cypher-shell -u neo4j -p mem0_neo4j_password \ ### Key Integration Points Verified - ✅ **Ollama Embeddings**: nomic-embed-text:latest working for vector generation -- ✅ **PostgreSQL + pgvector**: Vector storage and similarity search operational +- ✅ **Qdrant**: Vector storage and similarity search operational - ✅ **Neo4j 5.18**: Graph relationships and native vector functions working - ✅ **Custom LLM Endpoint**: All 4 models accessible and routing correctly - ✅ **Memory Persistence**: Data survives container restarts via Docker volumes @@ -390,7 +388,7 @@ backend: #### Dependency Requirements - Neo4j 5.18+ (for vector.similarity.cosine function) - Ollama running locally with nomic-embed-text:latest -- PostgreSQL with pgvector extension +- Qdrant vector database - Valid API keys for custom LLM endpoint ### Debugging Commands @@ -447,4 +445,4 @@ docker logs mem0-backend --tail 20 -f ## 📄 License -This POC is designed for demonstration and evaluation purposes. \ No newline at end of file +This POC is designed for demonstration and evaluation purposes.