Install
$ agentstack add mcp-mienetic-mnema Open-source listing โ not yet scanned by AgentStack. Follow the source repository for install instructions.
Security review
โ Flagged1 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.
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:
- Installs
uv(no pip / no virtualenv wrangling). - Clones Mnema from GitHub.
- Creates an isolated Python 3.11 environment with all dependencies.
- Installs the
mnemaandmnema-updatecommands. - Runs
mnema --doctorto 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)
- 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
- Paste this into the file (merge with existing
mcpServersif present):
``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_BACKEND": "chroma", "MNEMA_BACKEND_PATH": "~/.mnema-data", "MNEMA_DEFAULT_SCOPE": "user:me" } } } } ``
- Fully quit Claude Desktop (menu โ Quit, not just close the window) and reopen it.
- Verify: click the ๐ plug icon in the chat โ
mnemashould appear in the list. - Try: "Remember that I prefer dark mode." then, in a new chat, "What do you know about my preferences?"
Claude Code (the claude CLI)
- 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" } } } } ``
- Start
claudeand run/mcpto confirmmnemais connected. - Tools are available automatically โ try "remember that this project uses Postgres".
Cursor (the AI code editor)
- 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" } } } } ``
- Open Cursor โ Settings โ MCP (or reload the window:
Cmd+Shift+Pโ "Reload Window"). mnemashould show a green dot. If red, check the path withwhich mnema.- Use it in chat: "search my memory for past decisions about the auth module."
Zed (the editor)
- Open
~/.config/zed/settings.json(macOS) and add undercontext_servers:
``json { "context_servers": { "mnema": { "command": { "path": "mnema" }, "env": { "MNEMA_DEFAULT_SCOPE": "user:me" } } } } ``
- Restart Zed, then enable the server in Assistant panel settings.
- In the Assistant, tag
@mnemato pull memory context into the conversation.
Cline (VS Code extension)
- Open the Cline sidebar โ MCP icon โ "Edit MCP Settings".
- Add the entry to
cline_mcp_settings.json:
``json { "mcpServers": { "mnema": { "command": "mnema", "env": { "MNEMA_DEFAULT_SCOPE": "workspace" }, "disabled": false, "alwaysAllow": [] } } } ``
- Cline auto-detects the change โ no restart needed.
- Ask Cline: "search memory for anything I decided about testing strategy."
Continue.dev (VS Code / JetBrains)
- Open
~/.continue/config.jsonand add underexperimental.modelContextProtocolServers:
``json { "experimental": { "modelContextProtocolServers": [ { "transport": { "type": "stdio", "command": "mnema" } } ] } } ``
- Reload the window (
Cmd+Shift+Pโ "Reload Window"). - Use
@mnemain the Continue chat to scope memory tools.
Windsurf (Codeium's editor)
- Open Settings โ MCP Servers โ "Add Server" (or edit
~/.codeium/windsurf/mcp_config.json):
``json { "mcpServers": { "mnema": { "command": "mnema" } } } ``
- Click Refresh on the MCP panel โ
mnemashould turn active. - Use Cascade with
@mnemato 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.
- Author: mienetic
- Source: mienetic/mnema
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet โ be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.