Mnemos
A memory & knowledge server for AI agents
named after the Titaness of memory, built for AI agents that need to remember
🇬🇧 English · 🇷🇺 Русский
Quick start · Features · What it is · Connect a harness · Architecture · Docs
AI agents forget everything when a session ends. Mnemos gives them a place to lay it down — structured, searchable, governed by contract — so what they learn does not vanish with the closing of a window.
- Local-first. One process on your machine. SQLite + a bundled embedding model; nothing leaves the host, no API keys, works offline.
- One server, any harness. VS Code Copilot, Claude Code, Cursor, OpenCode, Codex, Windsurf, ZCode, pi, Hermes — the same MCP wire, one line each.
- The agent learns to use it. Not just tools: always-on instructions, a skill pack, and a memory-first prompt mode, deployed into your harness in one command.
🚀 Quick start
Three commands from an empty machine to an agent that remembers — and knows when to look.
1 · Install the server
pip install mnemos-memory-server
One package, everything included: the memory server, the mnemos CLI, the REST API, and the
MCP server your agent harness talks to. The embedding model ships inside — search works fully
offline, no API keys, nothing downloaded.
⚠️ Mind the name:
pip install mnemos(without-memory-server) is an unrelated project.
2 · Connect your harness — and teach it to use memory
mnemos integration setup
One pass: detects the agent harnesses on your machine, registers the Mnemos MCP server in each
supported one (VS Code Copilot, Cursor, ZCode, OpenCode, pi, Hermes, and everything reading the
~/.agents standard — Claude Code, Codex and friends), and deploys the behavioral pack —
always-on instructions and memory skills, so the agent recalls at session start, checkpoints
before its context gets compacted, and treats memory as a priority instead of forgetting the
tools exist.
Running a harness that reads nothing standard? One paste block per harness: Connect Mnemos to any harness.
3 · Verify — then try it
mnemos doctor
PASS / WARN / FAIL per check: store, config, MCP transport, harness registration (--fix
repairs the common warnings). Then give it a memory:
mnemos add "First memory — Mnemos remembers across sessions" \
--tags project:mnemos,agent:me,mnemos:learning
mnemos search "remembers across sessions"
That is the whole loop: write, find, never lose it — and the agent knows when to look.
📘 Want every detail? The extended guide covers all install variants (
uv tool,pipx, CLI-only, external LLM extras, installer script, container), per-harness connection walkthroughs, configuration, and troubleshooting: Getting Started — the complete first run.
✨ 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 | VS Code Copilot, Claude Code, Cursor, Codex, Windsurf, OpenCode, ZCode, pi, Hermes Agent — one-line MCP presets for all of them, native deploy targets for most, multi-harness doctor (mnemos doctor) |
| Skill pack | 14+ memory skills deployed into your harnesses |
| Flexible memory | Hybrid search (full-text + vector, rank fusion) over the bundled offline model mnema-embed-v1, 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 and LLM-driven enrichment are partial — the full, honest map lives in docs/en/features.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 | 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 | 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.
🤝 Connect any harness
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 | ✓ |
| OpenCode | — | preset | ✓ |
| ZCode | zcode |
— | ✓ |
| Any AGENTS.md-standard harness | agents |
— | ✓ |
| pi | pi (bridge extension, also on npm as pi-mnemos) |
preset | ✓ |
| Hermes Agent | hermes (native in-process MemoryProvider plugin) |
— | — |
- Native targets —
mnemos integration setup --target <name>deploys the behavioral pack and registers the MCP server in one pass (integration guide). - One-line presets —
integrations/mcp-presets.md: every harness above, copy-paste ready. - Adapter template —
integrations/adapter-template.md: Connect / Expose / Configure + acceptance checklist for any harness that speaks MCP stdio. - Hermes Agent runs Mnemos in-process:
pip install mnemos-memory-serverin the Hermes environment, thenmnemos integration setup --target hermes(details).
The shared contract is the tag schema — project:<slug>, agent:<slug>,
and at least one mnemos:<subtype> — that every memory entry must carry.
🏗️ Architecture
System diagram — clients → interfaces → core → storage
flowchart TB
subgraph CLIENTS["Clients"]
C1(["Agent harness\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 |
|---|---|---|
MCP — mnemos mcp-server |
You are an agent harness — the path every connected agent takes | mcp-tools.md |
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 |
The HTTP surface also exposes the A2A Sessions API — a persistent backend for multi-step agent conversations that survive restarts. See a2a-sessions.md.
📚 Documentation
| Page | What it covers |
|---|---|
| docs/README.md | Documentation landing — language picker (EN / RU) |
| getting-started.md | First run: install → first memory → first search → connect your harness |
| mcp-presets.md | Connect Mnemos to any harness — one-line MCP presets (VS Code, Claude Code, Cursor, OpenCode, Codex, Windsurf, pi, Hermes) |
| integration-guide.md | The behavioral pack: instructions, skills, prompt mode, deploy targets, agent wiring, Hermes plugin |
| features.md | What works out of the box, what is partial, what is planned |
| 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 agent harnesses |
| http-api.md | Every HTTP endpoint (memory CRUD, workflow, hooks, A2A Sessions) |
| tag-contract.md | The project: / agent: / mnemos: schema enforced on every memory |
| security.md | Threat model, SSRF guard, FTS5 escape, auth model |
| runbooks/ | Install, migrate, backup / restore, dependency updates, container deployment |
| adr/ | Architectural decision records — the why behind the design |
| CHANGELOG.md | Release notes — Keep a Changelog format |
| CONTRIBUTING.md | Development setup, git workflow, quality gate |
📖 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.
⚖️ License & contributing
Apache-2.0 — see LICENSE and NOTICE. Source: github.com/Korrnals/mnemos.
Contributions are welcome — CONTRIBUTING.md has the development setup, the branch and commit conventions, and the quality gate a change must pass.
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-4.1.0.tar.gz.
File metadata
- Download URL: mnemos_memory_server-4.1.0.tar.gz
- Upload date:
- Size: 21.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acc9a8fed97a572bc67b6b3e4c7d756e155811bb50b93b1109f1b152deefa8e1
|
|
| MD5 |
52f882278fa823dd73cedf19fed6bfb9
|
|
| BLAKE2b-256 |
f08d486817c71c10f323580c5e394dfe648f2ef6600c21c49f81c87be5141c43
|
File details
Details for the file mnemos_memory_server-4.1.0-py3-none-any.whl.
File metadata
- Download URL: mnemos_memory_server-4.1.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 |
6b3f5ec24ad5e1b79883b2aeb8250ed80301fedc58193483d43709350d145830
|
|
| MD5 |
c2aae21de4a90b904f6bd44e20a19c08
|
|
| BLAKE2b-256 |
03f142e4532880519562b89b40d78e227c522efa9c9ffef069ed2dda67349ecf
|