Cuba Memory

v1.0.0Knowledge & Memorystable

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.

ai-memoryai-toolsanti-hallucinationepisodic-memoryexponential-decay
Share:
22
Stars
0
Downloads
0
Weekly
0/5

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

Build persistent memory for AI agents with a knowledge graph and Hebbian learning.
Store and retrieve episodic memories with contradiction detection.
LeandroPG19

Maintainer

LicenseNOASSERTION
Languagerust
Versionv1.0.0
UpdatedMay 8, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx cuba-memorys

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.0
2

Register 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-memorys
3

Configure 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=debug
4

Add 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "cuba-memorys": { "command": "npx", "args": ["-y", "cuba-memorys"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides