Cuba Memory
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 Memory?
Cuba Memory 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
Manual Installation
npx cuba-memorysConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Cuba Memory
Cuba Memory is a high-performance Rust-based persistent memory MCP server that gives AI agents a durable knowledge graph backed by PostgreSQL. It exposes 25 MCP tools covering entity storage, episodic memory, hybrid vector+full-text search, contradiction detection, Bayesian confidence calibration, and GDPR-compliant erasure. The server uses Hebbian learning with exponential decay to prioritize frequently-accessed memories, and it ships with zero-config Docker provisioning of PostgreSQL — making it the most feature-complete open-source memory layer available for Claude and other MCP clients.
Prerequisites
- Docker (for automatic zero-config PostgreSQL provisioning) or an existing PostgreSQL 14+ instance
- Node.js (for the npm install method) or Python 3.11+ with pip (for the PyPI method)
- An MCP-compatible client such as Claude Desktop
- Optional: an Anthropic API key if you want the 'claude_cli' contradiction judge backend
Install cuba-memorys
Install via npm (recommended for zero-config setup) or pip. The npm package includes the precompiled Rust binary.
# Via npm (recommended — zero-config Docker PostgreSQL)
npm install -g cuba-memorys
# Via PyPI
pip install cuba-memorys==1.12.0Register with your MCP client
Add cuba-memorys to Claude Desktop using the 'claude mcp add' command. PostgreSQL is auto-provisioned via Docker on first run if DATABASE_URL is not set.
claude mcp add cuba-memorys -- cuba-memorysConfigure optional environment variables
For a custom PostgreSQL instance or advanced features, set environment variables in your MCP config. All variables are optional — the server works with zero config.
# Optional variables:
# DATABASE_URL=postgresql://user:pass@localhost:5432/cuba
# ONNX_MODEL_PATH=/path/to/multilingual-e5-small.onnx
# CUBA_JUDGE=anthropic_api
# CUBA_BITEMPORAL=true
# RUST_LOG=cuba_memorys=debugAdd to claude_desktop_config.json
For manual configuration, add the server entry directly to your Claude Desktop config file.
{
"mcpServers": {
"cuba-memorys": {
"command": "cuba-memorys",
"env": {
"DATABASE_URL": "postgresql://localhost:5432/cuba"
}
}
}
}Restart Claude Desktop and verify
Restart Claude Desktop and ask it to store a memory using 'cuba_alma'. The first run may take a moment as Docker provisions the PostgreSQL container.
Cuba Memory Examples
Client configuration
claude_desktop_config.json using the globally installed binary with auto-provisioned PostgreSQL.
{
"mcpServers": {
"cuba-memorys": {
"command": "cuba-memorys"
}
}
}Prompts to try
Example prompts that exercise the knowledge graph, search, and anti-hallucination tools.
- "Remember that our FastAPI project uses async def for all endpoints and PostgreSQL as the database."
- "What do you remember about our project's technology stack? Search your memory first before answering."
- "Check if there are any contradictions in what you know about our deployment process."
- "Scan for knowledge gaps in the entities you have stored about our codebase."
- "Store the architecture decision to use Redis for session caching with the rationale that it reduces DB load."Troubleshooting Cuba Memory
Server fails to start because Docker is not running
Start Docker Desktop before launching Claude Desktop, or set DATABASE_URL to point to an existing PostgreSQL instance to bypass Docker auto-provisioning.
Vector search returns empty results despite stored memories
The ONNX embedding model (~113MB) may not be downloaded yet. Set ONNX_MODEL_PATH to the path of the multilingual-e5-small ONNX model, or allow the server to download it on first use with a stable internet connection.
Contradiction detection is not working
Check the CUBA_JUDGE variable. The default is 'heuristic' (no API key needed). For higher-quality detection set it to 'anthropic_api' and ensure ANTHROPIC_API_KEY is set in the environment.
Frequently Asked Questions about Cuba Memory
What is Cuba Memory?
Cuba Memory 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 Memory?
Follow the installation instructions on the Cuba Memory GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Cuba Memory?
Cuba Memory works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Cuba Memory free to use?
Yes, Cuba Memory is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.
Cuba Memory Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Cuba Memory? 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 Memory 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 Memory?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.