SuperAPI AI Directory

mnemo-mcp

Persistent memory with SQLite hybrid search (FTS5 and semantic), built-in Qwen3 embeddings and rclone sync across machines.

Open website

About this tool

mnemo-mcp is a persistent AI memory service, positioned as open, free, and unrestricted. The repository was renamed to mnemo on 2026-09-13, adopting a CLI-first approach (the mnemo command), while the PyPI package name remains mnemo-mcp, and the MCP server is retained as a secondary interface.

Purpose To provide AI clients and scripts with persistent memory capabilities across sessions, allowing AI to save preferences, decisions, and facts at appropriate times and recall them in subsequent conversations.

Main capabilities

  • Hybrid retrieval: FTS5 full-text search + vector search (sqlite-vec), fused via Reciprocal Rank Fusion (k=60), then reranked through the [models.rerank] provider unit (preconfigured with OpenRouter by default), with a local Fastretrieval Qwen3 cross-encoder as fallback, plus time decay and importance boost.
  • Typed capture: memory(action="capture") supports 6 context_types (conversation / fact / preference / skill / task / decision), embedding-based deduplication, with optional compression and importance scoring through the [models.chat] unit.
  • Knowledge graph: automatic entity extraction and relationship tracking, with top results boosted by graph proximity.
  • Importance scoring and archiving strategy: LLM scoring 0.0-1.0; soft archive when recency_factor * (1 - importance) > 1.0, with a restore operation provided.
  • Automatic archive trigger: background scan every Nth capture (default 100), no cron needed.
  • STM to LTM consolidation: LLM summarization of related memories within the same category.
  • Duplicate detection: warning before adding semantically similar memories.
  • Zero configuration: Fastretrieval has a built-in local registry that resolves Qwen3 ONNX embeddings and reranking, no API key needed; optional cloud calls go through per-task [models.<task>] provider units (OpenAI specification, preconfigured with OpenRouter by default).
  • Local-first storage: a single SQLite file under ~/.mnemo/ (WAL); backup and cross-machine migration are handled outside the service by rclone with no embedded sync.
  • Plugin trio: includes /recall-context and /memory-commit skills, plus SessionStart and optional PostToolUse hooks.
  • Proactive memory: tool descriptions and skills guide AI to save preferences, decisions, and facts at appropriate times.
  • LLM compression: per-turn compression through the [models.chat] provider unit, targeting about 3x token reduction with a fact retention rate of no less than 0.9; gracefully skipped when the unit is not configured.
  • Temporal knowledge graph: each memory carries dual time columns (valid_from / valid_to / superseded_by), entity resolution deduplication (embedding KNN, default cosine threshold 0.85), audit trail (memory_audit table with before/after state hashes), new operations (entity_search / entity_graph / history / as_of), and optional automatic extraction on capture via KG_AUTO_ENABLED. Note: this is a breaking change for clients that call memory.get and expect historical results included; they need to pass as_of for time travel; the default now filter is the current state (valid_to IS NULL).

Usage Installation matrix: the server supports only Streamable HTTP; after dehosting there is no longer a stdio transport. If auth = "token" or "multi" is configured in mnemo-config/config.toml, the token must be sent as a Bearer credential (--header "Authorization: Bearer <token>" or the client equivalent).

Two ways to run the server locally for an MCP client:

  • Development: start with uv (no-auth, loopback only). no-auth rejects non-loopback binding, so it is limited to localhost. The MCP endpoint is http://127.0.0.1:8000/mcp。可先引导配置再编辑。
  • Always-on: docker compose (token auth, port published to loopback only). docker-compose.http.yml is self-contained (builds the image, state persisted in the mnemo-data volume), published to loopback only. auth = "multi" (per-user namespaces) additionally requires mounting users.toml.

CLI consumers (no server needed): the mnemo interface operates directly on the memory database, suitable for scripts and agents; each subcommand prints a JSON envelope and accepts --db <path>.

Point MCP clients at the instance: register the HTTP endpoint (Streamable HTTP transport). Claude Code: claude mcp add --transport http mnemo http://127.0.0.1:8771/mcp;任意 MCP clients following the OpenAI spec: server URL http://127.0.0.1:8771/mcp,auth = "token", send the shared token as a Bearer credential.

Configuration: local and cloud are divided by task. In mnemo-config/config.toml, each task unit ([models.embed], rerank, chat, jev_score) is independent of the others: base_url + api_key + model, OpenAI-spec HTTP. Mix and match freely, e.g. use cloud OpenRouter for chat while embed / rerank point at a local OpenAI-spec server, or route everything through the cloud. Keys are host-visible only (not visible to end users), and can also come from the HULL_<TASK>_API_KEY environment variables.

Remote access: mnemo speaks Streamable HTTP on a single /mcp endpoint; remote access is simply an instance self-hosted on a reachable host, fronted by a TLS proxy of your choice (the server itself binds plaintext HTTP). Authentication is configured under [server] in mnemo-config/config.toml: auth = "token" (one shared Bearer token) or auth = "multi" (per-user token + namespace, via users.toml). auth = "no-auth" refuses non-loopback binds.

Publishing to the public OCI registry has stopped. Historical registry tags remain unchanged; new container deployments build from source (docker build --target http) or use docker-compose.http.yml.

The package provides two distinct console scripts:

  • mnemo: the CLI-first memory interface (the primary entry point for scripts/agents; never starts a server): capture, recall, reflect, fetch, and the standing-* series operate directly on the SQLite memory database. mnemo-pilot is the legacy alias for the same entry point.
  • mnemo-mcp: the MCP server plus one-shot operational subcommands. A bare invocation starts the HTTP server; a preceding subcommand (config-init, warmup, token-hash, token-verify) performs an action and then exits.

Security features: graceful fallback (cloud provider units degrade to local ONNX; unconfigured units never silently select a paid provider); host-only credentials (provider keys live in the host-owned config.toml or the HULL_<TASK>_API_KEY environment variable, invisible to end users); auth-gated HTTP (auth = "no-auth" rejects non-loopback binding; token / multi require credential checks); error sanitization (no credentials in error messages).

Use cases Personal or self-hosted scenarios that need to provide AI coding agents, scripts, or MCP clients with cross-session persistent memory, hybrid retrieval, and a knowledge graph; users who want local-first, zero-config startup with optional cloud enhancement.

Limitations

  • The server supports only Streamable HTTP; there is no stdio transport after de-hosting; the statement in MCP registry 2.20.0 about the stdio PyPI package (uvx mnemo-mcp) is outdated, registry versions are immutable, and it can only be corrected if the owner unpublishes it or republishes 2.20.1.
  • Public OCI image publishing has stopped; new container deployments must be built from source.
  • There is no built-in sync; cross-machine backup relies on rclone outside the service.
  • The temporal knowledge graph is a breaking change for clients that call memory.get and expect historical results.
  • License: Apache-2.0.

Full documentation is at mcp.n24q02m.com/servers/mnemo-mcp/setup/, covering installation methods for Claude Code, Codex, Gemini CLI, Cursor, Windsurf, and mcp.json, an overview of modes (stdio / local-relay / remote-relay / remote-oauth), multi-user setup (per-JWT-sub credential model), and instructions for installing with an AI agent.