[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11066":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},11066,"mnem","Uranid\u002Fmnem","Uranid","Git for AI Agent Knowledge. A persistent, versioned memory layer for AI systems. Hybrid GraphRAG retrieval. Runs entirely offline.","",null,"Rust",142,37,27,1,0,3,11,73,9,4.74,"Apache License 2.0",false,"main",true,[27,28,29,30,31,32,33,34],"agent-memory","graphrag","knowledge-graph","local-first","mcp","rust","vector-search","version-control","2026-06-12 02:02:29","﻿\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"assets\u002Flogo\u002Fmnem-banner.svg\" alt=\"mnem: Git for AI Agent Knowledge\" \u002F>\n\n[![License: Apache-2.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache--2.0-blue?style=for-the-badge)](LICENSE)\n[![CI](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002FUranid\u002Fmnem\u002Fci.yml?style=for-the-badge&label=CI)](https:\u002F\u002Fgithub.com\u002FUranid\u002Fmnem\u002Factions\u002Fworkflows\u002Fci.yml)\n[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmnem-cli?style=for-the-badge)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmnem-cli)\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fmnem-cli?style=for-the-badge)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fmnem-cli\u002F)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fmnem-cli?style=for-the-badge)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmnem-cli)\n[![MSRV 1.95](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMSRV-1.95-orange?style=for-the-badge)](rust-toolchain.toml)\n[![Runs on Linux macOS Windows WASM](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fruns%20on-linux%20%7C%20macos%20%7C%20windows%20%7C%20wasm-2ea44f?style=for-the-badge)](#install)\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\n[English](README.md) &nbsp;·&nbsp; [中文](README.zh-CN.md) &nbsp;·&nbsp; [Español](README.es.md)\n\n\u003C\u002Fdiv>\n\n\u003Chr>\n\n\u003Cdiv align=\"center\">\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fbd744a7e-8e89-4531-bd96-fdee0030c390\n\n\u003C\u002Fdiv>\n\n\u003Chr>\n\n1. [The Problem](#the-problem)\n2. [What is mnem](#what-is-mnem)\n3. [Benchmarks](#benchmarks)\n4. [What you get](#what-you-get)\n5. [Install](#install)\n6. [Quickstart](#quickstart)\n7. [Integrate \u002F Unintegrate](#mnem-integrate---wire-into-any-agent-host)\n8. [Commands](#commands)\n9. [MCP Tools](#mcp-tools)\n10. [Python API](#python-api-mnem-py)\n11. [GraphRAG](#graphrag)\n12. [vs others](#compared-to-others)\n13. [When NOT to use](#when-not-to-use-mnem)\n14. [Docs](#documentation)\n15. [Contributing](#contributing)\n\n\u003Chr>\n\n## The Problem\n\n> **Who this affects:** If you use AI coding assistants (Claude Code, Cursor, Gemini CLI, etc.) or build software where an AI agent needs to remember things between sessions, this is the problem mnem solves.\n\n> **Every session starts from zero.**\n\n- **Sessions are isolated.** Plan a migration in Claude Code (an AI coding assistant). Open Cursor (another AI coding assistant) tomorrow. That agent has never heard of it.\n- **Memory you can't inspect isn't memory.** Something changed in your agent's context. You don't know what, when, or why. There's no log.\n- **Conventions rot in flat files.** Six engineers, six `AGENTS.md` files (agent configuration files many AI tools read automatically) diverging in silence. No merge, no history, no way to tell which is current.\n\n> Your codebase has git. Your agent's knowledge doesn't.\n\n\u003Chr>\n\n## What is mnem\n\n> **Not familiar with git or version control?** Git is software that saves numbered snapshots of your files over time - so you can track changes, undo mistakes, and collaborate. mnem does the same thing for your AI agent's knowledge: every write is a saved snapshot you can branch, diff, merge, or revert.\n\n**Git for AI Agent Knowledge.** A persistent, versioned knowledge layer for AI agents - with best or tied recall on every benchmark we tested (recall = fraction of correct results returned; higher is better).\n\nA **knowledge graph** is a searchable store of facts where entries can link to each other - think of it as a smart notebook your AI agent can write to and read from. For example: write \"the deploy window is Tuesdays 10-11 AM UTC\", link it to your release checklist, and later retrieve it by asking \"what's our deploy schedule?\" in plain English. (For those who want the technical term: facts are stored as nodes connected by typed relationship edges - `part_of`, `relates_to`, `depends_on`, etc.)\n\nSkills, decisions, and context live in a queryable graph stored in your project folder. Commit the `.mnem\u002F` directory and it moves with your code. Replace stale `.cursorrules` (Cursor's project-rules file) and `AGENTS.md` files with something your whole team can version, diff, and merge.\n\nRetrieval combines vector search (finds results by meaning, not just exact words - e.g. \"deploy schedule\" finds \"deploy window\"), keyword search (exact terms), and graph traversal (following links between entries) in one pass. Every query reports exactly how many tokens were consumed and what was filtered out - nothing is silently dropped. One binary (a single executable file), no server to run. Wire into Claude Code, Cursor, Gemini CLI, or any MCP (Model Context Protocol - a standard for giving AI tools access to external capabilities) host in one command; use it from the CLI, HTTP, or Python.\n\n> **For teams:** Commit `.mnem\u002F` alongside your code and every teammate's agents start from the same knowledge baseline. See [mnem push \u002F mnem pull](#10-mnem-push--mnem-pull--mnem-clone---sync-with-a-remote) for CI sync.\n\n## Benchmarks\n\n**Measured head-to-head against mem0 and MemPalace on six public datasets. mnem leads on five‡†; ties MemPalace on LongMemEval.**\n\n\u003Cdiv align=\"center\">\u003Cimg src=\"assets\u002Fbenchmarks\u002Fbenchmarks.svg\" alt=\"mnem public benchmarks\" \u002F>\u003C\u002Fdiv>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Methodology, footnotes, query speed, and reproduction steps\u003C\u002Fb>\u003C\u002Fsummary>\n\n> **Methodology:** mem0 numbers are our own reproduction under the same harness - mem0 does not publish R@K (Recall at top K - the fraction of correct answers returned in the top K results) headline scores on these datasets. MemPalace headline numbers are cross-verified under our harness. This is disclosed, not hidden: reproducible artifacts ship alongside the binary.\n\nDefault harness embedder: MiniLM-L6-v2 (a small pre-trained text model in ONNX format - ONNX is an open file format for AI models; you don't need to install anything separately), same bytes across all systems in each test. FinanceBench uses bge-large on all systems for fair comparison (see † footnote). No LLM rerank. Sample counts per run: LongMemEval 500 Q, LoCoMo full dataset (~1986 Q), ConvoMem 50\u002Fcategory, MemBench 100\u002Fconfig. All benchmarks use dense-only retrieval (no sparse\u002FBM25 lane). Reproduce: `bash benchmarks\u002Fharness\u002Frun_bench.sh`.\n\n\u003Csup>mem0 columns: our reproduction under the same harness (mem0 doesn't publish R@K headlines on these datasets). MemPalace columns: public headline numbers cross-verified under our harness. Raw artefacts: [`benchmarks\u002Fresults\u002Fv0.1.0\u002F`](benchmarks\u002Fresults\u002Fv0.1.0\u002F). † FinanceBench uses Ollama bge-large (1024-dim) on all systems; MemPalace shown at best configuration (bge-large direct ChromaDB); mem0 applies LLM memory extraction before storage. Pipeline note: mnem FinanceBench run used hybrid retrieval (`--hybrid-boost --query-expand`); MemPalace bge-large used pure vector retrieval - pipelines differ. Full methodology: [`benchmarks\u002Fresults\u002Fanalysis\u002Ffinancebench.md`](benchmarks\u002Fresults\u002Fanalysis\u002Ffinancebench.md). ‡ LoCoMo: mnem uses MAX-over-turn-hits session scoring (lenient); MemPalace uses per-turn aggregation (stricter) - scores reflect different evaluation methodology. See [`benchmarks\u002Fresults\u002Fanalysis\u002Flocomo.md`](benchmarks\u002Fresults\u002Fanalysis\u002Flocomo.md).\u003C\u002Fsup>\n\n### Query speed\n\n\u003Cdiv align=\"center\">\u003Cimg src=\"assets\u002Fbenchmarks\u002Fquery-speed.svg\" alt=\"mnem query speed\" \u002F>\u003C\u002Fdiv>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Reproduce\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\nmnem bench fetch longmemeval     # download datasets (one-time, 264 MB)\nmnem bench                       # TUI; select benchmarks interactively\nmnem bench run --benches longmemeval --limit 50 --non-interactive\nmnem bench results .\u002Fbench-out   # re-render results from a prior run\n\n# Legacy bash harness (canonical path for headline numbers)\nbash benchmarks\u002Fharness\u002Frun_bench.sh\n```\n\nMethodology, raw artifacts, per-bench breakdowns: [`benchmarks\u002F`](benchmarks\u002F) and [`docs\u002Fsrc\u002Fbenchmarks\u002F`](docs\u002Fsrc\u002Fbenchmarks\u002F).\n\n\u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n\u003Chr>\n\n## What you get\n\n\u003Csup>\u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"12\" height=\"12\" alt=\"unique\"> unique to mnem &nbsp;·&nbsp; \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"12\" height=\"12\" alt=\"rare\"> rare among peers\u003C\u002Fsup>\n\n| | | |\n|:---:|:---|:---|\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **Instantly build a knowledge graph from any file or codebase. No LLM call required.** Drop in source code, PDFs, Markdown docs, or conversation exports - mnem handles the rest. One command. 30+ file formats, parsed and indexed automatically. | [READ MORE](docs\u002Ffeatures\u002Frich-ingest.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **Branch, diff, and merge knowledge like git.** Every write is a versioned commit. Experiment on a branch, merge when ready - your knowledge graph has the same primitives as your codebase. | [READ MORE](docs\u002Ffeatures\u002Fversioned-memory.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **Replace flat agent files with a versioned, queryable graph.** `.cursorrules` and `AGENTS.md` can't be diffed or merged. mnem can - export yours, import a teammate's, merge the parts you want. | [READ MORE](docs\u002Ffeatures\u002Fskills-graph.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **See exactly what retrieval found, skipped, and cost.** Every query returns `tokens_used`, `candidates_seen`, and `dropped`. No silent truncation at your token budget. | [READ MORE](docs\u002Ffeatures\u002Ftoken-transparency.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **Same input, same output, any machine (storage layer).** Every piece of content gets a unique fingerprint based on its exact bytes. Store the same fact twice and mnem deduplicates it automatically - no matter which machine, which session, or which user ingested it. Retrieval results are ranked by approximate similarity and may vary slightly across runs. | [READ MORE](docs\u002Ffeatures\u002Fcontent-addressing.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Funique.svg\" width=\"18\" height=\"18\" alt=\"unique\"> | **Runs in a browser tab.** *(Advanced - skip if you're just using the CLI.)* The same binary runs in Chrome via WASM (WebAssembly - a way to run compiled code in a browser) and deploys in AWS Lambda (~40 MB). No Python, no external database. WASM bindings ship separately; see [`docs\u002Ffeatures\u002Fwasm-edge.md`](docs\u002Ffeatures\u002Fwasm-edge.md). | [READ MORE](docs\u002Ffeatures\u002Fwasm-edge.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"18\" height=\"18\" alt=\"rare\"> | **Best or tied recall on every benchmark we tested.** Leads on five of six public benchmarks (recall = fraction of correct results returned; higher is better). All numbers reproducible with the shipped harness. See [Benchmarks](#benchmarks) above for details. | [READ MORE](docs\u002Ffeatures\u002Fbenchmarks.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"18\" height=\"18\" alt=\"rare\"> | **Zero-config start, any provider after.** A small pre-trained text model runs automatically in-process (~40 MB binary total, no setup). Switch to Ollama, OpenAI, or Cohere with one line in `config.toml` (a simple key-value config file). | [READ MORE](docs\u002Ffeatures\u002Fproviders.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"18\" height=\"18\" alt=\"rare\"> | **CLI (command-line tool), HTTP (web API), MCP, and Python - one engine.** `mnem integrate` wires the MCP server into Claude Code, Cursor, Gemini CLI, and anything else speaking MCP. | [READ MORE](docs\u002Ffeatures\u002Fintegrations.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"18\" height=\"18\" alt=\"rare\"> | **One ~40 MB binary. Nothing else required.** No background service (daemon), no cloud, no account. Runs fully offline. Same binary powers the CLI and the HTTP server. | [READ MORE](docs\u002Ffeatures\u002Fsingle-binary.md) |\n| \u003Cimg src=\"assets\u002Flegend\u002Frare.svg\" width=\"18\" height=\"18\" alt=\"rare\"> | **API-free, deterministic ingestion.** No LLM call at index time. Same file always produces identical nodes - fully reproducible and audit-friendly. Re-ingest an unchanged file and get zero new nodes. | [READ MORE](docs\u002Ffeatures\u002Fdeterministic-ingest.md) |\n| | **Vector, keyword, and graph search in one pass.** Enable multi-hop traversal (following a chain of links across multiple connected entries) for queries that span documents; skip it for fast single-doc lookup. | [READ MORE](docs\u002Ffeatures\u002Fhybrid-retrieval.md) |\n\n\u003Chr>\n\n## Install\n\n**Prerequisites:** Check what you have: `python --version` \u002F `node --version` \u002F `cargo --version`. Don't have any? [Install Python](https:\u002F\u002Fwww.python.org\u002Fdownloads) or [Install Node.js](https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload) - both are free and include pip\u002Fnpm. For Cargo: [Install Rust via rustup](https:\u002F\u002Frustup.rs\u002F) (free, also installs `cargo`).\n\n> **Using Python to call mnem from your own app?** `pip install mnem-cli` gives you the `mnem` command-line tool. To import mnem from Python code (`import pymnem`), use `pip install mnem-py` instead - see [Python API](#python-api-mnem-py).\n\n**Pick one** (pip is recommended if you have Python):\n\n**pip (Python) - recommended** · pre-built binary, bundled embedder, works immediately\n\n```bash\npip install mnem-cli\n```\n\n**npm (Node.js)** · pre-built binary, bundled embedder, works immediately\n\n```bash\nnpm install -g mnem-cli\n```\n\n**Cargo (Rust)** · compiles from source, ~5-15 min first run\n\n```bash\n# Linux only: sudo apt-get install g++ (Debian\u002FUbuntu\u002FWSL)  or  sudo dnf install gcc-c++ (Fedora\u002FRHEL)\ncargo install --locked mnem-cli --features bundled-embedder\n```\n\n**Docker** · runs the HTTP server; no local install needed\n\n```bash\ndocker run --rm -p 9876:9876 -e MNEM_HTTP_ALLOW_NON_LOOPBACK=1 \\\n  ghcr.io\u002Furanid\u002Fmnem:latest http --bind 0.0.0.0:9876\n```\n\n```bash\nmnem --version    # confirm install\n```\n\n> **If `mnem: command not found`:** Try opening a new terminal first (PATH changes only take effect in new sessions). On Linux, pip installs to `~\u002F.local\u002Fbin` - if that's not in your PATH, run `export PATH=\"$HOME\u002F.local\u002Fbin:$PATH\"` then add that same line to `~\u002F.bashrc` (this is a one-time fix; the file change makes it permanent). On Windows: 1. Run `pip show mnem-cli`. 2. Copy the `Location` value (e.g. `C:\\Users\\you\\AppData\\Roaming\\Python\\Python312\\site-packages`). 3. Replace `site-packages` with `Scripts` to get the Scripts folder path. 4. Open System Properties → Environment Variables → Path → Edit → New → paste the Scripts path → OK. 5. Open a new Command Prompt - PATH changes require a new window to take effect.\n\n> [!NOTE]\n> `--locked` pins exact tested dependency versions. `--features bundled-embedder` packs the embedder (~40 MB) into the binary so `mnem retrieve` works immediately - no extra setup. **This flag is Cargo-only**; pip and npm ship with the embedder pre-baked. Without it (and without configuring another provider in `config.toml`), `mnem retrieve` fails with \"embedder not configured\".\n\n\u003Cdetails>\n\u003Csummary>Sample \u003Ccode>.mnem\u002Fconfig.toml\u003C\u002Fcode> (Ollama example)\u003C\u002Fsummary>\n\n```toml\n[embed]\nprovider = \"ollama\"\nmodel    = \"nomic-embed-text\"\nbase_url = \"http:\u002F\u002Flocalhost:11434\"\n```\n\nFull list of config keys: [`docs\u002Fsrc\u002Fconfiguration.md`](docs\u002Fsrc\u002Fconfiguration.md).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>macOS \u002F Linux\u003C\u002Fb>\u003C\u002Fsummary>\n\nNo Cargo? [Install via rustup](https:\u002F\u002Frustup.rs\u002F) (also installs `rustc`).\n\n```bash\n# C++ stdlib required to link the bundled ONNX Runtime (Linux only)\nsudo apt-get install g++          # Debian \u002F Ubuntu \u002F WSL\n# sudo dnf install gcc-c++        # Fedora \u002F RHEL\n```\n\n```bash\ncargo install --locked mnem-cli --features bundled-embedder\n\n# CUDA-accelerated embedder (Linux, NVIDIA GPU)\ncargo install --locked mnem-cli --features bundled-embedder-cuda\n```\n\nIf `mnem` is not found after install, `~\u002F.cargo\u002Fbin` is not on `$PATH`.\n\n**rustup install**: source the env (or open a new terminal):\n```bash\nsource ~\u002F.cargo\u002Fenv\n```\n\n**System Rust (apt\u002Fdnf)**: add to PATH permanently:\n```bash\necho 'export PATH=\"$HOME\u002F.cargo\u002Fbin:$PATH\"' >> ~\u002F.bashrc && source ~\u002F.bashrc\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Windows\u003C\u002Fb>\u003C\u002Fsummary>\n\nNo Cargo? [Install via rustup](https:\u002F\u002Frustup.rs\u002F) (also installs `rustc`).\n\n```powershell\ncargo install --locked mnem-cli --features bundled-embedder\n\n# DirectML-accelerated embedder (any GPU vendor on Windows)\ncargo install --locked mnem-cli --features bundled-embedder-directml\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>npm \u002F Node.js\u003C\u002Fb>\u003C\u002Fsummary>\n\nNo npm? [Install Node.js](https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload) (npm is bundled, Node 18+ required).\n\n```bash\nnpm install -g mnem-cli\nmnem --version\n\n# or without a global install (one-shot)\nnpx mnem-cli --version\n```\n\nDownloads the prebuilt native binary for your platform at install time. Node 18+ required. Bundled embedder included - no Ollama or API key needed.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>pip (PyPI)\u003C\u002Fb>\u003C\u002Fsummary>\n\nNo pip? [Install Python](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F) (pip is bundled with Python 3.4+).\n\n```bash\npip install mnem-cli\nmnem --version\n```\n\nShips the `mnem` binary as a manylinux \u002F macOS \u002F Windows wheel with the bundled embedder pre-baked.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Docker\u003C\u002Fb>\u003C\u002Fsummary>\n\nNo Docker? [Install Docker Desktop](https:\u002F\u002Fdocs.docker.com\u002Fget-started\u002Fget-docker\u002F).\n\n```bash\n# Ephemeral (data is lost when the container stops - for quick testing only):\ndocker run --rm -p 9876:9876 \\\n  -e MNEM_HTTP_ALLOW_NON_LOOPBACK=1 \\\n  ghcr.io\u002Furanid\u002Fmnem:latest http --bind 0.0.0.0:9876\n\n# Persistent (data survives restarts - recommended for any real use):\nmkdir -p .\u002Fmnem-data\ndocker run -p 9876:9876 \\\n  -v \"$(pwd)\u002Fmnem-data:\u002Fdata\" -w \u002Fdata \\\n  -e MNEM_HTTP_ALLOW_NON_LOOPBACK=1 \\\n  ghcr.io\u002Furanid\u002Fmnem:latest http --bind 0.0.0.0:9876\n# Windows (PowerShell): replace $(pwd) with ${PWD}; Windows (cmd.exe): replace $(pwd) with %cd%\n```\n\nThe image includes the bundled embedder. The `--bind 0.0.0.0:9876` flag and\n`MNEM_HTTP_ALLOW_NON_LOOPBACK=1` env var are required inside Docker so the\nport mapping (`-p 9876:9876`) works; the default loopback bind is unreachable\nfrom the host. Run `mnem mcp` inside the container for the MCP server surface.\n\n> **Fresh volume (no prior data):** If the mounted `\u002Fdata` directory has no `.mnem\u002F` present, `mnem http` auto-initializes a new graph on first start - no manual `mnem init` required. Subsequent restarts reuse the existing graph.\n\n> **Image tag pinning:** `ghcr.io\u002Furanid\u002Fmnem:latest` always points to the most recent release. For production deployments, pin to a specific version tag (e.g., `ghcr.io\u002Furanid\u002Fmnem:v0.1.0`) to avoid unexpected upgrades.\n\n> **⚠️ No authentication by default:** The examples above expose the API with no token. Anyone who can reach port 9876 can read and write your graph. Before binding to a non-loopback address, set `MNEM_HTTP_AUTH_TOKEN` on the server and `--token-env` on the client - see the Authentication section under `mnem push`\u002F`mnem pull`.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>From source\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# C++ stdlib required to link the bundled ONNX Runtime (Linux only)\nsudo apt-get install g++          # Debian \u002F Ubuntu \u002F WSL\n# sudo dnf install gcc-c++        # Fedora \u002F RHEL\n```\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FUranid\u002Fmnem\ncd mnem\ncargo install --path crates\u002Fmnem-cli --features bundled-embedder\n```\n\nRequires Rust 1.95+. If needed: `rustup install 1.95 && rustup default 1.95`.\n\n\u003C\u002Fdetails>\n\n```bash\nmnem --version\nmnem doctor        # checks embedder + store + config, prints a green\u002Fyellow\u002Fred checklist\n```\n\nFull install matrix: [`docs\u002Fsrc\u002Finstall.md`](docs\u002Fsrc\u002Finstall.md).\n\n> **Embedding mnem inside a Python app?** The `pip install mnem-cli` above ships the **CLI binary** as a wheel. The native **Python API** (`import pymnem`) lives in a separate package. Jump to **[Python API (mnem-py) ↓](#python-api-mnem-py)** for `pip install mnem-py` and snippets.\n\n\u003Chr>\n\n## Quickstart\n\n**Step 1: Try it now (standalone, no AI assistant needed)**\n\n```bash\nmkdir my-graph\ncd my-graph\nmnem init          # required once per project - creates the .mnem\u002F folder that stores your graph\nmnem ingest --text \"mnem is a versioned knowledge graph for AI agents\"\nmnem retrieve \"what does mnem do\"\n```\n\n> `mnem init` is required once per project before `mnem ingest` or `mnem retrieve` - it creates the `.mnem\u002F` folder. If something looks wrong, run `mnem doctor`.\n\nExpected output:\n```\n[1] score=0.94  mnem is a versioned knowledge graph for AI agents\n    tokens_used=12  candidates_seen=1  dropped=0\n```\n\n**Step 2 (optional): Wire your AI assistant**\n\n> **Prerequisite:** This example uses Claude Code. Don't have it? Download free at [claude.ai\u002Fcode](https:\u002F\u002Fclaude.ai\u002Fcode). No agent? Skip to \"Session 2\" - `mnem retrieve` works standalone.\n\n> **Working directory:** Open Claude Code from `my-graph\u002F` (or a subdirectory) after wiring - launching from a different folder means it won't find this graph.\n\n```bash\n# Session 1: add a fact and wire the agent\nmnem init     # skip if you already ran this in Step 1\nmnem ingest --text \"The API retry policy uses exponential backoff with a 3-attempt limit\"\nmnem integrate claude-code    # Cursor: use `mnem integrate cursor`\n\n# Session 2 (next day, new terminal): memory persists\ncd my-graph\nmnem retrieve \"what is our API retry policy\"\n```\n\nAfter `mnem integrate`, close and reopen the application (not just the terminal). To verify: open any session and send a message - you should see `mnem: N item(s)` before Claude replies. `0 item(s)` means the graph is empty but the integration is working.\n\n> **Local vs global graph:** `.mnem\u002F` in your project directory holds project-specific memory. `~\u002F.mnemglobal\u002F.mnem\u002F` (the global graph, where `~` means your home directory - e.g. `C:\\Users\\you` on Windows, `\u002Fhome\u002Fyou` on Linux\u002FmacOS) holds facts that span all your projects - personal preferences, shared team conventions, cross-repo entities. Use `mnem global retrieve` and `mnem global add` to target it.\n\n**Next steps:**\n- Ingest a file: `mnem ingest README.md` (or `mnem ingest your-docs\u002F --recursive` for a whole directory)\n- Wire your AI assistant: `mnem integrate` (Claude Code, Cursor, and more)\n- Ask anything: `mnem retrieve \"your question\"`\n\nFive minutes from zero. See [`docs\u002Fsrc\u002Fquickstart.md`](docs\u002Fsrc\u002Fquickstart.md) for the full walkthrough.\n\n\u003Chr>\n\n## `mnem integrate` - wire into any agent host\n\n> **Not using Claude Code, Cursor, or another AI coding assistant?** Skip this section - `mnem integrate` is only needed if you want one of those tools to pick up mnem automatically.\n\n> **Claude Code, Cursor, and similar tools must already be installed.** `mnem integrate` detects which are present - run `mnem integrate --check` first to see what's detected.\n\nOne command wires three things into your agent host: the **MCP server** (gives the agent access to mnem tools like `mnem_retrieve` and `mnem_commit`), the **auto-retrieval trigger** (runs `mnem retrieve` automatically before each of your messages so relevant memory is ready before the agent replies; Claude Code only - implemented as a \"UserPromptSubmit hook\"), and the **mnem system prompt** (tells the agent how to use mnem). Restart the host (close and reopen Claude Code or Cursor as an application, not just the terminal) and the agent starts using mnem automatically. To verify: start a new session and send any message - you should see a line like `mnem: 3 item(s): [...]` appear as a system message at the top of the conversation, injected before Claude speaks. `0 item(s)` is fine - it means the graph is empty; the integration is working.\n\n> **Troubleshooting:** Not seeing `mnem: N item(s)`?\n> - Make sure you closed and reopened the **application** (not just the terminal) - this means close the Claude Code or Cursor window entirely and relaunch it\n> - Open the application from inside the directory that contains your `.mnem\u002F` folder (or any subdirectory of it) - if you open Claude Code from a different folder, it won't find that project's graph\n> - Run `mnem doctor` to check the embedder and store are healthy\n> - Run `mnem integrate --check` to see if the host was wired correctly\n\n```bash\nmnem integrate                           # interactive: detect installed hosts and prompt\nmnem integrate claude-code               # wire a specific host, skip interactive detection\nmnem integrate --all                     # wire every detected host without prompting\n\nmnem integrate --check                   # report wired state for all hosts; nothing changes\nmnem integrate --dry-run                 # preview what would be written without changing anything\nmnem integrate --show claude-code        # print the MCP JSON block for manual copy-paste\n\nmnem integrate --no-hooks                # skip UserPromptSubmit hook wiring\nmnem integrate --no-system-prompt        # skip system prompt wiring\nmnem integrate --target-repo ~\u002Fnotes     # point the MCP server at a specific graph, not the global one\n```\n\n**What gets wired:**\n- **MCP server** (`mcpServers.mnem`) - the agent gets full mnem tool access via `mnem mcp --repo \u003Cgraph>`; defaults to the global graph (`~\u002F.mnemglobal\u002F.mnem`)\n- **Auto-retrieval trigger** (Claude Code only; implemented as a \"UserPromptSubmit hook\") - runs `mnem retrieve` before each of your messages so relevant memory is injected into context before the model ever sees your prompt\n- **System prompt** - mnem usage instructions injected into the host's project-rules file\n\nThe hook always queries your project's `.mnem\u002F` first (walking up from the current directory), then falls back to `mnem global retrieve` automatically. The hook and system prompt behave the same regardless of which default knowledge graph you choose during setup. Use `--target-repo` only if you want the MCP server to point somewhere other than the global graph.\n\nAuto-detects and configures:\n- Claude Code\n- Claude Desktop\n- Cursor\n- Continue\n- Zed\n- Gemini CLI\n\nAny other MCP-aware host works via a hand-edited `mcpServers` entry pointing at `mnem mcp --repo \u003Cpath>` - see [`docs\u002Fsrc\u002Fmcp.md`](docs\u002Fsrc\u002Fmcp.md).\n\nThe agent gets the full mnem toolset as native tools: retrieve, commit, ingest, tombstone, traverse, global graph access, and more. No extra daemon, no port to manage. Full tool reference: [`docs\u002Fsrc\u002Fmcp.md`](docs\u002Fsrc\u002Fmcp.md).\n\n\u003Cdetails>\n\u003Csummary>Remove mnem from a host\u003C\u002Fsummary>\n\n```bash\nmnem unintegrate                  # interactive: pick which hosts to remove mnem from\nmnem unintegrate claude-code      # remove one host\nmnem unintegrate --all            # remove all wired hosts\n```\n\nRun `mnem unintegrate --help` for all options.\n\n\u003C\u002Fdetails>\n\n\u003Chr>\n\n## Commands\n\n> **Quick glossary:** **node** = a single entry in the graph (a fact, document chunk, or entity - anything you store). **edge** = a typed link between two nodes (`depends_on`, `relates_to`, `part_of`, etc.). **CID** = content-addressed ID - a unique fingerprint based on exact bytes; every node, edge, and commit gets one. **HEAD** = the tip of the current op-log (most recent commit - same concept as in git). **op-log** = the append-only log of all write operations. **ref** = a named pointer to a commit CID (e.g. `refs\u002Fheads\u002Fmain` - same as a git branch or tag).\n\nEvery command accepts `--help` for the full flag reference. Full CLI reference: [`docs\u002Fsrc\u002Fcli.md`](docs\u002Fsrc\u002Fcli.md).\n\n---\n\n### 1. `mnem init` - Initialize a knowledge graph\n\nCreate a `.mnem\u002F` store in the current directory. Commit it alongside your codebase so every developer and agent starts from the same baseline.\n\n```bash\nmnem init\n```\n\n> **Example:** Your team ships an AI agent alongside an API service. Run `mnem init` once in the repo root - every engineer who clones the repo gets the same knowledge base their agents were trained on.\n\n\u003Cdetails>\n\u003Csummary>Health check and diagnostics\u003C\u002Fsummary>\n\n```bash\nmnem doctor    # probes embedder, store, config - green\u002Fyellow\u002Fred checklist\nmnem stats     # nodes, edges, refs, store size at a glance\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 2. `mnem ingest` - Add documents to the graph\n\nParse a file or directory into `Doc`, `Chunk`, and `Entity` nodes in a single pass. No LLM required at ingest - deterministic and audit-friendly: same bytes always produce the same CIDs (content-addressed IDs - a unique fingerprint computed automatically from the content bytes; every node, edge, and commit gets one).\n\n```bash\nmnem ingest architecture.md\nmnem ingest --recursive docs\u002F               # ingest an entire directory\n```\n\nFile type is auto-detected by extension: Markdown uses heading-aware chunking, source code (`.rs`, `.py`, `.ts`, `.go`, and more) uses Tree-sitter function\u002Fclass-level parsing, PDFs use sliding-window text extraction - all handled automatically with no flags.\n\n> **Example:** An agent onboarding to your platform ingests `ARCHITECTURE.md`, the `runbooks\u002F` directory, and all ADR files at startup. Every subsequent agent retrieves the same structured knowledge without re-reading each file from scratch.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem ingest --text \"Deploy window is Tuesdays 10-11 AM UTC\"  # ingest inline text without a file\nmnem ingest src\u002F --recursive                # ingest all source files under src\u002F\nmnem ingest --chunker recursive report.pdf  # PDF with explicit recursive chunking\nmnem ingest --extractor keybert notes.md    # keyphrase enrichment for stronger sparse retrieval\nmnem ingest --max-tokens 256 notes.md       # smaller chunks for fine-grained retrieval\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 3. `mnem add` - Write individual facts and relationships\n\nCommit a single fact node, or connect two entities with a typed edge. The lowest-level write primitive - use it when you want precise control over what goes into the graph. The optional `--label` tag (e.g. `Fact`, `Convention`, `Decision`) categorizes nodes so you can filter retrieval by type later.\n\n```bash\nmnem add node -s \"Deploy window is Tuesdays 10-11 AM UTC\"\n```\n\n> **Example:** Mid-conversation, an agent discovers an undocumented constraint. It commits the finding immediately so every downstream agent operates from the same shared truth - no more re-discovering the same edge case across sessions.\n\n\u003Cdetails>\n\u003Csummary>More write options\u003C\u002Fsummary>\n\n```bash\nmnem add node --label Fact -s \"The payments API uses idempotency keys for all POST requests\"\nmnem add node --label Convention -s \"All REST APIs are versioned under \u002Fv1\u002F\"\nmnem add edge --from \u003Cuuid> --to \u003Cuuid> --label depends_on        # connect two existing nodes\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>Read and delete nodes\u003C\u002Fsummary>\n\n```bash\nmnem get \u003Cuuid>                                                    # fetch a node by UUID\nmnem get \u003Cuuid> --content                                         # include full content body\n\nmnem tombstone \u003Cuuid>                                             # soft-delete: hidden from retrieval, kept in audit log\nmnem tombstone \u003Cuuid> --reason \"superseded by v2 decision\"        # record why\nmnem delete \u003Cuuid>                                                # hard-delete: no audit trail\n\nmnem global get \u003Cuuid>                                            # look up a node in the global graph\nmnem global tombstone \u003Cuuid>                                      # soft-delete in the global graph\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 4. `mnem retrieve` - Search the graph\n\nHybrid semantic + keyword + graph retrieval in a single pass. Returns exactly what it found, what it skipped, and how many tokens were used - no silent truncation at the token budget.\n\n```bash\nmnem retrieve \"what did we decide about the API rate-limit design\"\n```\n\n> **Example:** Three sprints later, a new engineer asks the agent \"why is our retry logic exponential?\" The agent retrieves the original decision node with the full rationale - without anyone having to remember to document it separately.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem -R ~\u002Fnotes retrieve \"query\"           # target a specific graph explicitly\nmnem retrieve \"...\" --limit 20             # return more results\nmnem retrieve \"...\" --graph-expand 20      # add multi-hop graph traversal\nmnem retrieve \"...\" --graph-expand 20 --community-filter --graph-mode ppr\nmnem retrieve \"...\" --rerank cohere:rerank-english-v3.0\nmnem retrieve \"...\" --vector-cap 512       # widen the dense candidate pool\nmnem retrieve \"...\" --explain              # print per-item lane scores (vector, sparse, graph_expand, rerank)\n```\n\nSee [GraphRAG](#graphrag) for the full flag reference.\n\n\u003C\u002Fdetails>\n\n---\n\n### 5. `mnem global` - Cross-project, cross-session memory\n\nA second graph at `~\u002F.mnemglobal\u002F.mnem\u002F` (where `~` is your home directory: `C:\\Users\\you` on Windows, `\u002Fhome\u002Fyou` on Linux\u002FmacOS) that follows agents everywhere - across repos, teams, and sessions. Use it for shared conventions, vendor decisions, and entities that appear in every project.\n\n```bash\nmnem global retrieve \"what payment provider do we use\"\nmnem global add node --label Convention -s \"All REST APIs are versioned under \u002Fv1\u002F\"\n```\n\n> **Example:** Your platform has a dozen microservices, each with its own `.mnem\u002F`. The global graph holds team-wide conventions, shared entity definitions, and cross-service decisions. Any agent on any service can query it without knowing which repo the fact originated from.\n\n\u003Cdetails>\n\u003Csummary>More options and local vs global guidance\u003C\u002Fsummary>\n\n```bash\nmnem global ingest contacts.md\nmnem global add node --label Entity:Person \\\n  --prop name=Alice -s \"Alice leads the infra team\"\nmnem global get \u003Cuuid>\nmnem global tombstone \u003Cuuid>\n```\n\n**When to use local vs global:**\n\n| Use local `.mnem\u002F` for | Use `mnem global` for |\n|------------------------|----------------------|\n| Project-specific facts, decisions, code context | People, preferences, facts that span all projects |\n| Per-repo memory that travels with the repo | Knowledge you want every session and every agent to see |\n| Anything you'd commit alongside the code | Cross-session continuity |\n\nThe `mnem integrate` command sets up the agent to read local first and fall back to global automatically - no manual switching required during normal use.\n\n\u003C\u002Fdetails>\n\n---\n\n### 6. `mnem status` \u002F `mnem log` - Inspect history\n\nSee the current state of the graph and walk the op-log backwards.\n\n```bash\nmnem status    # op-head CID, head commit, all named refs, label counts\nmnem log       # walk op-log backwards, last 20 entries\n```\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem stats              # compact one-liner: CIDs, ref count, label names\nmnem log -n 50          # show last 50 entries\nmnem log --oneline      # compact one-line-per-op format\nmnem log --format json  # machine-readable JSON stream\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 7. `mnem diff` \u002F `mnem show` - Compare snapshots and inspect blocks\n\nSee exactly what changed between any two op CIDs: ref deltas plus structural node\u002Fedge diff. Decode any block by CID for detailed forensics.\n\n```bash\nmnem log          # lists commits with their CIDs - copy a CID from here to use below\nmnem diff HEAD \u003Ccid>\n```\n\n> **Example:** An agent ran overnight and committed hundreds of new facts. Before merging into `main`, a reviewer diffs `HEAD` against the pre-run snapshot to confirm nothing unexpected was added or removed.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem diff \u003Cop-a-cid> \u003Cop-b-cid>   # diff any two ops\n\nmnem show               # decode and pretty-print the current op-head block\nmnem show \u003Ccid>         # decode any block by CID (Node, Edge, Commit, Operation, ...)\n\nmnem cat-file \u003Ccid>                # emit raw DAG-CBOR bytes for any block to stdout\nmnem cat-file \u003Ccid> --json         # decode to DAG-JSON and pretty-print (pipe into jq)\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 8. `mnem branch` - Create and manage branches\n\nBranch the knowledge graph the same way you branch code. Each branch is an independent line of commits - experiment freely, merge back when ready.\n\n```bash\nmnem branch create agentic-workflow\n```\n\n> **Example:** Two agents are testing competing approaches to a summarisation pipeline. Each works on its own branch - `approach-a` and `approach-b` - committing findings as it goes. A reviewer merges the winning branch back into `main`, preserving the full history of both experiments.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem branch list                        # list all branches; * marks current\nmnem branch create \u003Cname> \u003Cstart>       # branch from a ref, branch name, or CID\nmnem branch create \u003Cname> --from HEAD   # explicit --from form; same resolution as above\nmnem branch delete \u003Cname>               # delete a local branch pointer\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 9. `mnem merge` - Merge branches\n\n3-way graph merge - the same model as `git merge`, but for knowledge. Conflicts land in `.mnem\u002FMERGE_CONFLICTS.json` for explicit resolution.\n\n```bash\nmnem merge agentic-workflow\n```\n\n> **Example:** Agent A spent a week processing customer interviews; Agent B processed support tickets in parallel. Merging combines both knowledge bases cleanly - no fact is silently overwritten, and the full provenance of every node is preserved.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem merge \u003Cbranch> --strategy=ours     # auto-resolve: keep current side\nmnem merge \u003Cbranch> --strategy=theirs   # auto-resolve: take incoming side\nmnem merge \u003Cbranch> --dry-run           # preview outcome without persisting anything\nmnem merge --continue                   # finish after editing MERGE_CONFLICTS.json\nmnem merge --abort                      # cancel; restore HEAD from ORIG_HEAD\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 10. `mnem push` \u002F `mnem pull` \u002F `mnem clone` - Sync with a remote\n\nPush and pull a knowledge graph the same way you push and pull code. The wire format is standard CAR v1 (Content Addressed aRchive, an IPFS-compatible binary format).\n\n> **Before your first push**, register a remote: `mnem remote add origin \u003Curl>` where `\u003Curl>` is your server address - for example, `http:\u002F\u002Fmy-server:9876` or `https:\u002F\u002Fmnem.example.com` (see More options below for the full remote command list).\n>\n> **Running your own server?** On the target machine, set `MNEM_HTTP_ALLOW_NON_LOOPBACK=1` and run `mnem http --bind 0.0.0.0:9876`. The same binary that powers the CLI also serves over HTTP - no separate install or daemon needed. Then `mnem remote add origin http:\u002F\u002F\u003Cserver-ip>:9876` on the client side.\n>\n> **Authentication (bearer token):** By default, `mnem http` has no authentication. To secure push\u002Fpull, both the server and client must use the same token:\n> ```bash\n> # Server side: set the token and start the server\n> export MNEM_HTTP_AUTH_TOKEN=my-secret-token\n> MNEM_HTTP_ALLOW_NON_LOOPBACK=1 mnem http --bind 0.0.0.0:9876\n>\n> # Client side: register the remote pointing to an env var holding the same token\n> export MNEM_REMOTE_ORIGIN_TOKEN=my-secret-token\n> mnem remote add origin http:\u002F\u002Fmy-server:9876 --token-env MNEM_REMOTE_ORIGIN_TOKEN\n> mnem push   # exits 1 with \"authentication failed (HTTP 401)\" if token is wrong or missing\n> ```\n> The server rejects requests with a wrong or missing token with HTTP 401. Never hard-code the token value in commands - use environment variables. If `MNEM_REMOTE_ORIGIN_TOKEN` is unset or empty at push time, `mnem push` exits 1 with \"missing authentication token\" before making any network request.\n\n```bash\nmnem push          # push HEAD to origin\u002Fmain\nmnem pull          # fast-forward origin\u002Fmain into HEAD\n```\n\n> **Single-writer note:** `mnem push` and `mnem pull` acquire the write lock on the local store. If `mnem http` is running against the same store, the push will block until the server releases any in-progress write (it does not corrupt data, but it will wait). If you need a clean push without waiting, stop `mnem http` first. For concurrent CI pipelines writing to the same remote, use an external queue or separate repos merged with `mnem merge`.\n\n> **Example:** An agent running in CI commits new findings after each build and pushes. Agents on developer machines pull at session start - the whole team works from the same knowledge baseline without any manual sync.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem push \u003Cremote> \u003Cbranch>             # push a specific branch\nmnem pull \u003Cremote> \u003Cbranch>             # pull from a specific remote\u002Fbranch\n\nmnem fetch                              # fetch without merging (default remote)\nmnem fetch \u003Cremote>                     # fetch from a named remote\n\nmnem clone \u003Curl> [\u003Cdir>]                # clone a CAR archive into \u003Cdir>\nmnem clone file:\u002F\u002F\u002Ftmp\u002Frepo.car .\u002Fcopy  # clone from a local file path\nmnem clone .\u002Frepo.car .\u002Fcopy            # bare path shorthand (must end in .car)\n\nmnem remote add \u003Cname> \u003Curl>                         # register a remote\nmnem remote add \u003Cname> \u003Curl> \\\n  --token-env MNEM_REMOTE_ORIGIN_TOKEN               # supply the bearer token via env var\nmnem remote list                                     # list all configured remotes\nmnem remote show \u003Cname>                              # show URL + capabilities\nmnem remote remove \u003Cname>                            # remove a remote entry\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 11. `mnem query` - Structured graph queries\n\nExact-match property filter with optional edge traversal. No embedding computation needed - fast and deterministic.\n\n```bash\nmnem query --where name=Alice\n```\n\n> **Example:** An agent builds an org-chart from onboarding documents. Later, another agent runs `mnem query --where kind=Person --with-outgoing reports_to` to reconstruct the full reporting structure without a text search.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem query --where kind=Person -n 25             # increase result limit\nmnem query --where kind=Person \\\n  --with-outgoing knows                          # follow outgoing \"knows\" edges\nmnem query --where status=active \\\n  --with-outgoing depends_on \\\n  --with-outgoing depends_on                     # chain multiple hops\n\nmnem blame \u003Cnode-uuid>                           # list all incoming edges to a node\nmnem blame \u003Cnode-uuid> --etype authored          # filter to one edge type\nmnem blame \u003Cnode-uuid> --first-writer            # show oldest ancestor commit per edge (BFS)\n\n# mnem ref: manage named refs (branches\u002Ftags by CID)\nmnem ref list                         # list all refs (refs\u002Fheads\u002F*, refs\u002Fremotes\u002F*, ...)\nmnem ref set \u003Cname> \u003Ctarget-cid>      # point a ref at a specific commit CID\nmnem ref delete \u003Cname>                # delete a named ref\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 12. `mnem reindex` - Manage embeddings\n\nBackfill or update vector embeddings for nodes. Run after adding a new embedding provider or switching models.\n\n> **Running `mnem reindex` while `mnem http` is active?** `mnem reindex` is a write operation - it acquires the single-writer lock, so it waits until any in-progress write completes before starting. Ongoing HTTP reads (`mnem retrieve`) continue to work during reindex but may see stale embeddings until the reindex commit lands. Stop the HTTP server first if you need a consistent point-in-time snapshot.\n\n```bash\nmnem reindex\n```\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem reindex --label Doc              # restrict to nodes of one label\nmnem reindex --since \u003Ccommit>         # only nodes added\u002Fchanged after \u003Ccommit>\nmnem reindex --force                  # re-embed already-indexed nodes\nmnem reindex --dry-run                # count what would be embedded without calling the provider\n\nmnem embed --force                    # re-embed already-indexed nodes\nmnem embed --label Person             # restrict to nodes of this label\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 13. `mnem export` \u002F `mnem import` - Backup and restore\n\nExport any snapshot as a standard CAR v1 archive. Import it on any machine, any platform.\n\n```bash\nmnem export backup.car\n```\n\n> **Example:** Before a large batch ingest, export the current snapshot. If the ingest produces unexpected results, import the snapshot to restore the exact previous state.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem export -                              # write CAR to stdout (pipe over SSH)\nmnem export --from refs\u002Fheads\u002Fmain out.car # export from a specific ref\nmnem export --from \u003Ccid> backup.car        # export from a specific commit CID\n\nmnem import \u003Cpath>                         # import a CAR archive into the current repo\nmnem import -                              # read CAR from stdin\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 14. `mnem config` - Configure mnem\n\nSet author identity, embedding provider, and API endpoints. API keys live in environment variables - never written to disk.\n\n```bash\nmnem config set user.name \"ci-agent\"\nmnem config set embed.provider ollama\n```\n\n\u003Cdetails>\n\u003Csummary>All config keys\u003C\u002Fsummary>\n\n```bash\nmnem config set user.email agent@example.com\nmnem config set embed.model nomic-embed-text\nmnem config set embed.base_url http:\u002F\u002Flocalhost:11434\nmnem config get embed.provider\nmnem config unset embed.provider\nmnem config list\n```\n\nKnown keys: `user.name`, `user.email`, `user.key`, `user.agent_id`, `embed.provider`, `embed.model`, `embed.api_key_env`, `embed.base_url`.\n\n\u003C\u002Fdetails>\n\n---\n\n### 15. `mnem mcp` \u002F `mnem http` - Serve the graph\n\nExpose mnem as an MCP server (stdio, for agent hosts) or an HTTP JSON API (for services that call it directly).\n\n> **Note:** You rarely need to run `mnem mcp` directly. If you used `mnem integrate`, your AI host (Claude Code, Cursor, etc.) starts it automatically in the background whenever it needs mnem tools. Use `mnem http` when you want to call mnem from services or scripts over HTTP.\n\n```bash\nmnem mcp                 # start MCP JSON-RPC server over stdio\nmnem http                # start HTTP JSON API (loopback by default)\n```\n\n> `mnem http` runs in the foreground; press Ctrl+C to stop it. For a persistent background server, use your OS process manager (e.g., `nohup mnem http &` on Linux\u002FmacOS, or a Windows service wrapper).\n\n> **Concurrency:** `mnem http` supports any number of concurrent readers but only one writer at a time (the single-writer lock). If you need to run `mnem reindex` while `mnem http` is active, see [When NOT to use mnem](#when-not-to-use-mnem) for behavior details. For `mnem push`\u002F`mnem pull` during a live HTTP server, stop the server first or coordinate with an external queue.\n\n> **Example:** A backend service spins up `mnem http` at startup. Every agent in the cluster calls the same HTTP endpoint - shared knowledge, no per-instance local state required.\n\n\u003Cdetails>\n\u003Csummary>More options\u003C\u002Fsummary>\n\n```bash\nmnem mcp --repo ~\u002Fnotes            # point the MCP server at a specific graph\n\n# HTTP bind and networking\nmnem http --bind 127.0.0.1:9876    # default loopback bind\nmnem http --bind 0.0.0.0:9876      # expose on all interfaces (requires MNEM_HTTP_ALLOW_NON_LOOPBACK=1)\nmnem http --in-memory              # ephemeral in-memory store (no .mnem\u002F required)\nmnem http --metrics                # force \u002Fmetrics endpoint ON\nmnem http --no-metrics             # force \u002Fmetrics endpoint OFF\n\nmnem repos list                    # list all repos registered with mnem integrate\nmnem repos set-default \u003Cpath>      # mark a repo as the default without -R\nmnem repos prune                   # remove entries for paths that no longer exist\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### 16. `mnem completions` - Shell completions\n\nGenerate and install tab completions for your shell.\n\n```bash\n# bash (create the directory first if it doesn't exist):\nmkdir -p ~\u002F.local\u002Fshare\u002Fbash-completion\u002Fcompletions\nmnem completions bash > ~\u002F.local\u002Fshare\u002Fbash-completion\u002Fcompletions\u002Fmnem\n\n# zsh (create the directory first; also add fpath entry to ~\u002F.zshrc):\nmkdir -p ~\u002F.zsh\u002Fcompletions\nmnem completions zsh > ~\u002F.zsh\u002Fcompletions\u002F_mnem\n# Add to ~\u002F.zshrc if not already present:\n#   fpath=(~\u002F.zsh\u002Fcompletions $fpath); autoload -Uz compinit && compinit\n```\n\n\u003Cdetails>\n\u003Csummary>All shells\u003C\u002Fsummary>\n\n```bash\nmnem completions bash\nmnem completions zsh\nmnem completions fish\nmnem completions powershell\nmnem completions elvish\n```\n\n\u003C\u002Fdetails>\n\n---\n\n### Global flag: `-R \u003Cpath>`\n\nRedirect any command to a specific repository directory, bypassing the walk-up search from the current directory.\n\n```bash\nmnem -R ~\u002Fnotes status\nmnem -R ~\u002Fnotes log\nmnem -R ~\u002Fnotes retrieve \"query\"\n```\n\n\u003Chr>\n\n## MCP Tools\n\nWhen wired via `mnem integrate`, agents receive **22 native MCP tools** prefixed `mnem_` (21 stable + 1 feature-gated). Every response carries `_meta` with `bytes`, `latency_micros`, and `tokens_estimate` so callers can reason about their own cost. Writes propagate `agent_id` and `task_id` into commit metadata so provenance is always queryable.\n\n> **Start here:** Your agent will use `mnem_retrieve` and `mnem_commit` most of the time. The tables below are the complete reference - you don't need to configure each tool individually.\n\nStart the server: `mnem mcp --repo \u003Cpath>` (or let `mnem integrate` wire it automatically).\n\nFull reference: [`docs\u002Fsrc\u002Fmcp.md`](docs\u002Fsrc\u002Fmcp.md).\n\n### Introspection\n\n| Tool | Description |\n|------|-------------|\n| `mnem_stats` | Repository overview: op-head, head commit, ref summary, known labels. Cheap; call this first to orient an agent to a new graph. |\n| `mnem_schema` | Inspect node labels and edge predicates in the current commit. Use before writing queries or traversals to discover what's in the graph. |\n| `mnem_list_nodes` | Enumerate nodes at the current head, optionally filtered by label. Returns UUID + label + summary per node. |\n| `mnem_list_tags` | List all named tags (`refs\u002Ftags\u002F*`) in the repository. |\n| `mnem_recent` | Walk the op-log from HEAD backwards. Returns the last N operations with time, author, `agent_id`, `task_id`, and message. |\n\n### Retrieval\n\n| Tool | Description |\n|------|-------------|\n| `mnem_retrieve` | **Primary retrieval tool.** Hybrid semantic + sparse + graph search. Returns nodes pre-rendered to text plus `tokens_used` \u002F `dropped` \u002F `candidates_seen` metadata. Supports graph-expand, community filter, PPR, and cross-encoder rerank. |\n| `mnem_global_retrieve` | Same as `mnem_retrieve` but always targets the global graph (`~\u002F.mnemglobal\u002F.mnem\u002F`). Use for cross-project, cross-session memory. |\n| `mnem_search` | Exact-property match with optional edge traversal. Fast and deterministic - no embedding required. |\n| `mnem_vector_search` | Raw cosine-similarity nearest-neighbour search over stored node embeddings. Pass a model name and query vector; receive top-k matches. |\n| `mnem_get_node` | Fetch a single node by UUID. Returns full props, content size, and outgoing edge count. |\n| `mnem_traverse` | From a start node, list outgoing neighbours reachable via specified edge labels. |\n| `mnem_incoming_edges` | List all edges pointing to a node (reverse lookup). Equivalent to `mnem blame` in the CLI. |\n\n### Writes\n\n| Tool | Description |\n|------|-------------|\n| `mnem_commit` | Add nodes and\u002For edges as a single commit. Returns the new op-id, commit CID, and created node UUIDs. |\n| `mnem_commit_relation` | Compound write: resolve-or-create a subject node, resolve-or-create an object node, and connect them with a typed edge - all in one call. Prevents the duplicate-entity problem (see example below). |\n| `mnem_resolve_or_create` | Find-or-create a node by a primary-key property. If a matching `(label, anchor-property) == value` exists, its UUID is returned; otherwise a new node is committed. |\n| `mnem_ingest` | Ingest a file path or inline text as a `Doc + Chunk + Entity` subgraph. Accepts `{path: \"notes.md\"}` or `{text: \"...\", source: \"label\"}`. Chunker options: `auto`, `paragraph`, `recursive`, `sentence_recursive`, `session`, `structural`. |\n| `mnem_global_ingest` | Same as `mnem_ingest` but writes to the global graph. Use for documents that should be queryable across all sessions and projects. |\n| `mnem_global_add` | Write nodes and\u002For edges directly to the global graph. Use for shared entities (people, orgs, conventions) that appear across multiple projects. |\n\n`mnem_commit_relation` example - link two entities in one call:\n\n```json\n{\n  \"subject\": \"Alice\",\n  \"subject_kind\": \"Entity:Person\",\n  \"predicate\": \"works_at\",\n  \"object\": \"Globex\",\n  \"object_kind\": \"Entity:Organization\",\n  \"agent_id\": \"onboarding-agent\"\n}\n```\n\n### Deletes\n\n| Tool | Description |\n|------|-------------|\n| `mnem_tombstone_node` | Soft-delete: marks a node as forgotten. Hidden from retrieval by default, but the node CID and all prior commits remain intact for auditing. Use when a user says \"forget X\" or revokes consent. |\n| `mnem_global_tombstone_node` | Same as `mnem_tombstone_node` but operates on the global graph. |\n| `mnem_delete_node` | Hard-delete: removes the node from the current head commit. Prior commits that referenced it remain addressable. Use only when the goal is to free storage, not memory hygiene. |\n\n### Optional (feature-gated)\n\n| Tool | Description |\n|------|-------------|\n| `mnem_community_summarize` | Extractive Centroid + MMR (Maximal Marginal Relevance, diversity-promoting selection) summarizer over a caller-supplied set of node UUIDs. No LLM call - picks `k` sentences balancing proximity to the community centroid against diversity. Enabled via the `summarize` cargo feature. |\n\n\u003Chr>\n\n## Python API (mnem-py) - dense vector retrieval (v0.1.0)\n\n> **Package names:** `pip install mnem-py` (PyPI package name) · `import pymnem` (Python import name). These are two different names for the same library. `mnem-cli` (the CLI tool) and `mnem-py` (this Python library) are separate packages.\n\nUse `mnem-py` when you want to read and write a mnem graph directly from Python (3.8+) - without the CLI binary. Same retrieval engine, no Rust toolchain required (pre-built wheels ship for Linux, macOS, and Windows).\n\n> **v0.1.0 feature scope:** `mnem-py` currently supports **dense vector retrieval only**. Keyword search (BM25\u002FSPLADE) and graph traversal (`--graph-expand`, `--graph-mode ppr`) are not yet available from Python. If you need those, use the CLI (`mnem retrieve \"...\"`) or HTTP API (`mnem http`) instead - both work with the same on-disk graph that `mnem-py` writes to.\n\n```bash\npip install mnem-py\npip install sentence-transformers   # optional - or supply embeddings from OpenAI, Cohere, etc.\n```\n\n`mnem-py` stores and retrieves by **dense vector**: you compute embeddings in Python and pass them to mnem.\n\n> [!WARNING]\n> `MODEL_NAME` at retrieve time must match `MODEL_NAME` at ingest time. **A mismatch silently returns zero results** - no exception is raised. `add_embedding_f32` must immediately follow its paired `add_node` call; calling it before `add_node` raises an error.\n> **To recover from a model mismatch:** run `mnem reindex` from the CLI (or `mnem reindex --label \u003Clabel>`) after configuring the correct model in `.mnem\u002Fconfig.toml` - this rebuilds embeddings for all matching nodes without changing node content.\n\n```python\nimport pymnem\nfrom sentence_transformers import SentenceTransformer\n\nmodel = SentenceTransformer(\"all-MiniLM-L6-v2\")   # downloaded once, ~23 MB\nMODEL_NAME = \"all-MiniLM-L6-v2\"                    # must match at both ingest and retrieve time\n\n# open_or_init: creates .mnem\u002F inside \"my-graph\u002F\" if it doesn't exist (no `mnem init` needed)\n# This replaces the `mnem init` step from the CLI quickstart - you do NOT run mnem init separately.\n# PATH TRAP: \"my-graph\u002F\" is relative to your working directory when Python runs.\n# Running this script from a different directory opens (or creates) a different graph.\n# Use an absolute path to avoid this: pathlib.Path.home() \u002F \"my-graph\"\n# init_memory(): in-memory only - data is lost when the process exits; useful for tests\nrepo = pymnem.Repo.open_or_init(\"my-graph\u002F\")\n\n# transaction(author, message): both required strings; author labels who wrote the commit, message is a note\nwith repo.transaction(author=\"agent\", message=\"seed\") as tx:\n    for text in [\"Alice lives in Berlin\", \"Bob moved to Paris\"]:\n        tx.add_node(ntype=\"Memory\", summary=text)  # ntype here = --label in the CLI (e.g. mnem retrieve --label Memory)\n        tx.add_embedding_f32(MODEL_NAME, model.encode(text).tolist())  # must immediately follow add_node\n\n# token_budget: approx. token count cap on returned summaries (mnem stops adding results when budget is reached)\n# result is a RetrieveResult - iterable over items AND has .tokens_used \u002F .tokens_budget attributes\nquery_vec = model.encode(\"Alice Berlin\").tolist()\nresult = repo.retrieve(vector=query_vec, model=MODEL_NAME, token_budget=500, limit=5)\nfor item in result:\n    print(f\"{item.score:.3f}  {item.summary}\")\nprint(f\"tokens_used={result.tokens_used}  tokens_budget={result.tokens_budget}\")  # no silent truncation\n```\n\n> **Any embedding model works.** Swap `SentenceTransformer(\"all-MiniLM-L6-v2\")` for any model that returns a fixed-length float list and use the same `MODEL_NAME` string at both ingest and retrieve time. For example, with OpenAI: `vec = openai.OpenAI().embeddings.create(input=text, model=\"text-embedding-3-small\").data[0].embedding` - set `MODEL_NAME = \"text-embedding-3-small\"`. Cohere and any local HuggingFace model work the same way.\n\nFull API surface - `query`, `update_node`, `delete_node`, on-disk persistence, label filtering: [`crates\u002Fmnem-py\u002FREADME.md`](crates\u002Fmnem-py\u002FREADME.md) or [view on GitHub](https:\u002F\u002Fgithub.com\u002FUranid\u002Fmnem\u002Ftree\u002Fmain\u002Fcrates\u002Fmnem-py).\n\n\u003Chr>\n\n## GraphRAG (Advanced)\n\nGraphRAG extends vector search with graph traversal: follow edges to related nodes, cluster into communities, score by graph distance. One flag per stage, opt-in per query. Vector alone handles most queries - enable graph stages for multi-document or multi-hop questions.\n\n### Stages and flags\n\n| Stage | Flag | What it does |\n|-------|------|------|\n| **Vector lane** | always on | Approximate nearest-neighbor index over per-commit dense embeddings. Configure model via `config.toml`. |\n| **Sparse lane** | config-driven | BM25 + SPLADE keyword scoring, fused with vector results. Enabled by `[sparse]` block in `config.toml`. |\n| **Vector candidate pool** | `--vector-cap \u003CN>` | Lift the dense pool size from default 256. Higher = better long-tail recall, +cost. |\n| **Result limit** | `--limit \u003CN>` | Final returned set (no limit by default). Short form: `-n`. |\n| **Graph expansion** | `--graph-expand \u003CN>` | Add N neighbours of top-K seeds via authored edges. Audit-recommended default `20` when graph is on. |\n| **Graph mode** | `--graph-mode \u003Cdecay\\|ppr>` | `decay` (default) weights by hop distance. `ppr` uses Personalised PageRank; better multi-hop recall, higher cost. |\n| **Community filter** | `--community-filter` | Cluster content; drop low-coverage clusters before fusion. |\n| **KeyBERT extraction** | `mnem ingest --extractor keybert` | Keyphrase extraction at ingest time; boosts sparse and community signals. |\n| **Summarisation** | `--summarize` | Centroid + MMR summary of the top-K, with diversity. |\n| **Cross-encoder rerank** | `--rerank \u003Cprovider:model>` | Post-fusion reorder. Supports `cohere:rerank-english-v3.0`, `voyage:rerank-1`, local. |\n\n### Quick examples\n\n```bash\n# Dense baseline\nmnem retrieve \"what does this project do\"\n\n# Add multi-hop graph traversal\nmnem retrieve \"...\" --graph-expand 20\n\n# Full stack: graph-expand + community-filter + PPR + rerank\nmnem retrieve \"...\" --graph-expand 20 --community-filter --graph-mode ppr --rerank cohere:rerank-english-v3.0\n\n# Stack a cross-encoder reranker on top\nmnem retrieve \"...\" --graph-expand 20 --community-filter --rerank cohere:rerank-english-v3.0\n\n# Ingest with KeyBERT keyphrase enrichment (strengthens sparse + community signals)\nmnem ingest --extractor keybert notes.md\n```\n\n### When to enable\n\n- **Single-document corpus, simple queries**: leave graph off, vector search alone is enough\n- **Multi-hop \u002F compositional questions**: `--graph-expand 20`\n- **Long history with cross-document references**: add `--community-filter`\n- **Recall ceiling needed**: stack `--rerank` on top\n- **Keyphrase-enriched ingest**: `mnem ingest --extractor keybert` at ingest time\n\nFull retrieval architecture: [`docs\u002Fsrc\u002Fcli.md`](docs\u002Fsrc\u002Fcli.md) (retrieve flags)\n\n\u003Chr>\n\n## Compared to others\n\n\u003Csup>✅ full support &nbsp;·&nbsp; ~ partial or limited &nbsp;·&nbsp; ✗ not supported &nbsp;·&nbsp; n\u002Fa not applicable\u003C\u002Fsup>\n\n|  | **mnem** | **mem0** | **Graphiti** | **Letta** | **Supermemory** | **MemPalace** | **Cognee** |\n|--|:--------:|:--------:|:------------:|:---------:|:---------------:|:-------------:|:----------:|\n| Local-first \u002F offline | ✅ | ~ | ✗ | ~ | ✗ | ✅ | ~ |\n| Versioned history | ✅ | ✗ | ✗ | ~ | ✗ | ✗ | ✗ |\n| Branch & merge | ✅ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |\n| Content-addressed storage *(same content always gets the same ID; auto-deduplicates identical facts)* | ✅ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |\n| WASM \u002F edge deployable | ✅ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |\n| API-free ingest | ✅ | ~ | ✗ | ✗ | ✗ | ✅ | ~ |\n| Token-budget transparency | ✅ | ✗ | ✗ | ~ | ✗ | ✗ | ✗ |\n| Single binary, no daemon | ✅ | ✗ | ✗ | ✗ | n\u002Fa | ✗ | ✗ |\n| No external DB required | ✅ | ~ | ✗ | ✗ | n\u002Fa | ✗ | ~ |\n| Knowledge graph | ✅ | ~ | ✅ | ✗ | ✗ | ~ | ✅ |\n| Hybrid retrieval (vector + sparse + graph) | ✅ | ~ | ✅ | ~ | ~ | ~ | ~ |\n| MCP native | ✅ | ~ | ~ | ✅ | ✅ | ✅ | ~ |\n| Open source | Apache-2.0 | Apache-2.0 | Apache-2.0 | Apache-2.0 | MIT | MIT | Apache-2.0 |\n\n\u003Csup>~ = partial or limited &nbsp;·&nbsp; mem0 knowledge graph: graph memory added in v1.1+ (Neo4j or in-memory) &nbsp;·&nbsp; Graphiti requires Neo4j, FalkorDB, or Kuzu (Kuzu is embedded); LLM API key required for ingestion &nbsp;·&nbsp; Letta defaults to SQLite locally; PostgreSQL required for production &nbsp;·&nbsp; MemPalace requires ChromaDB &nbsp;·&nbsp; Supermemory enterprise self-host requires Cloudflare + Postgres + OpenAI &nbsp;·&nbsp; Cognee uses Kuzu + LanceDB (both embedded); LLM API key required for graph extraction &nbsp;·&nbsp; Last verified: May 2026\u003C\u002Fsup>\n\nDeeper comparisons:\n\n- [mnem vs mem0](docs\u002Fsrc\u002Fcomparisons\u002Fmem0.md) - agent memory layer, OSS leader\n- [mnem vs MemPalace](docs\u002Fsrc\u002Fcomparisons\u002Fmempalace.md) - benchmark peer\n- [mnem vs Graphiti](docs\u002Fsrc\u002Fcomparisons\u002Fgraphify.md) - AI coding assistant knowledge graph tool\n- [mnem vs Letta](docs\u002Fsrc\u002Fcomparisons\u002Fletta.md) - agent-memory framework (formerly MemGPT)\n- [mnem vs Supermemory](docs\u002Fsrc\u002Fcomparisons\u002Fsupermemory.md) - cloud-hosted memory service\n- [mnem vs Cognee](docs\u002Fsrc\u002Fcomparisons\u002Fcognee.md) - KG-for-agents alternative\n\nFull matrix: [`docs\u002Fsrc\u002Fcomparisons\u002FREADME.md`](docs\u002Fsrc\u002Fcomparisons\u002FREADME.md).\n\n\u003Chr>\n\n## When NOT to use mnem\n\n> **v0.1.0 maturity note:** mnem is pre-1.0. The CLI commands, MCP tool names, and Python bindings are stable for v0.1.x; the on-disk store format is forward-compatible. Breaking changes may occur across minor versions - check the [CHANGELOG](CHANGELOG.md) before upgrading in production.\n\n- **You need transactional OLTP** (Online Transaction Processing - databases designed for row-level INSERT\u002FUPDATE\u002FDELETE at high volume, like a payments ledger or inventory system). mnem is append-only with versioned history; row-level UPDATE\u002FDELETE semantics aren't the model.\n- **You need sub-50 ms cloud-scale retrieval at 10k+ QPS** (queries per second). mnem is local-first. Multi-region sharded retrieval is on the roadmap, not in v1.\n- **You need concurrent multi-writer access.** The redb store is single-writer (ACID = Atomic, Consistent, Isolated, Durable; crash-safe via copy-on-write B-trees) - one writer at a time, multiple concurrent readers. Two concurrent writers will not corrupt data (the second write blocks until the first releases the lock), but neither will they merge automatically. Concurrent agent writes need an external queue or separate repos merged via `mnem merge`.\n\n> Looking for hosted memory, multi-region replicas, shared graphs across teams, or a managed remote layer? A sibling project bringing those to mnem is in active development - watch this space.\n\n\u003Chr>\n\n## Crates\n\n| Crate | Role |\n|-------|------|\n| [`mnem-cli`](crates\u002Fmnem-cli) | `mnem` binary - one command for everything |\n| [`mnem-core`](crates\u002Fmnem-core) | graph model, retrieval, indexing, sidecars |\n| [`mnem-http`](crates\u002Fmnem-http) | HTTP JSON server |\n| [`mnem-mcp`](crates\u002Fmnem-mcp) | MCP server (stdio) |\n| [`mnem-py`](crates\u002Fmnem-py) | PyO3 Python bindings |\n| [`mnem-embed-providers`](crates\u002Fmnem-embed-providers) | ONNX bundled, Ollama, OpenAI, Cohere |\n| [`mnem-sparse-providers`](crates\u002Fmnem-sparse-providers) | BM25, SPLADE-onnx |\n| [`mnem-rerank-providers`](crates\u002Fmnem-rerank-providers) | Cohere, Voyage |\n| [`mnem-llm-providers`](crates\u002Fmnem-llm-providers) | OpenAI, Anthropic, Ollama |\n| [`mnem-ingest`](crates\u002Fmnem-ingest) | parse + chunk + extract pipeline |\n| [`mnem-extract`](crates\u002Fmnem-extract) | entity extraction (KeyBERT, statistical NER) |\n| [`mnem-ner-providers`](crates\u002Fmnem-ner-providers) | NER provider trait + built-in providers (`RuleNer`, `NullNer`) |\n| [`mnem-bench`](crates\u002Fmnem-bench) | benchmark harness (LongMemEval, LoCoMo, etc.) |\n| [`mnem-graphrag`](crates\u002Fmnem-graphrag) | community summarisation, centroid + MMR |\n| [`mnem-ann`](crates\u002Fmnem-ann) | HNSW wrapper |\n| [`mnem-backend-redb`](crates\u002Fmnem-backend-redb) | redb-backed store |\n| [`mnem-transport`](crates\u002Fmnem-transport) | CAR codec + remote framing |\n\n\u003Chr>\n\n## Documentation\n\n- [Quickstart](docs\u002Fsrc\u002Fquickstart.md) - five-minute walkthrough\n- [Install](docs\u002Fsrc\u002Finstall.md) - per-platform install matrix\n- [CLI reference](docs\u002Fsrc\u002Fcli.md) - every subcommand and flag\n- [MCP server](docs\u002Fsrc\u002Fmcp.md) - tools exposed, client wiring\n- [Core concepts](docs\u002Fsrc\u002Fcore-concepts.md) - CIDs, commits, labels\n- [Configuration](docs\u002Fsrc\u002Fconfiguration.md) - env vars, config.toml\n- [Benchmarks methodology](docs\u002Fsrc\u002Fbenchmarks\u002Fmethodology.md)\n- [Reproduce benchmarks](docs\u002Fsrc\u002Fbenchmarks\u002Freproduce.md)\n- [Embedding providers](docs\u002Fsrc\u002Fguides\u002Fembed-providers.md)\n- [Migrations](docs\u002Fsrc\u002Fmigrations\u002F)\n- [GitHub Issues](https","mnem 是一个为知识图谱设计的版本控制系统，类似于Git，但专用于管理AI代理的记忆。它支持离线运行，并且不需要大型语言模型（LLM）。该项目使用Rust编写，提供了持久化、版本化的知识存储功能，通过混合GraphRAG检索技术增强了信息检索效率。核心特性包括本地优先的数据存储方式、向量搜索以及对多平台的支持。适用于需要在不同会话间保持上下文连续性的AI辅助工具开发场景，如代码助手等，能够有效解决记忆不可见、配置文件分散等问题，确保知识的一致性和可追溯性。",2,"2026-06-11 03:31:07","CREATED_QUERY"]