Skip to main content

hippmem-mcp

MCP server for HIPPMEM — give AI tools long-term associative memory.

CI PyPI Python License

Ecosystem: Rust engine · Python bindings · MCP server


What is HIPPMEM?

HIPPMEM is a native associative memory engine for AI agents, written in Rust. Instead of storing text chunks and searching them by vector similarity, it discovers associations between memories at write time and retrieves them via spreading activation at read time — so the AI recalls not just what was said, but how things connect and why.

It runs fully offline with a deterministic fallback backend.

What is hippmem-mcp?

hippmem-mcp wraps HIPPMEM as a Model Context Protocol server. Configure it once in Claude Desktop (or any MCP-compatible tool), and your AI assistant gains persistent, associative memory across sessions — no API key required.

AI Tool (Claude Desktop / VS Code / ...)
        │  MCP protocol (stdio)
        ▼
  hippmem-mcp
        │  Python bindings
        ▼
  hippmem Engine (Rust)
        │
        ▼
  Local storage (redb + Tantivy + HNSW)

Key Features

  • Zero configpip install then one JSON block in your MCP client configuration; deterministic fallback backend works offline
  • Write-time association discovery — entities, topics, goals, causal links extracted and scored automatically
  • Spreading activation retrieval — multi-channel seed recall (BM25 + entity + semantic + temporal + topic) fused by RRF
  • Graph evolution — co-activated connections strengthen (Hebbian learning); stale edges decay
  • Explanation traces — every result shows why it was recalled via dimensions and matched_dimensions
  • Single-file storage — one redb file + Tantivy full-text index + HNSW vector index; no external database

Install

pip install hippmem-mcp

Requires Python ≥ 3.11.

Configure

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "hippmem": {
      "command": "python",
      "args": ["-m", "hippmem_mcp.server"]
    }
  }
}

Or use the entry point:

{
  "mcpServers": {
    "hippmem": {
      "command": "hippmem-mcp"
    }
  }
}

Environment Variables

The server reads these variables from the environment that launches it — the env block in your MCP client config (e.g. Claude Desktop) or your shell, not from a .env file (none is auto-loaded). .env.example is a reference template for that environment.

Variable Default Description
HIPPMEM_STORE_PATH (engine default: ./hippmem_data relative to the server's working directory) Fixed memory store path. Set for a shared global memory across projects. Unset gives one store per working directory — per-project for Claude Code (which launches the server from the project dir), global for clients that don't.
HIPPMEM_EMBEDDER_PROVIDER hash Embedder: hash (offline, default) or neural (API-based, higher accuracy). Any other value fails fast at startup.
HIPPMEM_EMBEDDING_BASE_URL (none — required when neural) OpenAI-compatible API endpoint, e.g. https://api.openai.com/v1
HIPPMEM_EMBEDDING_MODEL (none — required when neural) Model name, e.g. text-embedding-3-small
OPENAI_API_KEY (none) API key — required when HIPPMEM_EMBEDDER_PROVIDER=neural

With HIPPMEM_EMBEDDER_PROVIDER=neural, all three API variables above are required — startup fails naming the missing ones. The deterministic fallback backend requires no API key, no GPU, and no network connection.

Claude Code

Claude Code supports MCP natively. Add to your Claude Code MCP config (.claude/mcp.json or project .mcp.json):

{
  "mcpServers": {
    "hippmem": {
      "command": "hippmem-mcp"
    }
  }
}

Then in any Claude Code session, retrieval is query-driven — trigger it when a task signal appears (a past decision, a user preference, an unknown constraint), not by bulk-loading at session start:

Before answering, use retrieve_memories to check whether we have relevant
memory about this topic. Query with the specific question, not the whole task.

See Best Practices for the full retrieval/feedback loop.

Other MCP Clients

hippmem-mcp speaks standard MCP over stdio. Configure any MCP-compatible client the same way — point the command to hippmem-mcp or python -m hippmem_mcp.server.

Tools

Tool Description
write_memory Write a memory. The engine automatically discovers associations with existing memories. Supports content_type (Decision, Preference, ProjectKnowledge, TaskState, Correction, Event, Reflection) and importance (0.0–1.0).
retrieve_memories Cross-session associative recall via multi-channel seed retrieval + spreading activation. Returns {retrieval_id, results} — each result is scored and explains why it was recalled via dimensions. Supports top_k (default 3) and max_hops.
feedback_memory Send usage feedback for a previous retrieval (retrieval_id from retrieve_memories): referenced, user_confirmed_correct, task_succeeded, or user_rejected. Strengthens what was used, weakens what was rejected — this is the loop that makes retrieval more accurate over time.

Development

git clone https://github.com/hippmem/hippmem-mcp.git
cd hippmem-mcp
pip install -e ".[dev]"
pytest

See CONTRIBUTING.md for commit conventions, PR workflow, and DCO requirements.

Documentation

License

Apache 2.0. See LICENSE and COPYRIGHT.

The underlying HIPPMEM engine (hippmem) is AGPL-3.0-only. A commercial license is available — contact hippmem@gmail.com.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hippmem_mcp-0.4.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hippmem_mcp-0.4.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file hippmem_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: hippmem_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hippmem_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c79a064c7cc61954d01f30500e82b6d8c2bd81c37441d2b988583f43cf97257c
MD5 c01460b06612ecf56220594e87f64140
BLAKE2b-256 292683dafc2b22628a0a8ff99eac6d9b80a03141b1dd3f2146c9ae12d52331de

See more details on using hashes here.

File details

Details for the file hippmem_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: hippmem_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hippmem_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe25026db0dc46a5c56775a2301a779cafc4344325b4a0b9c6e69f51a88fa6f1
MD5 d9c4c4029ce005d72f3f8e44a076132c
BLAKE2b-256 0ba27162ce0d7bcb9904e5a2d34ac27f06136a83507b7a4771ee79fd3c65d65b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page