memnos

Git-aware, bi-temporal memory for AI coding agents — shared across Claude Code, Cursor, Codex & Windsurf on a single Postgres.
uv tool install memnos
memnos setup && memnos start # zero-Docker embedded Postgres + pgvector (~25 MB)
memnos init # hydrate CLAUDE.md rules + 90d git history in <5s
memnos agent-setup all # wire hooks + MCP into Claude Code, Cursor, Codex, Windsurf
Why Developers Use memnos Daily
- Git-Anchored Provenance (
code_anchors) — Links decisions and fixes to exact (file_path, blob_sha, identifiers). When a referenced symbol changes or a file is deleted, recall automatically warns (code changed: <file> modified since recorded) instead of feeding stale advice to your agent.
- Bi-Temporal Supersession — When your architecture or config changes,
memnos closes out (valid_to) the old fact instead of piling up contradictory notes. Zero LLM calls on the recall path (<50ms hybrid RRF + ONNX cross-encoder rerank).
- Structured Fix Memory (
memnos fix / record_fix) — Capture Symptom / Cause / Fix / Verify debugging solutions that automatically receive a bounded rank boost when a future session hits a matching stack trace or error.
- 5-Second Cold-Start Repo Hydration (
memnos init) — Ingests CLAUDE.md / AGENTS.md / .cursorrules as verbatim pinned constraints and your last 90 days of git log commits with zero LLM cost.
- Multi-Agent Coordination & Auditable Recall (
memnos explain) — Built-in agent sessions, pub/sub channels, work-item leases, XML-escaped <memnos:peer_memory> untrusted data envelopes for cross-agent safety, and memnos explain to inspect every pinned constraint, score, and latency stage injected into your prompt.
| Capability |
CLAUDE.md / .cursorrules |
Generic Vector Memory (mem0 / Supermemory) |
memnos |
| Setup & Infra |
Manual markdown file |
Cloud API or multi-DB stack (Vector + Graph) |
1 command (uv tool install memnos, embedded PG) |
| When Facts Change |
Manual edits or stale rules |
Returns both old & new facts as equals |
Bi-temporal supersession (valid_to + stale-turn demotion) |
| When Code Changes |
Silently drifts from code |
No git or symbol awareness |
code_anchors (blob_sha + symbol diff drift alerts) |
| Query-Time LLM Cost |
$0 (loads entire file every turn) |
Often requires LLM rerank/summarization |
$0 / 0 LLM calls (hybrid vector+BM25 + local ONNX rerank) |
| Multi-Agent Bus |
None |
None |
Sessions, pub/sub channels, inbox, leases & peer envelopes |
It doesn't just remember — it knows what's true now: when a new fact contradicts an
old one, bi-temporal supersession closes the old fact out, and recall shows the transition.
Your AI remembers your repo. memnos remembers your team.
CLAUDE.md, Cursor rules, native model memory — all genuinely useful, and all the same
shape: local and per-developer. They sit on one machine, scoped to one repo or one
person's chat history. The knowledge that actually gets lost is between developers: the
decision a teammate made three sprints ago and why, the constraint nobody wrote down. That
never reaches the next engineer's agent.
memnos is one shared, governed memory the whole team's agents read and write — so a fact
one developer's agent learns is recallable by everyone else's, correctly attributed.
Two separate Claude Code agents — different processes, different tokens, same
namespace (ns=team:eng). Alice's agent decides an auth approach; Bob's fresh agent (which
never saw her session) recalls it attributed by dev-alice and adds a constraint;
Alice's next turn picks up Bob's constraint, attributed by dev-bob. Bidirectional
shared memory across two real agents — server-stamped authorship (clients can't spoof it),
on your own Postgres, no LLM at recall time.
The same proof at the CLI level, two memnos sessions on one namespace:
Dev Bob's recall returns the decision Dev Alice stored, attributed by dev-alice — one
governed namespace, attribution stamped by the server, not the payload.
How memory gets captured is honest about its limits: deterministic both-sides on Claude
Code (lifecycle hooks) and on any base-URL-configurable client via memnos proxy; MCP
capture is discretionary (the model chooses when to call the tools); ChatGPT and Claude
Desktop can't be cleanly auto-captured (no base-URL override, no cert MITM) — MCP is the
path there. Details in Integrations.
The concept (the gap, and why attribution must be server-stamped) is in
docs/team-memory.md; standing up one shared host with a scoped
token per developer is in docs/guides/team.md.
Quickstart
Install into an isolated environment (uv recommended; pipx works too — don't
pip install into your system Python):
uv tool install memnos # no uv? brew install uv or
# curl -LsSf https://astral.sh/uv/install.sh | sh
memnos setup # ← zero external dependencies by default: downloads embedded
# PG + pgvector (~20-30 MB, macOS arm64 / Linux x86_64 /
# Windows x86_64) — no Docker, no brew, no apt
# or: memnos setup --external (connect to YOUR existing Postgres)
# or: memnos setup --docker (spin up a pgvector container)
memnos start # background server on http://127.0.0.1:8900
memnos app # launch native MEMNOS Desktop workspace
Bare memnos setup downloads a pre-built PostgreSQL 16 + pgvector binary into
~/.memnos/embedded_pg/ on first run (same as the explicit memnos setup --embedded —
the flag still works, it's just the default now). No Docker, no brew, no apt — just
uv tool install and you're done. memnos start auto-restarts the embedded PG on every boot.
On a platform without an embedded build (anything other than the three above), it falls
back to the original interactive wizard automatically — --docker/--external always work
everywhere regardless.
Operate it like any daemon: memnos status / stop / restart; memnos serve runs in
the foreground for systemd/launchd/Docker; memnos upgrade updates in place;
memnos autostart installs a login service so the server survives reboots.
During first-time setup (memnos setup), memnos asks you in plain English to choose one
embedding mode before answering any queries (no silent background downloads or half-working
state):
- Use my own OpenAI key — fastest setup, nothing to download; memory and query text is
sent to OpenAI (
text-embedding-3-small, 1536-d, key stored AES-256-GCM encrypted in Vault).
- Run it on this computer — private and free (nothing leaves your machine); requires a
one-time download of ~1 GB (~930 MB) for the local multilingual neural embedding
(
intfloat/multilingual-e5-small, 384-d) and cross-encoder reranker
(cross-encoder/mmarco-mMiniLMv2-L12-H384-v1) models (in CI/headless mode, confirm
explicitly via memnos setup embeddings --local --yes or memnos models pull --yes).
For fact extraction without OpenAI, set MEMNOS_EXTRACT_BASE_URL to any OpenAI-compatible
endpoint (Ollama / vLLM / LM Studio). You can switch between OpenAI and local embeddings
anytime with memnos migrate-embeddings, which (like memnos upgrade and memnos backup)
automatically takes and verifies a full 0600 PostgreSQL backup (pg_dump + pg_restore --list)
before touching data. Embedded PostgreSQL installs (memnos setup) bundle pg_dump and
pg_restore automatically under ~/.memnos/embedded_pg; for Docker or external PostgreSQL
hosts without client tools on PATH, install libpq / postgresql-client (or point
MEMNOS_PG_BIN at your PostgreSQL bin/ folder).
Extraction depends on who is speaking. Every turn is stored verbatim and stays searchable.
From your own messages, memnos extracts decisions, preferences, rules, plans and personal
facts. From the assistant's replies, it keeps only decisions, concrete outcomes,
identifiers (PR/issue numbers, versions, SHAs, hosts) and explicit state changes, capped
per reply by MEMNOS_ASSISTANT_FACT_CAP (default 6). A fact the assistant repeats is not
counted as corroboration. To store facts about you under your name rather than a generic
"user", set MEMNOS_USER_NAME, for example MEMNOS_USER_NAME="Ada Lovelace".
Full walkthrough: QUICKSTART.md · Windows:
docs/guides/windows.md · everything else: memnos --help.
What makes it different
- Namespaces with real access control. Every memory lives in a namespace (
user:alice,
team:eng, proj:api). Each person and each agent gets its own token, and a token reaches
only the namespaces it was granted (read, write, or both) — checked on the server, not
suggested in a prompt. Authorship is stamped from the authenticated token, so a request body
can't claim to be someone else (author in the payload is ignored; tested). Tokens are
individually revocable, and every call is audit-logged. Other memory layers scope with ids
the caller passes on each request (mem0's user_id/agent_id/app_id/run_id are filters,
per its docs) and enforce access at the project or key-owner level; memnos enforces it per
namespace, per principal. See memnos.net/compare
for the sourced, dated comparison.
- It knows what's true now. Facts are bi-temporal (when it happened vs. when memnos
learned it). Single-valued facts (
lives_in, works_at) supersede on contradiction —
by rule, not by asking an LLM — so "where do I live?" returns the current answer, with
the old one closed out, dated, and still auditable.
- One engine. Everything lives in a single PostgreSQL + pgvector — no second vector
store, no graph database to run, scale, secure, or back up.
- No LLM at query time. Recall is one embedding lookup (fully on-device in local
mode), hybrid search (pgvector HNSW + BM25, fused with RRF), a local ONNX cross-encoder
rerank, then quota/timeline/entity guarantees. No generative call — fast, cheap,
deterministic.
- Governed by default. Token auth, namespace ACLs, audit log, usage/cost ledger,
server-stamped author attribution, and an encrypted secret vault with ingest
redaction — in the open-source build, not an enterprise tier.
- Vendor-neutral, self-hosted. Apache-2.0, your Postgres, your data, your LLM keys
(never stored in plaintext). The REST API is an OpenAPI 3.1 contract enforced in CI;
the CLI is smoke-tested on Linux, macOS, and Windows on every push.
memnos is a governed memory engine, not an agent runtime. A detailed, version-pinned
comparison with other memory systems lives at
memnos.net/compare.
Integrations
Claude Code — install as a plugin (no tokens written into your config):
uv tool install memnos && memnos setup # embedded Postgres by default, no Docker
claude plugin marketplace add thameema/memnos && claude plugin install memnos@memnos
memnos claude-setup # creates your scoped token once; removes old baked-in hooks
The plugin supplies auto recall/save hooks, the MCP tools and /memnos:memnos. Hooks and the
MCP server read your token from ~/.memnos/config.json (a scoped per-user token, created once
and reused), so rotating a token is one file, not four. Don't skip the last line: without it
the plugin falls back to the admin token (writes are attributed to admin, not you), and any
hooks an earlier claude-setup wrote into settings.json would run alongside the plugin's and
recall twice per prompt (claude-setup removes them, backups kept). GUI launches with a minimal
PATH can't find memnos; use memnos claude-setup without the plugin there (it writes an
absolute path).
One command wires memnos into any other agent — no manual config editing:
memnos agent-setup claude-code # Claude Code: MCP + hooks (auto recall/save) + /memnos
memnos agent-setup claude-desktop # Claude Desktop
memnos agent-setup codex # Codex CLI
memnos agent-setup cursor # Cursor
memnos agent-setup windsurf # Windsurf
memnos agent-setup openclaw # OpenClaw
memnos agent-setup hermes # Hermes Agent (Nous Research)
memnos agent-setup omnigent --agent-dir <path> # Omnigent (Databricks) — wires whatever
# harness Omnigent runs (Claude, Codex, Cursor, ...)
Each mints a scoped token, is idempotent, and backs up any file it edits.
Omnigent server-wide capture — a separate, additive command wires memnos into an
Omnigent server's own --config YAML (not a single agent) as a native type: function
policy, so every agent that server runs gets its assistant responses captured
automatically, with zero Omnigent source changes:
memnos server-setup omnigent --config <path-to-omnigent-server-config.yaml> --mode embedded # or --mode central
Write-only (captures responses; does not recall/inject) and fails open (never blocks or
denies the live conversation). Full guide, coverage caveats, and the embedded/central
config split →
Honest capture tiers — clients differ in how reliably memory gets captured, and we'd
rather tell you than pretend otherwise:
- Deterministic (Claude Code): lifecycle hooks auto-recall before each prompt and
auto-save after — both your message and the assistant's reply. No model discretion.
If the server is unreachable, turns are queued locally (
~/.memnos/offline_queue/)
and replayed automatically on next session start — no turns lost to transient downtime.
- Deterministic (any base-URL client) —
memnos proxy: point any OpenAI- or
Anthropic-compatible client at the proxy
(ANTHROPIC_BASE_URL=http://127.0.0.1:8910). It relays every request untouched
(streaming included, keys forwarded, never stored) and captures both sides of each
completed exchange, with agent-loop noise filtered out.
Guide + capability matrix.
- Deterministic, write-only, server-wide (Omnigent):
memnos server-setup omnigent
captures every covered agent's assistant response automatically — no model discretion,
no per-agent wiring. One-directional (no recall/injection — Omnigent has no
turn-boundary hook for that) and narrower than "every response" for one class of
session; see the honest coverage caveats.
- Discretionary (everything else): MCP tools (
recall, recall_wide, remember,
reconcile_claim, …) — called when the model decides to. Useful, but not guaranteed.