A containerized RAG (Retrieval-Augmented Generation) system that indexes your local documents and makes them searchable through Claude Code and LM Studio via MCP (Model Context Protocol).
Note: This is primarily tested on Mac and Linux (check LINUX.md) No clue about Windows.
Key Features:
- 🔒 Fully Local: Uses Ollama for embeddings and LLM processing
- 🔌 MCP Integration: Works seamlessly with Claude Code and LM Studio
- 📁 Multi-Format Support: Processes Markdown, PDF, Word docs, and text files
- ⚡ Real-Time Processing: Auto-detects and processes new/modified documents
- 🌐 Web Interface: Built-in chat interface for direct document querying (very basic, better to use LMStudio)
📋 Documentation Links:
- Architecture Overview - Detailed system architecture with diagrams
- Linux Configuration - Linux-specific setup and troubleshooting
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull required models
ollama pull mxbai-embed-large # Embedding model
ollama pull llama3.1:8b # Chat modelcp .env.example .env
# Edit .env to set DOCUMENTS_PATH to your documents directory# Automatically detects your OS (Linux/macOS)
make up
# Process your documents
make process-all
# Check system status
make status- Web Interface: http://localhost:8003
- API Status: http://localhost:8001/status
LM Studio provides an excellent local LLM interface that can be enhanced with your document search capabilities via MCP.
- LM Studio version 0.3.17 or later
- This RAG system running (
make up)
- Open LM Studio and navigate to the Program tab
- Edit mcp.json and add the synapse server:
{
"mcpServers": {
"synapse": {
"command": "docker",
"args": [
"exec", "-i",
"synapse-mcp-server-1",
"python", "/app/server_fastmcp.py"
],
"env": {}
}
}
}- Restart LM Studio to load the MCP server
- Test the integration by asking questions about your documents
search_documents- Semantic search across all your documentsget_document_info- Get statistics about your document collectionsearch_by_source- Search within specific files
⚠️ Privacy Note: This enables Claude to access your local documents. Use with caution.
# Add the MCP server to Claude Code
claude mcp add synapse -- docker exec -i synapse-mcp-server-1 python /app/server_fastmcp.pyOnce configured, Claude Code can automatically search and reference your local documents when answering questions:
- "What did I write about database optimization?"
- "Find my notes on React performance patterns"
- "Show me documentation about the authentication system"
For direct local usage without external tools:
Access: http://localhost:8003
Features:
- Real-time streaming responses
- Automatic document search
- Stateless conversations
- Fallback for general questions
make help # Show all available commands
make up # Start all services (auto-detects OS)
make down # Stop all services
make status # Check system status
make process-all # Process all documents
make reset # Reset document collection
make logs # Show logs for all services
make clean # Remove all containers and volumes💡 Tip: Run
make helpto see OS-specific configuration being used.
DOCUMENTS_PATH: Path to your documents directoryEMBEDDING_MODEL: Ollama embedding model (default: mxbai-embed-large)CHAT_MODEL: Ollama chat model (default: llama3.1:8b)
- Markdown (.md), PDF (.pdf), Text (.txt), Word (.docx)
- ChromaDB: :8000 (Vector database)
- Processor: :8001 (Document processing & search)
- MCP Server: :8002 (Model Context Protocol)
- Chat Interface: :8003 (Web UI)
- Linux users: See LINUX.md for networking configuration
- System logs:
make logsormake logs-processor - Reset everything:
make reset && make process-all - Clean install:
make clean && make up