/mnemosyne:mnemosyne-integratefrom mnemosyne
Wires Mnemosyne memory into an existing repository with a test-first approach. Guides through repository survey, test writing, and integration for cross-session context persistence.
Ships in mnemosyne. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A pipeline skill: run it end to end, in order. Do not skip step 2 — the test is what makes the integration verifiable rather than merely plausible.
Answer these four questions, with file evidence, before choosing an approach:
user_id / agent_id / run_id / app_id; reusing an
existing identifier is always better than inventing a parallel one.pip freeze / package.json. If the project
already has an LLM client or an embedding provider, reuse its credentials
instead of asking for new ones.add() goes.Report the four findings before proceeding. If any is missing, say so and propose the smallest change that supplies it.
The integration is not done until this passes. Adapt the transport:
import os, tempfile
from mnemosyne.api import Memory, MemoryConfig
def test_memory_round_trip():
with tempfile.TemporaryDirectory() as tmp:
m = Memory(MemoryConfig.from_dict({
"brain_dir": tmp,
"llm": {"provider": "rules"}, # deterministic, offline
"embedder": {"provider": "builtin"},
}))
m.add("The user prefers dark mode and vim keybindings.", user_id="test")
hits = m.search("dark mode vim keybindings",
filters={"user_id": "test"}, explain=True)
assert hits["results"], "recall must return the memory that was just written"
assert hits["results"][0]["memory"]
Two properties this test has and a naive one does not:
Run it. It should pass on a clean install. If it fails, fix the integration before continuing — do not proceed to the real wiring with a broken baseline.
| Situation | Approach |
|---|---|
| Single-process app, one machine | Embedded Memory() — no server, no network |
| Several services or processes | mnemosyne-web + MemoryClient(base_url=...) |
| An MCP-capable assistant (Claude Code, Cursor, Codex, Hermes) | Register the MCP server — see below |
| A LangChain / LlamaIndex / CrewAI app | integrations/ in this repository |
For an MCP-capable assistant, the smallest correct configuration:
{
"mcpServers": {
"mnemosyne": {
"command": "python",
"args": ["-m", "mnemosyne.webui.mcp_server",
"--brain-dir", "~/.mnemosyne", "--namespace", "default"],
"env": { "MNEMOSYNE_MCP_TOKEN": "<random 32+ chars>" }
}
}
}
Set the token. An unauthenticated local MCP server is one shell escape away from being an unauthenticated network one.
Before the model call — inject what is relevant:
hits = memory.search(user_message, filters={"user_id": user_id}, top_k=5)
if hits["results"]:
system += "\n\nWhat you already know about this user:\n" + "\n".join(
f"- {h['memory']}" for h in hits["results"])
Budget the injected text. If the context window is tight, use the token-budgeted form instead of truncating the list:
from mnemosyne import MemoryBrain
results, cost = brain.recall(user_message, k=5, budget_tokens=400)
After the turn — persist it:
memory.add([{"role": "user", "content": user_message},
{"role": "assistant", "content": reply}], user_id=user_id)
Do the write after sending the reply where possible. add() may call a model
for extraction, and a user should not wait on memory bookkeeping to see a
response.
Three behaviours surprise people, and each has a fix:
user_id at the top level for add()
and delete_all(); inside filters for search() and get_all(). Mixing them
raises VALIDATION_007 rather than silently returning everything.memory.describe()["degraded"] == {} in your own test if silent degradation
would be unacceptable in your deployment — or set "strict_providers": true.python scripts/verify_api.py # the upstream suite, 29 checks
curl -s http://127.0.0.1:8788/v1/status/ | python -m json.tool
The status route reports the live configuration and every degradation. It is the first thing to read when recall is worse in production than in the test — and it stays readable even while API keys are being rotated.
State: which files changed, the test that now covers the integration, the scope keys in use, which providers are configured, and anything from step 5 that the deployment will need to know. Name anything you could not do.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (mnemosyneos/mnemosyne) — no native marketplace selected
npx claudepluginhub p/mnemosyneos-mnemosyne3 skills in this plugin
/mnemosyneUse the Mnemosyne OS memory API to give an agent persistent memory. Load this when a task involves remembering user preferences or facts across sessions, retrieving prior context, scoping memories to a user/agent/run/app, filtering with structured predicates, compressing a memory to fit a context budget, or running existing agent-memory code on a self-hosted engine.
/mnemosyne-cliUse the mnemosyne command line to store, search, list, update and delete memories from a terminal or a script. Load this when a task involves running mnemosyne commands, scripting memory operations in a shell, consuming memory output from a tool loop, or setting up the CLI for the first time.
Other plugins' skills for the same job