Pillar · Persistent memory

Agents that remember every session. With receipts.

Decisions, bugfixes, patterns, approaches, captured once, calibrated by outcomes, served in 2–4K tokens instead of 50K raw.

The short answer

Agents with persistent memory keep what they learn across sessions instead of restarting from zero. Anvaya Mind is a code-native memory engine: a local hybrid graph + vector store (SQLite WAL plus hand-written HNSW) that captures decisions, patterns, bugfixes, and approaches as typed, linked nodes.

Read the full answer

Six-stage Prism retrieval fuses keyword, semantic, recency, graph, and bug signals; submodular Quorum packing assembles 2–4K tokens under budget; turn outcomes feed a Beta-Bernoulli posterior while per-type decay (Decision λ0.002 → Approach λ0.030) and git drift detection prune the stale. Versus flat CLAUDE.md files (hand-kept, rotting) and generic memory APIs (domain-blind, hosted), Mind is local-first, inspectable under .anvaya/mind/, and served to any agent: Anvaya CLI natively, Claude Code and Cursor over MCP.

Served, not dumped

A whole project's memory, in 4,096 tokens.

The graph can hold years; the prompt gets a packed slice, chosen by value per token.

Token budget · liveillustrative
Served11 of 14
Tokens3,310 / 4,096
  1. 0.94decision keep WAL mode for the store180served
  2. 0.91bug fix retry loop double-charged on a 502420served
  3. 0.88pattern handlers return Result<_, ApiError>260served
  4. 0.86concept an invoice is immutable once issued140served
  5. 0.83synthesis billing failures cluster at the gateway edge610served
  6. 0.79approach tried: idempotency keys in Redis, dropped380served
  7. 0.74bug fix timezone drift in the nightly settlement job720served
  8. 0.71decision Postgres for ledgers, SQLite for local state230served
  9. 0.66pattern every migration ships with a down step160served
  10. 0.62concept settlement window is T+2 business days90served
  11. 0.55approach tried: batching webhooks per merchant540over budget
  12. 0.49bug fix flaky test: clock not frozen in fixtures310over budget
  13. 0.44pattern feature flags are read once per request120served
  14. 0.38synthesis the gateway owns retries; callers never do880over budget

11 of 14 served, 3,310 of 4,096 tokens.

Sample candidates under the real ceiling: 4,096 tokens at 0.85 fill, 12 nodes max. The shipped pack also weighs novelty.anvaya-mind-rs/crates/mind-services/src/quorum.rs · mind-types/src/config.rs

How it works

Capture, retrieve, pack, learn.

Twenty services, one loop: every session makes the next one better.

Capture: Mnemon ingestionTool calls, edits, tests and terminal output become typed nodes with evidence and session links. Promotion rules keep noise out.
Retrieve: Prism six stagesKeyword and semantic search, recency, two-hop graph expansion and bug-boost, weighted by confidence and session intent.
Pack: Quorum submodularMaximal-marginal-relevance selection under a 2000/4096-token budget across Knowledge/Thread/LowConf sections. Relevance minus redundancy: the top-3 critical nodes plus the best patterns, fixes, and concepts.
Learn: outcomes calibrateA Beta-Bernoulli posterior per node, per-kind decay (λ 0.002 to 0.030), and git drift demotes stale nodes.

Forgetting on purpose

Memory that prunes itself.

The difference between a knowledge base and a junk drawer is principled forgetting.

Per-type half-livesDecisions age slowly (≈347 days), approaches decay fastest (30 days). Each type's λ matches how fast that knowledge rots in real codebases.
Content-anchored driftGit history is the ground truth: when code changes under a node, the node is flagged and demoted, never confidently wrong.
Outcome calibrationNodes that actually helped get used more; unused ones fade. Corroboration across sessions confirms hypotheses; contradictions supersede without deleting history.

Questions

Asked about agent memory.

What are agents with persistent memory?

AI agents whose knowledge survives session boundaries: decisions, bugfixes, patterns, and approaches stored externally and retrieved into future sessions. Without it, every session re-explains the stack; with it, session 50 starts smarter than session 1. Anvaya Mind is a code-native implementation: hybrid graph + vector, local-first, served to any agent over MCP.

How is this different from Mem0 or generic agent memory?

Generic memory APIs store conversation facts for any domain. Anvaya Mind is code-native: LCS dedup of edits, dual file+symbol vector search, git-drift invalidation, test-signal causal threads, and session-outcome calibration. It remembers why a fix worked (with the failing test as evidence), not just that someone said so.

How is this different from CLAUDE.md or MEMORY.md?

Flat files are hand-maintained, grow without bound (MEMORY.md caps ~200 lines/25KB), and assert stale facts until edited. Mind is a weighted, linked, decaying graph: nodes carry confidence and half-lives, contradictions resolve by corroboration, and each query packs only the top few under a token budget, ~1,900 tokens where full replay costs 22K+.

Where is my memory stored?

Locally, under .anvaya/mind/ in your project: SQLite (WAL), a flat HNSW vector index, an append-only temporal log, plain-text config. No cloud sync, no account, gitignored by default. Open the SQLite file directly, no lock-in, documented format.

Which agents can use the memory?

Any MCP client: Anvaya CLI natively (Direct/IPC, sub-millisecond to ~2ms), plus Claude Code, Cursor, Codex CLI, and others via Anvaya's MCP memory server and its 14 tools (mind_query with 4096-token budget, mind_search, mind_record_change, mind_get_node, mind_stats, feedback, sessions, threads, delta, proactive, intent, retro-promote, federation).

Run agents that fit on your laptop.

23.4 MB median own-process memory, measured across 1030 runs (994 verified) and fourteen harnesses. One command installs the harness and the Mind together. Nothing leaves your machine on the Ollama path.

Developer beta. macOS on Apple Silicon and Linux on x86_64 or arm64. Memory figure: --no-mind, macOS/ARM, n=3 per cell. Pre-1.0, pricing not set.