AgentStack
MCP unreviewed MIT Self-run

Mnema

mcp-mienetic-mnema ยท by mienetic

๐Ÿง  Mnema โ€” Long-term memory for AI via MCP ร— Vector DB. Solves the context-window problem with pluggable vector backends (Chroma/Qdrant/sqlite-vec), hybrid search, decay scoring, and summarization.

โ€” No reviews yet
0 installs
3 views
0.0% viewโ†’install

Install

$ agentstack add mcp-mienetic-mnema

Open-source listing โ€” not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

โš  Flagged

1 finding(s); flagged for manual review. ยท v0.1.0 How review works โ†’

  • โ€ข Prompt-injection patterns
  • โ€ข Secret / credential exfiltration
  • โ€ข Dangerous shell & filesystem operations
  • โ€ข Untrusted network calls
  • โ€ข Known-malicious package signatures
  • high Pipes remote content directly into a shell (remote code execution).

What it can access

  • โ— Network access Used
  • โœ“ Filesystem access No
  • โœ“ Shell / process execution No
  • โ— Environment & secrets Used
  • โœ“ Dynamic code execution No

From automated source analysis of v0.1.0. โ€œUsedโ€ means the capability is present in the source โ€” more access means more to trust, not that itโ€™s unsafe.

Are you the author of Mnema? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

๐Ÿง  Mnema โ€” Long-term Memory for AI

> Give your AI agents persistent, searchable memory. Solve the context-window problem with MCP ร— Vector DB.

