Cuba Memroys
Persistent memory MCP server for AI agents — Rust, 19 tools, knowledge graph, Hebbian learning, episodic memory, contradiction detection, prospective triggers, Bayesian calibration, zero-config Docker setup.
What is Cuba Memroys?
Cuba Memroys is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent memory mcp server for ai agents — rust, 19 tools, knowledge graph, hebbian learning, episodic memory, contradiction detection, prospective triggers, bayesian calibration, zero-config docker...
Persistent memory MCP server for AI agents — Rust, 19 tools, knowledge graph, Hebbian learning, episodic memory, contradiction detection, prospective triggers, Bayesian calibration, zero-config Docker setup.
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Persistent memory MCP server for AI agents — Rust, 19 tools,
Use Cases
Maintainer
Works with
Installation
NPM
npx -y cuba-memorysPIP
pip install cuba-memorysManual Installation
npx -y cuba-memorysConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Cuba Memroys
Cuba Memorys (npm: cuba-memorys) is a production-grade persistent memory MCP server written in Rust that gives AI agents a knowledge graph backed by PostgreSQL with 25 specialised tools covering entity and relation management, semantic search with RRF fusion, episodic memory, error pattern detection, Hebbian learning with exponential decay, Bayesian confidence calibration, contradiction scanning, and GDPR-compliant erasure. It is designed for long-running coding agents that need to accumulate knowledge across sessions, detect when they are about to repeat a past mistake, and reason about their own uncertainty without hallucinating.
Prerequisites
- PostgreSQL 18 with the pgvector extension installed and running
- The cuba-memorys binary: install via pip (pip install cuba-memorys==1.12.0) or npm (npm install -g [email protected])
- Optional: ONNX Runtime and a multilingual e5-small model for embedding-based semantic search
- An MCP-compatible client such as Claude Code, Cursor, Windsurf, or VS Code with an MCP plugin
- DATABASE_URL environment variable pointing to your PostgreSQL instance
Install cuba-memorys
Install the binary via pip or npm. Both install the same Rust binary; choose whichever package manager is already in your workflow.
# Via pip
pip install cuba-memorys==1.12.0
# Via npm
npm install -g [email protected]Start PostgreSQL and set DATABASE_URL
Cuba Memorys requires a PostgreSQL 18 instance. Set DATABASE_URL so the server can connect. If you do not set it, the server will attempt to auto-provision a local database.
export DATABASE_URL=postgresql://user:password@localhost:5432/cuba_memorysRegister with Claude Code
Add the server to Claude Code in one command. Claude Code will invoke the cuba-memorys binary as an MCP server on each session.
claude mcp add cuba-memorys -- cuba-memorysAdd to Claude Desktop or other MCP clients
For Claude Desktop, Cursor, Windsurf, or VS Code, add the mcpServers entry to your config file.
{
"mcpServers": {
"cuba-memorys": {
"command": "cuba-memorys",
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/cuba_memorys",
"RUST_LOG": "cuba_memorys=info"
}
}
}
}Optional: configure ONNX embeddings
For full semantic search quality, provide the ONNX model paths. Without these, the server falls back to keyword-based search.
export ONNX_MODEL_PATH=/path/to/multilingual-e5-small
export ORT_DYLIB_PATH=/path/to/libonnxruntime.so
export CUBA_RERANKER_PATH=/path/to/bge-reranker-v2-m3Cuba Memroys Examples
Client configuration
Complete MCP config entry for cuba-memorys with PostgreSQL and Rust logging configured.
{
"mcpServers": {
"cuba-memorys": {
"command": "cuba-memorys",
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/cuba_memorys",
"RUST_LOG": "cuba_memorys=info",
"CUBA_BITEMPORAL": "on"
}
}
}
}Prompts to try
Example agent prompts that use the 25 cuba-memorys tools to build and query persistent knowledge.
- "Store that FastAPI requires async def functions with response_model for type safety"
- "Search memory for anything related to database migrations and summarise what you know"
- "I got an IntegrityError on duplicate numero_parte — log this error and check if it has happened before"
- "Are there any contradictions in what I've told you about the authentication system?"
- "Run memory maintenance to decay old entries and consolidate episodes"
- "Export all memory for the current project to a git-friendly JSON format"Troubleshooting Cuba Memroys
Server fails to start with 'could not connect to server: Connection refused'
PostgreSQL must be running before cuba-memorys starts. Confirm with 'pg_isready -h localhost -p 5432'. Check that DATABASE_URL uses the correct host, port, username, and password, and that the target database exists.
Semantic search returns only exact keyword matches, not conceptually similar results
Full semantic search requires the ONNX Runtime and an e5-small model. Set ONNX_MODEL_PATH to the directory containing the model files and ORT_DYLIB_PATH to the libonnxruntime shared library. Without these, the server uses keyword-only FTS5 search.
cuba_faro returns results from other projects when CUBA_PROJECT_FILTER is not set
By default, cuba-memorys scopes queries to the current project. If you are seeing cross-project results, ensure CUBA_PROJECT_FILTER is not set to 'off', or explicitly pass the project name when calling cuba_proyecto to switch to the correct project context.
Frequently Asked Questions about Cuba Memroys
What is Cuba Memroys?
Cuba Memroys is a Model Context Protocol (MCP) server that persistent memory mcp server for ai agents — rust, 19 tools, knowledge graph, hebbian learning, episodic memory, contradiction detection, prospective triggers, bayesian calibration, zero-config docker setup. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Cuba Memroys?
Install via npm with the command: npx -y cuba-memorys. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Cuba Memroys?
Cuba Memroys works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Cuba Memroys free to use?
Yes, Cuba Memroys is open source and available under the Creative Commons Attribution Non Commercial 4.0 International license. You can use it freely in both personal and commercial projects.
Cuba Memroys Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Cuba Memroys? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Cuba Memroys in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Cuba Memroys?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.