Mnemosyne MCP
Uses Neo4j as the knowledge graph database, providing storage, retrieval, and semantic search of entities and relations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mnemosyne MCP search my knowledge graph for references to machine learning"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mnemosyne MCP
Knowledge graph memory for AI agents with local semantic search. Zero API costs.
Named after Mnemosyne, the Greek goddess of memory and mother of the Muses.
Overview
Mnemosyne provides persistent memory for AI agents using Neo4j knowledge graphs and local vector embeddings. Unlike traditional solutions requiring paid API access, Mnemosyne runs embeddings locally via ONNX Runtime.
Key Features:
Local semantic search with BGE embeddings
No API keys or external dependencies
Works offline after initial setup
Compatible with Model Context Protocol (MCP)
Drop-in replacement for cloud-based solutions
Related MCP server: Memory Palace
Performance Comparison
Metric | Cloud Services | Mnemosyne |
Cost | ~$0.02/1M tokens | Free |
API Key | Required | None |
Network | Always required | Initial download only |
Privacy | External | Local |
Latency | ~100ms | ~200-500ms |
Installation
Prerequisites
Node.js >= 20.0.0
Neo4j Database (Download)
Quick Start (NPM)
npx @zhadyz/mnemosyne-mcpFrom Source
git clone https://github.com/zhadyz/mnemosyne-mcp.git
cd mnemosyne-mcp
npm install
npm run buildNeo4j Setup
Install Neo4j Desktop
Create a database instance
Set credentials (default password:
neo4j)Start the database (default port: 7687)
Environment Configuration
Create .env in project root:
EMBEDDING_PROVIDER=local
LOCAL_EMBEDDING_MODEL=Xenova/bge-base-en-v1.5
NEO4J_URI=bolt://127.0.0.1:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=neo4j
# NEO4J_DATABASE - Automatically set by router based on project configMulti-Project Database Routing
Mnemosyne includes built-in dynamic database routing that automatically selects the correct Neo4j database based on your current project.
Why Use Multi-Database Architecture?
Performance at Scale:
Query 10⁴ entities instead of 10⁵+ in monolithic architecture
O(log n) query complexity through database partitioning
Linear project addition without performance degradation
Project Isolation:
Namespace separation prevents cross-contamination of knowledge graphs
Each project gets its own isolated database
Global patterns database for cross-project learnings
Setup
1. Create project databases in Neo4j:
CREATE DATABASE my_project_db IF NOT EXISTS;
CREATE DATABASE another_project_db IF NOT EXISTS;2. Add .mnemosyne file to each project root:
# Project-specific database name (required)
MNEMOSYNE_DATABASE=my_project_db
# Optional metadata
PROJECT_NAME=My Project
RETENTION_DAYS=90
AUTO_CLEANUP=true
ISOLATION_LEVEL=project3. Router automatically detects database:
Your Projects:
├─ project-alpha/
│ └─ .mnemosyne → MNEMOSYNE_DATABASE=alpha_db
│ Routes to "alpha_db" database ✓
│
├─ project-beta/
│ └─ .mnemosyne → MNEMOSYNE_DATABASE=beta_db
│ Routes to "beta_db" database ✓
│
└─ unconfigured-project/
No .mnemosyne → Routes to "neo4j" (global patterns) ✓The router walks up the directory tree from your current working directory, finds .mnemosyne or .env, and routes to the specified database. If no config is found, it defaults to neo4j (global patterns database).
Template: Copy the included template to your project:
cp node_modules/@zhadyz/mnemosyne-mcp/.mnemosyne.template .mnemosyne
# Edit MNEMOSYNE_DATABASE to your database nameClaude Integration
Claude Code (Recommended)
Add Mnemosyne to Claude Code with a single command:
claude mcp add --scope user mnemosyne -- npx -y @zhadyz/mnemosyne-mcpVerify it's installed:
claude mcp listYou should see mnemosyne: npx -y @zhadyz/mnemosyne-mcp - ✓ Connected
Default Configuration:
Neo4j URI:
bolt://localhost:7687Username/Password:
neo4j/neo4jDatabase: Automatic (via router -
neo4jif no.mnemosynefile found)Embeddings: Local (BGE base-en-v1.5, 768 dimensions)
Custom Neo4j Setup:
If you use different credentials, edit ~/.claude.json and add environment variables:
claude mcp add --scope user mnemosyne \
-e NEO4J_PASSWORD=your_password \
-- npx -y @zhadyz/mnemosyne-mcpDual MCP Instance Setup (Project + Global Memory)
For advanced workflows, run two separate Mnemosyne instances - one for project-specific knowledge and one for cross-project patterns.
Architecture:
Project Instance: Uses automatic routing (finds
.mnemosynein your project)Global Instance: Always routes to
neo4jdatabase (forced override)
Setup:
# Project-specific knowledge (automatic routing)
claude mcp add --scope user mnemosyne-project -- npx -y @zhadyz/mnemosyne-mcp
# Global cross-project patterns (forced to neo4j database)
claude mcp add --scope user mnemosyne-global \
-e MNEMOSYNE_FORCE_DATABASE=neo4j \
-- npx -y @zhadyz/mnemosyne-mcpAgent Usage:
Tools appear with prefixes in Claude:
mcp__mnemosyne-project__create_entities→ stores in project databasemcp__mnemosyne-global__create_entities→ stores in globalneo4jdatabase
Decision Heuristic for Agents:
Store in project database when knowledge is:
Project-specific code: classes, functions, APIs, models
Project context: dependencies, architecture decisions, local conventions
Temporary learnings: current sprint patterns, debugging insights
Store in global database when knowledge is:
Reusable patterns: error handling strategies, design patterns
Framework best practices: Next.js optimization, React patterns
Security patterns: authentication flows, input validation
Meta-learnings: what works across multiple projects
Default Rule: When uncertain, store in project database. Manually promote proven patterns to global database after validation.
Claude Desktop
Basic Setup:
Add to claude_desktop_config.json:
{
"mcpServers": {
"mnemosyne": {
"command": "npx",
"args": ["-y", "@zhadyz/mnemosyne-mcp"],
"env": {
"NEO4J_URI": "bolt://127.0.0.1:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "neo4j",
"EMBEDDING_PROVIDER": "local",
"LOCAL_EMBEDDING_MODEL": "Xenova/bge-base-en-v1.5"
}
}
}
}Dual Instance Setup (Project + Global):
{
"mcpServers": {
"mnemosyne-project": {
"command": "npx",
"args": ["-y", "@zhadyz/mnemosyne-mcp"],
"env": {
"NEO4J_URI": "bolt://127.0.0.1:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "neo4j",
"EMBEDDING_PROVIDER": "local",
"LOCAL_EMBEDDING_MODEL": "Xenova/bge-base-en-v1.5"
}
},
"mnemosyne-global": {
"command": "npx",
"args": ["-y", "@zhadyz/mnemosyne-mcp"],
"env": {
"NEO4J_URI": "bolt://127.0.0.1:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "neo4j",
"EMBEDDING_PROVIDER": "local",
"LOCAL_EMBEDDING_MODEL": "Xenova/bge-base-en-v1.5",
"MNEMOSYNE_FORCE_DATABASE": "neo4j"
}
}
}
}Local Development
{
"mcpServers": {
"mnemosyne": {
"command": "node",
"args": ["/absolute/path/to/mnemosyne-mcp/dist/router.js"],
"env": {
"NEO4J_URI": "bolt://127.0.0.1:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "neo4j",
"EMBEDDING_PROVIDER": "local",
"LOCAL_EMBEDDING_MODEL": "Xenova/bge-base-en-v1.5"
}
}
}
}Embedding Models
Mnemosyne supports multiple BGE models:
Model | Dimensions | Size | Use Case |
bge-base-en-v1.5 | 768 | 90MB | Balanced (default) |
bge-small-en-v1.5 | 384 | 30MB | Resource-constrained |
bge-large-en-v1.5 | 1024 | 200MB | Maximum accuracy |
bge-m3 | 1024 | 200MB | Multilingual |
Models download automatically on first use and cache to ~/.cache/huggingface/.
Usage
Create Entities
{
"name": "create_entities",
"arguments": {
"entities": [{
"name": "TypeScript",
"entityType": "programming_language",
"observations": [
"Strongly typed superset of JavaScript",
"Compiles to JavaScript",
"Static type checking"
]
}]
}
}Semantic Search
{
"name": "semantic_search",
"arguments": {
"query": "type-safe languages for web development",
"limit": 5
}
}Create Relations
{
"name": "create_relations",
"arguments": {
"relations": [{
"from": "TypeScript",
"to": "JavaScript",
"relationType": "compiles_to"
}]
}
}Architecture
EmbeddingServiceFactory
├── DefaultEmbeddingService (testing)
├── OpenAIEmbeddingService (cloud)
└── LocalEmbeddingService (ONNX)All services implement IEmbeddingService, enabling seamless provider swapping.
Local Embeddings Stack
ONNX Runtime: Optimized ML inference
Transformers.js: JavaScript ML library
BGE Models: BAAI general embeddings
L2 Normalization: Vector similarity search
Development
npm test # Run tests
npm run test:watch # Watch mode
npm run build # Build
npm run dev # Development mode
npm run fix # Lint and formatConfiguration
Variable | Options | Description |
|
| Provider selection |
| BGE model name | Local model choice |
|
| Database connection |
| string | Database user |
| string | Database password |
| string | Database name |
Provider Selection:
auto: OpenAI if API key present, otherwise locallocal: Always use local embeddingsopenai: Always use OpenAI (requires API key)
Credits
Forked from memento-mcp by Gannon Hall.
Additions:
Local ONNX embedding support
BGE model integration
Auto-fallback configuration
Zero-dependency operation
License
MIT License - see LICENSE file.
Contributing
Pull requests welcome.
Built by zhadyz Powered by ONNX Runtime + Transformers.js + BGE Embeddings
Available Tools
17 toolsadd_observationsB
Add new observations to existing entities in your Memento MCP knowledge graph memory
Inputs: observations (required), metadata, strength, confidence.
create_entitiesB
Create multiple new entities in your Memento MCP knowledge graph memory system
Inputs: entities (required).
create_relationsB
Create multiple new relations between entities in your Memento MCP knowledge graph memory. Relations should be in active voice
Inputs: relations (required).
delete_entitiesA
Delete multiple entities and their associated relations from your Memento MCP knowledge graph memory
Inputs: entityNames (required).
delete_observationsB
Delete specific observations from entities in your Memento MCP knowledge graph memory
Inputs: deletions (required).
delete_relationsB
Delete multiple relations from your Memento MCP knowledge graph memory
Inputs: relations (required).
get_decayed_graphA
Get your Memento MCP knowledge graph memory with confidence values decayed based on time
Inputs: decay_factor, reference_time.
get_entity_embeddingA
Get the vector embedding for a specific entity from your Memento MCP knowledge graph memory
Inputs: entity_name (required).
get_entity_historyA
Get the version history of an entity from your Memento MCP knowledge graph memory
Inputs: entityName (required).
get_graph_at_timeA
Get your Memento MCP knowledge graph memory as it existed at a specific point in time
Inputs: timestamp (required).
get_relationB
Get a specific relation with its enhanced properties from your Memento MCP knowledge graph memory
Inputs: to (required), from (required), relationType (required).
get_relation_historyB
Get the version history of a relation from your Memento MCP knowledge graph memory
Inputs: to (required), from (required), relationType (required).
open_nodesB
Open specific nodes in your Memento MCP knowledge graph memory by their names
Inputs: names (required).
read_graphA
Read the entire Memento MCP knowledge graph memory system
Inputs: random_string.
search_nodesB
Search for nodes in your Memento MCP knowledge graph memory based on a query
Inputs: query (required).
semantic_searchB
Search for entities semantically using vector embeddings and similarity in your Memento MCP knowledge graph memory
Inputs: query (required), limit, entity_types, hybrid_search, +2 more.
update_relationB
Update an existing relation with enhanced properties in your Memento MCP knowledge graph memory
Inputs: relation (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have clear distinct purposes, but search_nodes, semantic_search, and open_nodes all relate to finding nodes with subtle differences; similarly, read_graph, get_graph_at_time, and get_decayed_graph are distinct temporal/decay views but could be confused by an agent.
The naming is largely consistent with verb_noun snake_case (e.g., create_entities, delete_relations, add_observations). Minor deviations include 'read_graph' vs 'get_graph_at_time' and 'search_nodes' vs 'semantic_search', which break the pattern slightly but remain readable.
17 tools is slightly above the typical 3-15 sweet spot, but the knowledge graph domain with history, embeddings, and temporal views justifies the additional tools. It feels a bit heavy but not excessive.
The surface covers creation, deletion, and relation management well, but there are notable gaps: no update_entities or update_observations, and no explicit single-entity getter (open_nodes is name-based rather than ID-based). These gaps force agents to work around the incomplete CRUD lifecycle.
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Shared long-term memory for AI agents: save and recall context as a searchable knowledge graph.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to store, retrieve, and connect information in a Neo4j graph database as persistent memory, with semantic relationships, natural language search, and temporal tracking across conversations.9438 npm67MIT
- AlicenseNot gradedqualityDmaintenancePersistent semantic memory for AI agents, enabling storage, semantic search, knowledge graph connections, and inter-instance messaging across conversations using local models via Ollama.50MIT
- AlicenseAqualityDmaintenanceProvides AI agents with persistent, searchable memory using semantic search, auto-linking, and categorization, with zero-config local setup or production-ready external providers.711 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides persistent knowledge graph memory for AI agents, enabling them to store, recall, and query facts about people, projects, and relationships across sessions.MIT