[](#-quick-start) [](https://www.python.org/downloads/) [](LICENSE) [](https://modelcontextprotocol.io/) [](#status)

Mnema (ฮผฮฝแฟ†ฮผฮฑ โ€” Greek for "memory") is an open-source Model Context Protocol server that gives language-model agents a long-term memory layer. Instead of stuffing every relevant fact into a single conversation (and paying for it in tokens, latency, and lost context), store durable facts once and recall them later โ€” by meaning, not by keyword.


โœจ Features

  • ๐Ÿ”Œ MCP-native โ€” drop it into Claude Desktop, ZCode, Cursor, or any MCP-compatible client.
  • ๐Ÿ—„๏ธ Pluggable vector backends โ€” ChromaDB (embedded, default), Qdrant (local or remote), or sqlite-vec (pure-SQLite, zero-dep).
  • ๐Ÿง  Hybrid search โ€” combines semantic similarity + tag overlap + decay scoring into a single ranked score.
  • โณ Memory decay โ€” a forgetting curve (recency ร— frequency ร— importance) so the store stays focused on what matters.
  • ๐Ÿ“ Summarization โ€” plans how to condense many memories into a few high-level ones; the calling AI executes the plan (Mnema never calls an LLM on its own).
  • ๐Ÿ‘ฅ Multi-user / multi-session โ€” scope-based namespace isolation (user:alice, session:abc, agent:bot-1).
  • ๐Ÿ”ง Offline by default โ€” local sentence-transformers embeddings; no API keys required to start.
  • ๐Ÿ“ฆ Programmatic SDK โ€” use Mnema from Python without standing up an MCP server.
  • ๐Ÿ’ป CLI โ€” mnema add, mnema recall, mnema statsโ€ฆ for terminal-first workflows.
  • ๐Ÿงช Well-tested โ€” pure-function unit tests + a backend matrix that runs against every supported store.

๐Ÿš€ Quick start

One-line install (recommended)

curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh | bash

That's it. The installer:

  1. Installs uv (no pip / no virtualenv wrangling).
  2. Clones Mnema from GitHub.
  3. Creates an isolated Python 3.11 environment with all dependencies.
  4. Installs the mnema and mnema-update commands.
  5. Runs mnema --doctor to verify.

> ๐Ÿ‡น๐Ÿ‡ญ New to this? See [GETTINGSTARTED.md](GETTINGSTARTED.md) โ€” step-by-step guide (in Thai).

Verify & update

mnema --doctor          # check backend + embedding loaded
mnema                   # run the MCP server (stdio, for clients)
mnema-update            # git pull + reinstall + verify (run this to upgrade)

Pick different backends / embeddings (optional)

The default install ships Chroma + local embeddings โ€” enough for most users. To use another backend, reinstall with the matching extra(s):

# Qdrant (local or remote)
curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh \
  | MNEMA_EXTRAS="qdrant,local" bash

# sqlite-vec (smallest footprint)
curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh \
  | MNEMA_EXTRAS="sqlite_vec,local" bash

# Everything (all backends + OpenAI embeddings)
curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh \
  | MNEMA_EXTRAS=all bash

Available extras: chroma, qdrant, sqlite_vec, local, openai, default (= chroma,local), all. See [docs/backends.md](docs/backends.md) and [docs/embedding-providers.md](docs/embedding-providers.md).

Manual / from source

git clone https://github.com/mienetic/mnema
cd mnema/packages/mnema-python
uv venv --python 3.11 .venv
VIRTUAL_ENV=.venv uv pip install -e '.[default]'
.venv/bin/mnema --doctor

Wire it into your AI client

Pick your client below. Each example assumes Mnema is already installed (mnema is on your PATH after running the installer).

Claude Desktop (Anthropic's desktop app)

  1. Find or create the config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

(in Finder, press Cmd+Shift+G and paste the path)

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  1. Paste this into the file (merge with existing mcpServers if present):

``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_BACKEND": "chroma", "MNEMA_BACKEND_PATH": "~/.mnema-data", "MNEMA_DEFAULT_SCOPE": "user:me" } } } } ``

  1. Fully quit Claude Desktop (menu โ†’ Quit, not just close the window) and reopen it.
  2. Verify: click the ๐Ÿ”Œ plug icon in the chat โ€” mnema should appear in the list.
  3. Try: "Remember that I prefer dark mode." then, in a new chat, "What do you know about my preferences?"

Claude Code (the claude CLI)

  1. From your project root, add the server:

``bash claude mcp add mnema mnema ` Or add it to ~/.claude.json` (user scope) directly:

``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_DEFAULT_SCOPE": "user:me" } } } } ``

  1. Start claude and run /mcp to confirm mnema is connected.
  2. Tools are available automatically โ€” try "remember that this project uses Postgres".

Cursor (the AI code editor)

  1. Create ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level):

``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_BACKEND": "chroma", "MNEMA_BACKEND_PATH": "~/.mnema-data", "MNEMA_DEFAULT_SCOPE": "project:current" } } } } ``

  1. Open Cursor โ†’ Settings โ†’ MCP (or reload the window: Cmd+Shift+P โ†’ "Reload Window").
  2. mnema should show a green dot. If red, check the path with which mnema.
  3. Use it in chat: "search my memory for past decisions about the auth module."

Zed (the editor)

  1. Open ~/.config/zed/settings.json (macOS) and add under context_servers:

``json { "context_servers": { "mnema": { "command": { "path": "mnema" }, "env": { "MNEMA_DEFAULT_SCOPE": "user:me" } } } } ``

  1. Restart Zed, then enable the server in Assistant panel settings.
  2. In the Assistant, tag @mnema to pull memory context into the conversation.

Cline (VS Code extension)

  1. Open the Cline sidebar โ†’ MCP icon โ†’ "Edit MCP Settings".
  2. Add the entry to cline_mcp_settings.json:

``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_DEFAULT_SCOPE": "workspace" }, "disabled": false, "alwaysAllow": [] } } } ``

  1. Cline auto-detects the change โ€” no restart needed.
  2. Ask Cline: "search memory for anything I decided about testing strategy."

Continue.dev (VS Code / JetBrains)

  1. Open ~/.continue/config.json and add under experimental.modelContextProtocolServers:

``json { "experimental": { "modelContextProtocolServers": [ { "transport": { "type": "stdio", "command": "mnema" } } ] } } ``

  1. Reload the window (Cmd+Shift+P โ†’ "Reload Window").
  2. Use @mnema in the Continue chat to scope memory tools.

Windsurf (Codeium's editor)

  1. Open Settings โ†’ MCP Servers โ†’ "Add Server" (or edit ~/.codeium/windsurf/mcp_config.json):

``json { "mcpServers": { "mnema": { "command": "mnema" } } } ``

  1. Click Refresh on the MCP panel โ€” mnema should turn active.
  2. Use Cascade with @mnema to recall project context.

Any other MCP client (generic)

Mnema is a standard stdio MCP server. Any client that supports the Model Context Protocol can launch it:

{
  "mcpServers": {
    "mnema": { "command": "mnema" }
  }
}

For remote / multi-client setups, run Mnema over streamable HTTP:

mnema --transport http --host 127.0.0.1 --port 8000
# then point clients at http://127.0.0.1:8000/mcp

Ready-to-copy configs for all clients are in [examples/](examples/).


๐Ÿ› ๏ธ Tools

| Tool | Description | Read-only? | |---|---|---| | mnema_remember | Store a new memory | โœ๏ธ | | mnema_recall | Pure semantic vector search | ๐Ÿ” | | mnema_search | Hybrid: vector + tags + decay | ๐Ÿ” | | mnema_get_memory | Fetch one memory by id | ๐Ÿ” | | mnema_update_memory | Patch text/tags/importance/metadata | โœ๏ธ | | mnema_forget | Delete one memory | ๐Ÿ—‘๏ธ | | mnema_forget_scope | Delete all memories in a scope | ๐Ÿ—‘๏ธ | | mnema_list_scopes | Enumerate scopes + counts | ๐Ÿ” | | mnema_summarize | Plan how to condense a scope | ๐Ÿ” | | mnema_apply_decay | Find/forget low-value memories | ๐Ÿ—‘๏ธ | | mnema_stats | Aggregate store stats | ๐Ÿ” |

Plus resources (mnema://memory/{id}, mnema://scope/{s}/summary, mnema://stats) and prompt templates (summarize_scope, recall_for).

See [SKILL.md](SKILL.md) for the full agent-facing usage guide.


๐Ÿ’ป CLI

You don't need an AI client to use Mnema โ€” the mnema command works as a terminal tool too. (Comes free with the installer.)

# Store a memory
mnema add "Alice prefers Earl Grey tea" --tags pref,tea --scope user:alice

# Recall by meaning
mnema recall "what does alice drink?" --scope user:alice

# Hybrid search (vector + tags + decay)
mnema search "preferences" --tag pref --scope user:alice

# Inspect
mnema get 
mnema list-scopes
mnema stats

# Maintain
mnema decay --threshold 0.1            # dry-run: list low-value memories
mnema decay --threshold 0.1 --apply    # actually forget them
mnema summarize session:abc            # plan how to condense a scope

# Backup / migrate
mnema export -o memories.json
mnema import -i memories.json

Add --json to any read command for machine-readable output. Run mnema --help for full options.


๐Ÿง‘โ€๐Ÿ’ป Programmatic SDK

Use Mnema from Python without MCP โ€” same engine, no IPC:

import asyncio
from mnema.sdk import MemoryClient

async def main():
    async with MemoryClient() as client:
        await client.remember(
            "Alice's deployment target is fly.io (region sin).",
            scope="project:web",
            tags=["deploy", "infra"],
            importance=8,
        )
        hits = await client.search("where do we deploy?", scope="project:web")
        print(hits.results[0].memory.text)

asyncio.run(main())

Synchronous helper for scripts:

from mnema.sdk import sync_client

with sync_client() as client:
    client.remember("a durable fact", tags=["x"])
    print(client.recall("durable").results)

โš™๏ธ Configuration

All settings are environment-driven (or .env):

| Variable | Default | Description | |---|---|---| | MNEMA_BACKEND | chroma | chroma \| qdrant \| sqlite_vec | | MNEMA_BACKEND_PATH | .mnema/data | Local path or remote URL (http://โ€ฆ) | | MNEMA_BACKEND_COLLECTION | memories | Collection/table name | | MNEMA_EMBEDDING | local | local (offline) \| openai | | MNEMA_EMBEDDING_MODEL | all-MiniLM-L6-v2 | Model name | | MNEMA_EMBEDDING_DIM | auto | Override vector dim | | MNEMA_OPENAI_API_KEY | โ€” | Required when embedding=openai | | MNEMA_DEFAULT_SCOPE | global | Scope when a tool omits it | | MNEMA_DECAY_HALF_LIFE_DAYS | 30 | Recency half-life | | MNEMA_DECAY_FLOOR | 0.05 | Min decay score | | MNEMA_VECTOR_WEIGHT | 0.7 | Hybrid score weight (must sum to 1) | | MNEMA_KEYWORD_WEIGHT | 0.2 | Hybrid score weight | | MNEMA_DECAY_WEIGHT | 0.1 | Hybrid score weight | | MNEMA_TRANSPORT | stdio | stdio \| http | | MNEMA_HTTP_HOST | 127.0.0.1 | HTTP bind host | | MNEMA_HTTP_PORT | 8000 | HTTP bind port |


๐Ÿ—„๏ธ Choosing a backend

| Backend | Install extra | Embedded? | Best for | |---|---|---|---| | Chroma (default) | chroma | โœ… in-process + persistent | Quick start, single-user, dev | | Qdrant | qdrant | โœ… local path / :memory: / remote | Production, high scale, metadata filtering | | sqlite-vec | sqlite_vec | โœ… pure SQLite | Smallest footprint, constrained envs |

Switch backends by reinstalling with the right extra and setting the env var:

curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh \
  | MNEMA_EXTRAS="qdrant,local" bash
export MNEMA_BACKEND=qdrant
mnema --doctor

See [docs/backends.md](docs/backends.md) for full details.


๐Ÿง  Embedding providers

| Provider | Install extra | Mode | Dim | |---|---|---|---| | sentence-transformers (default) | local | Offline (CPU/GPU) | 384 (all-MiniLM-L6-v2) | | OpenAI | openai | API (requires key) | 1536 (text-embedding-3-small) |

curl -fsSL https://raw.githubusercontent.com/mienetic/mnema/main/scripts/install.sh \
  | MNEMA_EXTRAS="chroma,openai" bash
export MNEMA_EMBEDDING=openai
export MNEMA_OPENAI_API_KEY=sk-...
mnema --doctor

See [docs/embedding-providers.md](docs/embedding-providers.md) for model options.


๐Ÿงช Development

git clone https://github.com/mienetic/mnema.git
cd mnema/packages/mnema-python

# Install with dev deps + all backends
uv venv --python 3.11 .venv
VIRTUAL_ENV=.venv uv pip install -e '.[all,dev]'

# Run tests (skips backends whose deps are missing)
pytest

# Run a specific backend's tests after installing its extra
pytest -m chroma

# Lint + typecheck
ruff check .
mypy src/mnema

Test the server interactively

npx @modelcontextprotocol/inspector uv run mnema

This opens the MCP Inspector web UI where you can call every tool.


๐Ÿณ Docker

docker compose -f docker/docker-compose.yml up mnema
# Streamable HTTP on http://localhost:8000/mcp

See [docker/](docker/) for the Dockerfile and compose setup.


๐Ÿ“ฆ Project layout

mnema/
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ mnema-python/         # โญ MCP server + SDK (Python)
โ”‚   โ”‚   โ”œโ”€โ”€ src/mnema/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ backends/     # chroma, qdrant, sqlite_vec
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ embeddings/   # sentence_transformers, openai
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ tools/        # 10 MCP tools
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ service.py    # orchestration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ decay.py      # forgetting curve
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ summarize.py  # summarization planner
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ sdk.py        # programmatic SDK
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ server.py     # FastMCP bootstrap
โ”‚   โ”‚   โ””โ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ mnema-ts/             # TypeScript MCP server (planned)
โ”‚   โ””โ”€โ”€ mnema-cli/            # Node CLI (planned)
โ”œโ”€โ”€ docker/                   # Dockerfile + compose
โ”œโ”€โ”€ docs/                     # architecture, backends, deployment
โ”œโ”€โ”€ examples/                 # client config examples
โ”œโ”€โ”€ SKILL.md                  # agent-facing usage guide
โ””โ”€โ”€ README.md

๐Ÿค How it works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    MCP     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  AI Client   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚   Mnema Server   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  (stdio/   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                  HTTP)     โ”‚  โ”‚ 10 tools   โ”‚  โ”‚
                            โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                            โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                            โ”‚  โ”‚  Service   โ”‚  โ”‚
                            โ”‚  โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜  โ”‚
                            โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ” โ”Œโ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”‚
                            โ”‚ โ”‚embed โ”‚ โ”‚vectorโ”‚ โ”‚
                            โ”‚ โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜ โ”‚
                            โ””โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”˜
                                 โ”‚         โ”‚
                    sentence-    โ”‚  Chroma/Qdrant/
                    transformers โ”‚  sqlite-vec
                    (local)      โ”‚
                                 โ–ผ         โ–ผ
                              vectors  + metadata

Every memory is embedded, stored alongside its scope/tags/importance, and ranked on retrieval by:

score = 0.7ยทvector + 0.2ยทkeyword + 0.1ยทdecay

where decay = recency(half-life) ร— frequency ร— importance.


๐Ÿ—บ๏ธ Roadmap

  • [x] Python MCP server (FastMC

โ€ฆ

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source โ€” we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet โ€” be the first.

Versions

  • v0.1.0 Imported from the upstream source.