Mnemos
A memory & knowledge server for AI agents
named after the Titaness of memory, built for AI agents that need to remember
🇬🇧 English · 🇷🇺 Русский
Features · Quick start · What it is · Architecture · Surfaces · Docs
✨ Features
One local server — and a connected agent harness gets the full memory stack.
| Area | What you get |
|---|---|
| Universal connectivity | MCP server (26 tools, stdio) + REST API — any MCP-capable harness connects in one line (tools · HTTP) |
| Ready integrations | zcode, the ~/.agents standard (Claude / Codex / Continue / Qwen and more), pi — via mnemos integration: deploy targets, one-line MCP presets, multi-harness doctor |
| Skill pack | 14+ memory skills deployed into your harnesses |
| Flexible memory | Hybrid search (full-text + vector, rank fusion), tag contract, per-agent / per-project memory, context-filter profiles, CCR compression — 70–90% token savings, originals kept |
| Context assembly | assemble_context: search → compress → filter → secret scan → cache align → token budget, per-block provenance |
| Context bridge | on_context_rewrite — when the harness compacts history, the lossless original stays available on demand |
| Lifecycle hooks | pre_llm_call context injection, on_session_start, post_tool_call auto-compression of tool outputs |
| Publication v3.0.0 | Entries visible immediately after save, background refinement with seamless swap, quarantine with neutral retraction |
| Self-protection | Injection / secret detectors on input and publication, every output scanned, full per-entry audit |
| Auto-pipeline | Background processor: clustering, deduplication, quality gate, publication |
Autonomy for an arbitrary harness, LLM-driven enrichment, and package publishing (PyPI / npm) are partial — the full, honest map lives in docs/en/features.md.
🚀 Quick start
Four steps to a working memory store, wired into VS Code Copilot.
1 · Install
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/install.sh | bash
The installer does everything for you — no Python or venv knowledge required:
- creates an isolated environment at
~/.mnemos/venv; - drops a
mnemoslauncher into~/.local/bin, so the CLI just works in any shell (no venv activation needed); - offers to wire up VS Code MCP integration right there (or run it later — see step 3).
Prefer a non-interactive run? Add
--mcp/--no-mcpto decide up front, e.g.… | bash -s -- --mcp.
2 · Write & recall
mnemos add "First memory — Mnemos remembers across sessions" \
--tags project:mnemos,agent:tech-writer,mnemos:learning
mnemos search "remembers across sessions"
That's the whole loop: write, find, never lose it. Every entry carries a
tag contract (project: / agent: / mnemos:) so memories stay organised.
3 · Connect VS Code (MCP)
If you answered yes during install, you're already done — just reload your VS Code window. To set it up manually, or on another machine:
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/mcp-setup.sh | bash
Then reload the VS Code window (Ctrl+Shift+P → Reload Window). The mnemos_* tools appear in
Copilot's tool picker, and your agents can call mnemos_add / mnemos_search directly.
4 · Deploy behavioral instructions
mnemos integration setup
This deploys memory-usage instructions, skills, and a prompt mode to your
agent harness (Copilot ~/.copilot/, generic Copilot, Cursor, and Hermes Agent
~/.hermes/), plus two universal targets: zcode (native ~/.zcode/ skills +
MCP config) and agents (the AGENTS.md standard ~/.agents/ — read natively
by ZCode, Claude Code, Codex, Cursor and friends). Agents will now know when
and how to use Mnemos memory — not just have the tools available. Use
--home <dir> to install into another environment's home (e.g. a container).
Add --wire-agents --all to also grant mnemos/* tools to Copilot agent
frontmatter in the same pass. See the
integration guide
for wiring flags and the context filter guide
for the five-stage noise stripper that runs automatically on every mnemos_add.
🛠️ Other ways to install — from source, released wheel, or container one-liner
From source (for development):
git clone https://github.com/Korrnals/mnemos.git
cd mnemos
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
Released wheel (pin a specific version):
pip install https://github.com/Korrnals/mnemos/releases/download/v3.2.0/mnemos_memory_server-3.2.0-py3-none-any.whl
Container one-liner — pulls the image, creates volumes, starts on port 8787:
export MNEMOS_API__TOTP_MASTER_KEY=$(python3 -c "import secrets; print(secrets.token_urlsafe(32))")
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/install.sh | bash -s -- --container
See the full container deployment guide.
🐳 Run the pre-built image directly (GHCR)
Published to ghcr.io/korrnals/mnemos on every release tag.
# Generate a TOTP master key (required — the container binds 0.0.0.0)
export MNEMOS_API__TOTP_MASTER_KEY=$(python3 -c "import secrets; print(secrets.token_urlsafe(32))")
podman run -d --name mnemos \
-p 8787:8787 \
-v mnemos-data:/data \
-v mnemos-vault:/vault \
-e MNEMOS_API__TOTP_MASTER_KEY="${MNEMOS_API__TOTP_MASTER_KEY}" \
<!-- version:image -->
ghcr.io/korrnals/mnemos:3.1.0
<!-- /version:image -->
curl -s http://localhost:8787/health | jq
Tags: :3.1.0 (pinned) · :latest (rolling). Works with docker too — swap podman for docker.
📘 For a guided first run covering the MCP and HTTP servers, see getting-started.md.
🧩 What Mnemos is
A single-tenant, local-first memory server for AI agents. One in-process core, three equivalent control surfaces, and a storage layer you can read with your own eyes.
| Capability | What it gives you | |
|---|---|---|
| 🔎 | Hybrid search | Vector similarity + SQLite FTS5 full-text over every memory |
| 🧪 | Knowledge pipeline | raw → processing → processed → published lifecycle with a state machine |
| 🧠 | Per-agent recall | A focused recall surface scoped to each agent's project context |
| ⚙️ | Policy engine | Schedule and trigger automation over the memory store |
| 🧹 | Context filter | Five-stage noise stripper for logs / stdout before anything hits a model |
| 🗜️ | Reversible compression (CCR) | Compress large content with zero data loss — originals cached in SQLite, retrievable via hash marker |
| 🧷 | CacheAligner (P1-5) | Relocate dynamic content (timestamps, UUIDs, session ids, tokens) to the tail so provider KV caches (Anthropic cache_control, OpenAI prefix caching) hit across requests |
| 🪶 | Output token reduction (P1-7) | Optional verbosity / effort params on mnemos_add / mnemos_search / mnemos_recall_context steer the caller's output style — backward compatible, defaults are a no-op |
| 📂 | Path-scoped rules | Ingest project rules and apply them by file path |
| 🗂️ | Obsidian vault | A markdown mirror humans can browse, edit, and grep |
SQLite for metadata, a local numpy + SQLite vector index for recall, and an Obsidian-compatible vault for the humans in the loop.
🏗️ Architecture
System diagram — clients → interfaces → core → storage
flowchart TB
subgraph CLIENTS["Clients"]
C1(["VS Code · Copilot\nstdio MCP"])
C2(["CLI — mnemos …"])
C3(["HTTP API client"])
end
subgraph IFACE["Interface Layer"]
MCP["mcp_server.py"]
FAPI["api/main.py · FastAPI"]
TYPER["cli/main.py · Typer"]
end
MGR(["MemoryManager\nmanager.py"])
subgraph PROC["Processing Subsystems"]
CF["Context Filter\nfilter/"]
PP["Knowledge Pipeline\npipeline/"]
RE["Recall Engine\nrecall/"]
PE["Policy Engine\npolicy/"]
end
subgraph BG["Background Services"]
WA["Watchers\nwatchers/"]
AC["Auto-collect\nauto_collect.py"]
end
subgraph STORE["Storage Layer"]
SQ[("SQLite\nFTS5 · traces · projects")]
VS[("Vector Store\nnumpy + SQLite")]
VLT[("Obsidian Vault\nmarkdown mirror")]
end
C1 -->|"stdio"| MCP
C2 --> TYPER
C3 --> FAPI
MCP --> MGR
TYPER --> MGR
FAPI --> MGR
MGR --> CF
MGR --> PP
MGR --> RE
MGR --> SQ
MGR --> VS
MGR --> VLT
CF -.->|"raw + clean"| SQ
PP -->|"status transitions"| SQ
PP -->|"published upsert"| VS
RE -->|"FTS5 MATCH"| SQ
RE -->|"cosine search"| VS
PE -->|"schedule / trigger"| MGR
WA -->|"file events"| MGR
AC -.->|"checkpoint reminder"| MCP
A deeper walkthrough — data model, state machines, security boundaries, operational concerns — lives in architecture/overview.md.
🎛️ Three surfaces, one core
The same MemoryManager powers all three interfaces. Pick the one that fits your client.
| Surface | Use it when… | Reference |
|---|---|---|
CLI — mnemos … |
You live in a shell, want fast ad-hoc add / search, or are scripting cron jobs | cli-reference.md |
HTTP — mnemos serve |
You have a non-MCP client — a web dashboard, a mobile app, a CI runner | http-api.md |
MCP — mnemos mcp-server |
You are VS Code Copilot or any MCP-aware agent — the path Copilot agents take | mcp-tools.md |
The MCP surface also exposes the A2A Sessions API (M16) — a persistent backend for multi-step agent
conversations. Five endpoints (POST /v1/sessions, append-turn, range-load, …) let agents survive restarts
without losing context. See a2a-sessions.md.
📖 The lore
In Hesiod's Theogony, Mnemosyne (Μνημοσύνη) is the Titaness of memory — she who, by Zeus, gave birth to the nine Muses and through them made the world's remembering possible. Her name is the root of mnemonic, and she is what every singer, poet, and philosopher prays to before they begin.
This software carries her name because it is built for the same task: to make remembering possible for the things that think. AI agents, unmoored from any single conversation, lose everything that came before. Mnemos gives them a place to lay it down — structured, searchable, governed by contract — so that what they learn does not vanish with the closing of a session. The Muses, after all, were not for the gods' benefit. They were for the songs.
📚 Documentation
| Page | What it covers |
|---|---|
| docs/README.md | Documentation landing — language picker (EN / RU) |
| getting-started.md | First run: install → first memory → first search → MCP / HTTP |
| architecture/overview.md | System shape, data model, state machines, security boundaries |
| cli-reference.md | Every mnemos subcommand with flags, defaults, examples |
| mcp-tools.md | Every mnemos_* tool exposed to VS Code Copilot |
| http-api.md | Every HTTP endpoint (memory CRUD + A2A Sessions, M16) |
| a2a-sessions.md | Agent-to-agent conversation contract (M16) |
| tag-contract.md | The project: / agent: / mnemos: schema enforced on every memory |
| security.md | Threat model, SSRF guard, FTS5 escape, HF Hub pinning |
| runbooks/ | Install, migrate, backup / restore, dependency updates |
| container-deployment.md | Build, push, compose, podman, Kubernetes, quadlet |
| adr/ | Architectural decision records — the why behind the design |
| milestones.md | Milestone ledger with status legend |
| reports/ | Phase completion reports — final report per completed roadmap phase |
| CHANGELOG.md | Release notes — Keep a Changelog format |
🤝 Integrations
Mnemos works with every MCP-capable agent harness. Three integration levels — pick the strongest one your harness supports:
| Harness | Native deploy target | One-line MCP preset | Adapter template |
|---|---|---|---|
| VS Code Copilot | copilot (+ prompts via generic-copilot) |
mcp-setup.sh | ✓ |
| Claude Code | via agents |
preset | ✓ |
| Cursor | cursor |
preset | ✓ |
| Codex | via agents |
preset | ✓ |
| Windsurf | — | preset | ✓ |
| ZCode | zcode |
— | ✓ |
| Any AGENTS.md-standard harness | agents |
— | ✓ |
| Hermes Agent | hermes (native MemoryProvider plugin) |
— | — |
- Hermes Agent — native
MemoryProviderplugin (integrations/hermes/): automatic prefetch, sync-turn, built-in memory mirroring. Since plugin 3.0.0 (ADR-0017 D1) the plugin runs in-process — it needspip install mnemos-memory-serverin the Hermes Python environment, and the legacybase_url/api_key/totp_secretconfig keys are gone. See the integration guide. - Native targets —
mnemos integration setup --target <name>deploys the behavioral pack and registers the MCP server in one pass. See the integration guide. - One-line MCP presets —
integrations/mcp-presets.md: connect Cursor, Claude Code, Codex, or Windsurf by pasting one line. - Adapter template —
integrations/adapter-template.md: Connect / Expose / Configure + acceptance checklist for any harness that speaks MCP stdio.
The shared contract is the tag schema — project:<slug>, agent:<slug>,
and at least one mnemos:<subtype> — that every memory entry must carry.
⚖️ Source & license
- Source — this repository, github.com/Korrnals/mnemos.
- License — MIT (see pyproject.toml).
🌱 Contributing
PRs welcome. Read PLAN.md for the roadmap and follow the conventions in the docs/ set.
Git workflow: feat/* → dev-<stage> → release/X.Y.Z → main; main accepts only release/* and
hotfix/* PRs. Conventional Commits required. Run make verify before opening a PR.
Reproduce the green state: make verify runs the full quality gate
— ruff + mypy --strict + bandit + pip-audit + 867 tests. If it's green, the change is good to ship.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mnemos_memory_server-3.2.0.tar.gz.
File metadata
- Download URL: mnemos_memory_server-3.2.0.tar.gz
- Upload date:
- Size: 21.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4be64b1a2b11ba9a3da4fde4eba04303545aefae257361990686629a1d98273d
|
|
| MD5 |
7badb3177c30fe4226d6a50824ef9fe3
|
|
| BLAKE2b-256 |
7236e3f1b2c909dda18552d2fe7ac2d8cd094cc5a675590e59ceb50dd949f75e
|
File details
Details for the file mnemos_memory_server-3.2.0-py3-none-any.whl.
File metadata
- Download URL: mnemos_memory_server-3.2.0-py3-none-any.whl
- Upload date:
- Size: 20.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a2b16bf365afc6f847993ddcb4802b971e9334c756cb38603f2b77c94eb0d66
|
|
| MD5 |
a2a2df4ae6a6f9aaaf776d319cef20d6
|
|
| BLAKE2b-256 |
bd055ac3a3570899c1b8cca0ee3f32c4117f463efc3aecd7903d222fbed456a6
|