Skip to main content

Mnemos — memory & knowledge server for AI agents

Mnemos

A memory & knowledge server for AI agents
named after the Titaness of memory, built for AI agents that need to remember

Python License: Apache-2.0 Version

🇬🇧 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 mnemos launcher 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-mcp to 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/v4.0.0/mnemos_memory_server-4.0.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:4.0.0
<!-- /version:image -->

curl -s http://localhost:8787/health | jq

Tags: :4.0.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
CLImnemos … You live in a shell, want fast ad-hoc add / search, or are scripting cron jobs cli-reference.md
HTTPmnemos serve You have a non-MCP client — a web dashboard, a mobile app, a CI runner http-api.md
MCPmnemos 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 MemoryProvider plugin (integrations/hermes/): automatic prefetch, sync-turn, built-in memory mirroring. Since plugin 3.0.0 (ADR-0017 D1) the plugin runs in-process — it needs pip install mnemos-memory-server in the Hermes Python environment, and the legacy base_url / api_key / totp_secret config keys are gone. See the integration guide.
  • Native targetsmnemos integration setup --target <name> deploys the behavioral pack and registers the MCP server in one pass. See the integration guide.
  • One-line MCP presetsintegrations/mcp-presets.md: connect Cursor, Claude Code, Codex, or Windsurf by pasting one line.
  • Adapter templateintegrations/adapter-template.md: Connect / Expose / Configure + acceptance checklist for any harness that speaks MCP stdio.

The shared contract is the tag schemaproject:<slug>, agent:<slug>, and at least one mnemos:<subtype> — that every memory entry must carry.


⚖️ Source & license

🌱 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.Zmain; 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

mnemos_memory_server-4.0.0.tar.gz (21.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mnemos_memory_server-4.0.0-py3-none-any.whl (20.7 MB view details)

Uploaded Python 3

File details

Details for the file mnemos_memory_server-4.0.0.tar.gz.

File metadata

  • Download URL: mnemos_memory_server-4.0.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

Hashes for mnemos_memory_server-4.0.0.tar.gz
Algorithm Hash digest
SHA256 125dad1736566253673c7e925f9f3d416c6ab147a4cc25d5b2cd224819a206b6
MD5 6f448d91e300a3551bd5a60cc7eefd5c
BLAKE2b-256 5d29d694f8218e0861cf942d39127ad60c33e9532cbabf337c3735107d1589d9

See more details on using hashes here.

File details

Details for the file mnemos_memory_server-4.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mnemos_memory_server-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca9742777c397f4a72c00db2fa1ac53ae9da1dc8091eb97c9865c6035c7201ac
MD5 8bddde211b8c483aef66e3959a71ac20
BLAKE2b-256 592a4e97994d39a062e10798fcba311cd2aec6a6ad10a148ccc32e4294ade61b

See more details on using hashes here.

Release history Release notifications | RSS feed

4.1.0

2 files

This release

4.0.0 This release

2 files

3.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page