Synapse Memory
A lightweight MCP server that provides long-term memory for LLMs by storing and retrieving important facts, decisions, and preferences through smart semantic search and automatic organization.
README
Synapse: Long-term Memory for LLMs
Synapse is a lightweight memory engine designed to give agents and LLMs a permanent "brain." It solves the "goldfish memory" problem by storing important facts, decisions, and preferences in an organized way, retrieving only what is relevant to the current conversation.
Instead of stuffing your entire chat history into a prompt, Synapse uses a smart search system to find exactly what matters. This keeps your context window clean and your token costs low.
How it works
Synapse is designed to be flexible and works in two main ways:
- Plug-and-play (MCP): Connect it to any AI tool that supports the Model Context Protocol (such as Claude Desktop, Cursor, Zed, and others). It works instantly as a set of tools the AI can use to remember things about your projects and preferences.
- As a Core Engine: If you are building your own AI application, you can import Synapse directly into your Python project. It handles memory management, semantic search, and versioning without the need for complex vector database setups.
Main Features
- Smart Retrieval: It doesn't just look for keywords. It combines relevance (BM25) with recency, meaning it prioritizes what you decided today over information from months ago.
- Automatic Organization: It manages hierarchical categories and automatically fragments long pieces of information to fit within LLM context limits.
- Fast and Reliable: Built on SQLite with an in-memory index, it retrieves memories in less than 500ms.
- Zero Dependencies: Written in pure Python 3 to be lightweight, easy to audit, and simple to integrate.
Getting Started
Prerequisites
- Python 3.10+
1. Installation
# Clone the repository
git clone https://github.com/your-username/synapse.git
cd synapse
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies (only required for the MCP server)
pip install -r requirements.txt
2. Standalone CLI Usage
You can manage your memory manually via the terminal:
# Initialize the database
python3 -m synapse init
# Add a memory
python3 -m synapse add --path "project/stack" --title "Database" --content "Using SQLite and RAM Index."
# Search
python3 -m synapse search --prompt "what database are we using?"
3. MCP Server Configuration
To use Synapse with tools like Claude Desktop or Cursor, add it to your configuration file:
Example (claude_desktop_config.json):
{
"mcpServers": {
"synapse_memory": {
"command": "/absolute/path/to/venv/bin/python",
"args": ["-m", "synapse.mcp_server"],
"env": {
"PYTHONPATH": "/absolute/path/to/synapse_directory"
}
}
}
}
Maintenance
Keep your memory engine healthy with built-in maintenance tools:
# Run Garbage Collector (clean up obsolete data)
python3 -m synapse gc
# Database and Index optimization
python3 -m synapse optimize
Testing
python3 -m unittest discover -s tests -p 'test_*.py'
License
MIT. See LICENSE for details.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.