Memory Mcp 1file
About
π π πͺ π§ - A self-contained Memory server with single-binary architecture (embedded DB & models, no dependencies). Provides persistent semantic and graph-based memory for AI agents.
Details
- Author
- pomazanbohdan
- Downloads
- 319
- Categories
- Productivity, AI, Knowledge Base, Other
Jump to
- Embeds SurrealDB for persistent storage
- Vector search (FastEmbed) for semantic similarity
- Knowledge graph (PetGraph) for entity relationships
- Code indexing to understand a codebase
- Hybrid retrieval via Reciprocal Rank Fusion
- All models run locally on CPU, no API keys required
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Memory Mcp 1fileCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Run the Docker container or the compiled binary. No configuration keys are mentioned in the README; the server starts with builtβin vector search (FastEmbed), a knowledge graph (PetGraph), code indexing, and hybrid retrieval.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"memory mcp 1file": {
"memory": {
"command": "docker",
"args": [
"run",
"--init",
"-i",
"--rm",
"-v",
"mcp-data:/data",
"-v",
"/absolute/path/to/your/project:/project:ro",
"ghcr.io/pomazanbohdan/memory-mcp-1file:latest"
]
}
}
}
}
McpServers
{
"memory": {
"command": "docker",
"args": [
"run",
"--init",
"-i",
"--rm",
"-v",
"mcp-data:/data",
"-v",
"/absolute/path/to/your/project:/project:ro",
"ghcr.io/pomazanbohdan/memory-mcp-1file:latest"
]
}
}
π π πͺ π§ - A self-contained Memory server with single-binary architecture (embedded DB & models, no dependencies). Provides persistent semantic and graph-based memory for AI agents.
A high-performance,pure RustModel Context Protocol (MCP) server that provides persistent, semantic, and graph-based memory for AI agents.
- Claude Desktop
- Claude Code(CLI)
- Gemini CLI
- Cursor
- OpenCode
- Cline/Roo Code
- Any other MCP-compliant client.
Unlike other memory solutions that require a complex stack (Python + Vector DB + Graph DB), this project isa single, self-contained executable.
- β
No External Database(SurrealDB is embedded)
- β
No API Keys, No Cloud, No Pythonβ Everything runs100% locallyvia an embedded ONNX runtime. The embedding model is baked into the binary and runs on CPU. Nothing leaves your machine.
- β
Zero Setup(Just run one Docker container or binary)
- Vector Search(FastEmbed) for semantic similarity.
- Knowledge Graph(PetGraph) for entity relationships.
- Code Indexingwithsymbol graph(calls, extends, implements) for deep codebase understanding.
- Hybrid Retrieval(Reciprocal Rank Fusion) for best results.
graph TD User[AI Agent / IDE] subgraph "Memory MCP Server" MS[MCP Server] subgraph "Core Engines" ES[Embedding Service] GS[Graph Service] CS[Codebase Service] end MS -- "Store / Search" --> ES MS -- "Relate Entities" --> GS MS -- "Index" --> CS ES -- "Vectorize Text" --> SDB[(SurrealDB Embedded)] GS -- "Knowledge Graph" --> SDB CS -- "AST Chunks" --> SDB end User -- "MCP Protocol" --> MS
Click here for the Detailed Architecture Documentation
Memory is useless if your agent doesn't check it. To get the "Long-Term Memory" effect, you must instruct your agent to follow a strict protocol.
We provide a battle-testedMemory Protocol (AGENTS.md)that you can adapt.
The protocol implements specific flows to handleContext Window CompactionandSession Restarts:
- π Session Startup: The agentmustsearch forTASK: in_progressimmediately. This restores the full context of what was happening before the last session ended or the context was compacted.
- β³ Auto-Continue: A safety mechanism where the agent presents the found task to the user and waits (or auto-continues), ensuring it doesn't hallucinate a new task.
- π Triple Sync: UpdatesMemory,Todo List, andFilessimultaneously. If one fails (e.g., context lost), the others serve as backups.
- π§± Prefix System: All memories use prefixes (TASK:,DECISION:,RESEARCH:) so semantic search can precisely target the right type of information, reducing noise.
These workflows turn the agent from a "stateless chatbot" into a "stateful worker" that survives restarts and context clearing.
Instead of scattering instructions across IDE-specific files (like.cursorrules), establishAGENTS.mdas theSingle Source of Truth.
Instruct your agent (in its base system prompt) to:
- ReadAGENTS.mdat the start of every session.
- Follow the protocolsdefined therein.
Here is a minimal reference prompt to bootstrap this behavior:
# π§ Memory & Protocol You have access to a persistent memory server and a protocol definition file. 1. Protocol Adherence: - READ AGENTS.md immediately upon starting. - Strictly follow the "Session Startup" and "Sync" protocols defined there. 2. Context Restoration: - Run search_text("TASK: in_progress") to restore context. - Do NOT ask the user "what should I do?" if a task is already in progress.
Without this protocol, the agent loses context after compaction or session restarts. With this protocol, it maintains thefull context of the current task, ensuring no steps or details are lost, even when the chat history is cleared.
Universal Docker Configuration (Any IDE/CLI)
To use this MCP server with any client (Claude Code,OpenCode,Cline, etc.), use the following Docker command structure.
- Memory Volume:-v mcp-data:/data(Persists your graph, embeddings,and cached model weights)
- Project Volume:-v $(pwd):/project:ro(Allows the server to read and index your code)
- Init Process:--init(Ensures the server shuts down cleanly)
[!TIP]One volume persists everything: The single-v mcp-data:/datamount covers both the SurrealDB databaseandthe ~1.2 GB embedding model (stored under/data/models/). There is no need for a separate volume for/data/modelsβ it is already a subdirectory of/dataand is preserved automatically. Without a named volume, Docker creates a new anonymous volume on eachdocker run, causing the model to re-download (~1.2 GB) every time.
JSON Configuration (Claude Desktop, etc.)
Add this to your configuration file (e.g.,claude_desktop_config.json):
{ "mcpServers": { "memory": { "command": "docker", "args": [ "run", "--init", "-i", "--rm", "--memory=3g", "-v", "mcp-data:/data", "-v", "/absolute/path/to/your/project:/project:ro", "ghcr.io/pomazanbohdan/memory-mcp-1file:latest" ] } } }
Note:Replace/absolute/path/to/your/projectwith the actual path you want to index. In some environments (like Cursor or VSCode extensions), you might be able to use variables like${workspaceFolder}, but absolute paths are most reliable for Docker.
- Go toCursor Settings>Features>MCP Servers.
- Click+ Add New MCP Server.
- Type:stdio
- Name:memory
- Command:
docker run --init -i --rm --memory=3g -v mcp-data:/data -v "/Users/yourname/projects/current:/project:ro" ghcr.io/pomazanbohdan/memory-mcp-1file:latest
docker run --init -i --rm --memory=3g \ -v mcp-data:/data \ -v $(pwd):/project:ro \ ghcr.io/pomazanbohdan/memory-mcp-1file:latest
You can run the server directly vianpxorbunx. The npm package automatically downloads the correct pre-compiled binary for your platform.
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-mcp-1file"] } } }
claude mcp add memory -- npx -y memory-mcp-1file
- Go toCursor Settings>Features>MCP Servers.
- Click+ Add New MCP Server.
- Type:command
- Name:memory
- Command:npx -y memory-mcp-1file
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-mcp-1file"] } } }
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-mcp-1file"] } } }
{ "mcpServers": { "memory": { "command": "bunx", "args": ["memory-mcp-1file"] } } }
Note:Unlike Docker,npx/bunxruns the binarylocallyβ it already has access to your filesystem, so no directory mounting is needed. To customize the data storage path, pass--data-dirvia args:
"args": ["-y", "memory-mcp-1file", "--", "--data-dir", "/path/to/data"]
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-mcp-1file"] } } }
{ "mcpServers": { "memory": { "command": "docker", "args": [ "run", "--init", "-i", "--rm", "--memory=3g", "-v", "mcp-data:/data", "-v", "${workspaceFolder}:/project:ro", "ghcr.io/pomazanbohdan/memory-mcp-1file:latest" ] } } }
- Semantic Memory: Stores text with vector embeddings (qwen3by default) for "vibe-based" retrieval.
- Graph Memory: Tracks entities (User,Project,Tech) and their relations (uses,likes). Supports PageRank-based traversal.
- Code Intelligence: Indexes local project directories (AST-based chunking) for Rust, Python, TypeScript, JavaScript, Go, Java, andDart/Flutter. Trackscalls, imports, extends, implements, and mixinrelationships between symbols.
- Temporal Validity: Memories can havevalid_fromandvalid_untildates.
- SurrealDB Backend: Fast, embedded, single-file database.
The server exposes18 toolsto the AI model, organized into logical categories.
You can switch the embedding model using the--modelarg orEMBEDDING_MODELenv var.
π Matryoshka Representation Learning (MRL)
Models marked with(MRL)support dynamically truncating the output embedding vector to a smaller dimension (e.g., 512, 256, 128) with minimal loss of accuracy. This saves database storage and speeds up vector search.
Use the--mrl-dimargument to specify the desired size. If omitted, the default is the model's native base dimension (e.g., 1024 for Qwen3).
Warning:Once your database is created with a specific dimension, you cannot change it without wiping the data directory.
π Gated Models & Authentication (Gemma)
By default, the server usese5_multi, which is fully open-source and downloads automatically without any authentication.
However, if you choose to useGemma(--model gemma), you must authenticate because it is a "Gated Model" with a proprietary license.
- Go togoogle/embeddinggemma-300mon Hugging Face.
- Log in and click"Agree to access repository".
- Generate an Access Token atHF Tokens(Read access is enough).
- Start the server with the token:
# Using environment variable HF_TOKEN="hf_your_token_here" memory-mcp --model gemma # Or via .env file (see .env.example)
[!WARNING]Changing Models & Data Compatibility
If you switch to a model with different dimensions (e.g., frome5_smalltoe5_multi),your existing database will be incompatible. You must delete the data directory (volume) and re-index your data.
Switching between models with the same dimensions (e.g.,e5_multi<->nomic) is theoretically possible but not recommended as semantic spaces differ.
Based on analysis of advanced memory systems likeHindsight(see their documentation for details on these mechanisms), we are exploring these "Cognitive Architecture" features for future releases:
1. Meta-Cognitive Reflection (Consolidation)
- Problem:Raw memories accumulate noise over time (e.g., 10 separate memories about fixing the same bug).
- Solution:Implement areflectbackground process (or tool) that periodicallly scans recent memories to:
- De-duplicateredundant entries.
- Resolve conflicts(if two memories contradict, keep the newer one or flag for review).
- Synthesizelow-level facts into high-level "Insights" (e.g., "User prefers Rust over Python" derived from 5 code choices).
2. Temporal Decay & "Presence"
- Problem:Old memories can sometimes drown out current context in semantic search.
- Solution:IntegrateTime Decayinto the Reciprocal Rank Fusion (RRF) algorithm.
- Give a calculated boost to recent memories for queries implying "current state".
- Allow the agent to prioritize "working memory" over "historical archives" dynamically.
- Problem:Running one docker container per project is resource-heavy.
- Solution:Add support fornamespaceorproject_idscoping.
- Allows a single server instance to host isolated "Memory Banks" for different projects or agent personas.
- Enables "Switching Context" without restarting the container.
- Problem:The agent treats a guess the same as a verified fact.
- Solution:Add aconfidencescore (0.0 - 1.0) to memory schemas.
- Allows storing hypotheses ("I think the bug is in auth.rs", confidence: 0.3).
- Retrieval tools can filter out low-confidence memories when answering factual questions.
Adaptive MCP memory system for AI applications. Learns which retrieval strategies work for your data, scores results using cognitive science models, builds a knowledge graph automatically, and validates every parameter change against real query history before adopting it. Patent pending.
Self-hosted Rust-based MCP server for AI agent memory β persistent, queryable memory with hybrid search, knowledge graphs, built-in embeddings, and 14 core tools (expandable to 86+ with profile-based tiering).
Self-improving MCP memory server for AI agents. One command, no cloud, no config. Hybrid search, feedback loop quality system, dashboard UI, auto-linking knowledge graph. Gets better the more you use it.
Persistent memory for AI agents using a semantic knowledge graph. Store, retrieve, and connect memories with semantic search β so your AI remembers context across sessions.
Smriti is a Model Context Protocol (MCP) server that provides persistent, graph-based memory for LLM applications. Built on LadybugDB (embedded property graph database), it uses EcphoryRAG-inspired multi-stage retrieval - combining cue extraction, graph traversal, vector similarity, and multi-hop association - to deliver human-like memory recall.
Persistent memory for AI agents. Single SQLite file, 192 MCP tools. FTS5 search, knowledge graph, session handoffs, write gate. No server, no API keys, no LLM calls.
MCP-native memory layer for Claude Code, Cursor, Cline, Continue, and 16 other AI tools. Hybrid search (BM25 + pgvector + graph), self-hosted on Supabase + Vercel, 100% MIT, no paywall.
Persistent cognitive memory for Claude Code. Cloud-based semantic search, Ai-powered extraction, project scoping, and compaction recovery.
Highly efficient context management for agentic AI: MCP code search, evidence packs, graph context, and memory for large projects.
Persistent memory layer for AI agents with semantic search, consolidation, and cross-session intelligence via MCP.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



