Complete implementation: REST API, MCP server, and documentation
Implementation Summary:
- REST API with FastAPI (complete CRUD operations)
- MCP Server with Python MCP SDK (7 tools)
- Supabase migrations (pgvector setup)
- Docker Compose orchestration
- Mintlify documentation site
- Environment configuration
- Shared config module
REST API Features:
- POST /v1/memories/ - Add memory
- GET /v1/memories/search - Semantic search
- GET /v1/memories/{id} - Get memory
- GET /v1/memories/user/{user_id} - User memories
- PATCH /v1/memories/{id} - Update memory
- DELETE /v1/memories/{id} - Delete memory
- GET /v1/health - Health check
- GET /v1/stats - Statistics
- Bearer token authentication
- OpenAPI documentation
MCP Server Tools:
- add_memory - Add from messages
- search_memories - Semantic search
- get_memory - Retrieve by ID
- get_all_memories - List all
- update_memory - Update content
- delete_memory - Delete by ID
- delete_all_memories - Bulk delete
Infrastructure:
- Neo4j 5.26 with APOC/GDS
- Supabase pgvector integration
- Docker network: localai
- Health checks and monitoring
- Structured logging
Documentation:
- Introduction page
- Quickstart guide
- Architecture deep dive
- Mintlify configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
111
docker-compose.yml
Normal file
111
docker-compose.yml
Normal file
@@ -0,0 +1,111 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Neo4j Graph Database
|
||||
neo4j:
|
||||
image: neo4j:5.26-community
|
||||
container_name: t6-mem0-neo4j
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "7474:7474" # HTTP Browser UI
|
||||
- "7687:7687" # Bolt Protocol
|
||||
environment:
|
||||
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD}
|
||||
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
|
||||
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*
|
||||
- NEO4J_dbms_memory_heap_initial__size=512M
|
||||
- NEO4J_dbms_memory_heap_max__size=2G
|
||||
- NEO4J_dbms_memory_pagecache_size=512M
|
||||
volumes:
|
||||
- neo4j_data:/data
|
||||
- neo4j_logs:/logs
|
||||
- neo4j_import:/import
|
||||
- neo4j_plugins:/plugins
|
||||
networks:
|
||||
- localai
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "cypher-shell -u ${NEO4J_USER:-neo4j} -p ${NEO4J_PASSWORD} 'RETURN 1'"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# REST API Server
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile.api
|
||||
container_name: t6-mem0-api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${API_PORT:-8080}:8080"
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- SUPABASE_CONNECTION_STRING=${SUPABASE_CONNECTION_STRING}
|
||||
- NEO4J_URI=neo4j://neo4j:7687
|
||||
- NEO4J_USER=${NEO4J_USER:-neo4j}
|
||||
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
|
||||
- API_HOST=0.0.0.0
|
||||
- API_PORT=8080
|
||||
- API_KEY=${API_KEY}
|
||||
- MEM0_COLLECTION_NAME=${MEM0_COLLECTION_NAME:-t6_memories}
|
||||
- MEM0_EMBEDDING_DIMS=${MEM0_EMBEDDING_DIMS:-1536}
|
||||
- MEM0_VERSION=${MEM0_VERSION:-v1.1}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
||||
- ENVIRONMENT=${ENVIRONMENT:-production}
|
||||
depends_on:
|
||||
neo4j:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- localai
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:8080/v1/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
# MCP Server
|
||||
mcp-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile.mcp
|
||||
container_name: t6-mem0-mcp
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${MCP_PORT:-8765}:8765"
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- SUPABASE_CONNECTION_STRING=${SUPABASE_CONNECTION_STRING}
|
||||
- NEO4J_URI=neo4j://neo4j:7687
|
||||
- NEO4J_USER=${NEO4J_USER:-neo4j}
|
||||
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
|
||||
- MCP_HOST=0.0.0.0
|
||||
- MCP_PORT=8765
|
||||
- MEM0_COLLECTION_NAME=${MEM0_COLLECTION_NAME:-t6_memories}
|
||||
- MEM0_EMBEDDING_DIMS=${MEM0_EMBEDDING_DIMS:-1536}
|
||||
- MEM0_VERSION=${MEM0_VERSION:-v1.1}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
||||
- ENVIRONMENT=${ENVIRONMENT:-production}
|
||||
depends_on:
|
||||
neo4j:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- localai
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:8765/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
neo4j_data:
|
||||
name: t6-mem0-neo4j-data
|
||||
neo4j_logs:
|
||||
name: t6-mem0-neo4j-logs
|
||||
neo4j_import:
|
||||
name: t6-mem0-neo4j-import
|
||||
neo4j_plugins:
|
||||
name: t6-mem0-neo4j-plugins
|
||||
|
||||
networks:
|
||||
localai:
|
||||
external: true
|
||||
Reference in New Issue
Block a user