aayoawoyemi/Ori-Mnemos
Local-first persistent agentic memory powered by Recursive Memory Harness (RMH). Open source must win.
About aayoawoyemi/Ori-Mnemos
aayoawoyemi/Ori-Mnemos is an open-source project on GitHub, mainly written in TypeScript. Local-first persistent agentic memory powered by Recursive Memory Harness (RMH). Open source must win. It currently holds 324 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).
Project Overview
AI Homed tracks it on the AI Agent Memory board.
GitHub Repository Details
README
Ori Mnemos
Open-source persistent memory infrastructure for AI agents.
Ori implements human cognition as mathematical models on a knowledge graph. Activation decay from ACT-R. Spreading activation along wiki-link edges. Hebbian co-occurrence from retrieval patterns. Reinforcement learning on retrieval itself. Recursive graph traversal with sub-question decomposition. The system learns what matters, forgets what doesn't, and optimizes its own retrieval pipeline.
Persistent memory across sessions, clients, and machines. Zero-infrastructure retrieval that matches and in several cases strongly outperforms incumbents on benchmarks — and you own every byte of your data. Markdown on disk. Wiki-links as graph edges. Git as version control. No database lock-in, no cloud dependency, no vendor capture.
v0.7.0 · npm · Paper · Apache-2.0
---
Use
Ori is three surfaces over one index. The markdown is the truth; the index is derived. The learned half — Q-values, LinUCB arms, retrieval history — is not, so export it before deleting anything (see When to rebuild).
CLI
npx ori init # scaffold a vault
npx ori index build # derive the index
npx ori explore "…" # navigated retrieval
npx ori sql "…" # read-only SQL over the index
MCP server — ori serve, registered in a client config. This is how an
agent uses it.
Library — recall is the same wired entry the CLI and the MCP
ori_recall tool both go through, so the programmatic path and the agent
path cannot drift.
import { recall } from "ori-memory";
const res = await recall("./vault", "what did we decide about caching?", { limit: 5 });
for (const hit of res.data.results) console.log(hit.title, hit.score);
searchComposite is also exported for callers that have already assembled
vectors, graph metrics and a config; recall does that assembly for you.
The export surface is deliberately small and is a semver contract; the rest of
src/core is internal. Versions before 0.7.1 shipped no main and no
exports, so a bare import threw and the library path did not exist — but the
CLI and MCP paths always worked, and existing users were unaffected.
ori-memory/cli resolves to the CLI entry, for callers that need to locate
the binary and spawn it rather than link against it. require.resolve on it
is the intended use; importing it runs the CLI.
Benchmarks
ForgetEval — Can It Forget On Command?
deeplethe/lethe, bench/forgeteval/,
MIT. No API key, no network, no LLM judge. The scorer is a ~20-line
deterministic substring check in GeneratedCase.run(): it calls
recall_texts(query, k=10) itself, joins the top 10, and tests
must_contain / must_not_contain. Generation is random.Random(42) over
templates. The optional LLM hook is llm=None by default and was not used.
| family | Ori | what it requires |
|---|:---:|---|
| supersession | 200 / 200 | replace a fact, old value must not surface |
| decay | 200 / 200 | release(query) — soft-evict on demand |
| amnesia | 198 / 200 | evict one subject, keep the bystanders |
| purge | 182 / 200 | hard-delete, verbatim secret must be gone |
| drift | 198 / 200 | two supersessions in sequence, only the last survives |
| overall | 978 / 1000 (97.8%) | 1,000 generated cases, seed 42 |
Not fitted to the suite: unseen seeds give 97.2% (seed 7) and 98.0% (seed 123). The fixes were structural bugs in the matcher, not case-specific patches.
Quote these against a 35% floor, not against zero. The oracle is
must_contain AND must_not_contain over the top 10, and when
must_contain is empty — every decay case and 150 of 200 purge cases,
350 of 1,000 — a system that returns nothing passes vacuously. A null
adapter that accepts writes and never returns anything scores 350/1000 =
35%, including 100% on the whole decay family. On the 650 cases that
actually discriminate, Ori is 628/650 = 96.6% and its purge drops from
91% to 64%, which is its real weak spot. The published LangMem 99.5 /
Lethe 99.3 / Mem0 88.8 are full-suite and carry the same floor.
See docs/falsification/forgeteval-validity.md.
| System | template | adversarial | |---|:---:|:---:| | LangMem | 99.5 | — | | Lethe v1 | 99.3 | 63.4 | | Ori Mnemos | 97.8 | 65.7 | | Mem0 | 88.8 | 68.3 | | MemPalace | 0 | — |
Ori scored 0/1000 on this benchmark earlier the same day. Not a low
score — a structural zero. ForgetEval's adapter protocol has three optional
operations, supersede, release and purge, and Ori had none of them:
zero source hits across src/. Every case was N/A. The ACT-R decay and
Ebbinghaus curves Ori already had are ranking-time priors, and no benchmark
measures those; ForgetEval's "decay" family means an explicit release(query)
call. src/core/forget.ts is 305 lines and closed the whole gap in a day,
which is the most informative number on this page.
That table is not a ranking, and "third" would be a bad way to read it.
ForgetEval's code lives inside deeplethe/lethe — the benchmark and its
top-scoring system are the same org, in a repo with 14 stars. The template
column has four entries, one of which (MemPalace) scores 0 by construction
because it exposes no deletion primitive at all. Two of the rest saturate.
On the adversarial layer Ori is 5th of 14 configurations and lands inside
the 63–68% band the paper's own McNemar test calls noise (χ²=0.125,
p=0.724); the paper's words are "the bench reads the trade-off, not a
winner." The one comparison that is statistically real is Ori vs Lethe on
template, z=2.81, p=0.005 — Lethe is genuinely ahead.
Who is missing matters more than who placed. Supermemory (30.6k stars,
$2.6M seed) ships POST /v4/memories/forget-matching — natural-language
forgetting with dryRun, threshold, maxForget and an audit handle —
plus versioned PATCH supersession. That is a better-specified control
plane than anything scored here, and it maps onto the adapter protocol
almost verbatim. It has never been benchmarked. Neither have Hindsight
(24.0k), Cognee (30.8k, excluded for API incompatibility), MemOS (11.5k) or
Honcho (7.3k).
So the honest claim is not that Ori forgets better than the field. It is that Ori forgets offline, with no API key, and that the field has no idea how well it forgets:
Fifteen agent-memory systems were checked. Zero publish a forgetting
benchmark for their own system. Five such benchmarks exist — ForgetEval,
Memora/FAMA, MemoryAgentBench-SF, StateMemBench, MemLeak — and vendors
cite none of them. Every forgetting number in existence was produced by a
rival or an outsider.
Read the adversarial column with one more caveat. 253 of its 385 cases
were admitted only if the vendor's own system passed them, annotated in
adversarial.py as "Oracle-validated (Lethe / Lethe+LLM passes the case)".
The authors' own blind 77-case external subset drops the whole field from
the 63–68% band to 28–33%, which says the in-house suite is materially
easier. A benchmark whose admission filter is "the measurer's system solves
it" cannot rank the measurer.
Reproduce:
git clone https://github.com/deeplethe/lethe && cd lethe
cp /bench/forgeteval_ori_adapter.py bench/forgeteval/ori_adapter.py
export ORI_BRIDGE=/bench/forgeteval-bridge.mjs
python -m bench.forgeteval.run --adapter ori --suite template --scale 200 --seed 42
Four minutes, 1,000 cases, $0.00. The adapter talks NDJSON to a resident Node process because the harness makes ~10 calls per case and a CLI subprocess per call would spend hours on interpreter startup.
HotpotQA — Multi-Hop Retrieval
Head-to-head against Mem0. Both systems indexed the same documents and answered the same questions in the same run.
| Metric | Ori Mnemos | Mem0 1.0.6 | Δ | |--------|:----------:|:----------:|:-:| | Recall@5 | 0.87 | 0.29 | 3.0× | | MRR | 0.91 | 0.42 | 2.2× | | Retrieval F1 | 0.51 | 0.26 | 2.0× | | Answer proxy | 0.73 | 0.34 | 2.1× | | Infrastructure | Markdown + SQLite | Redis + Qdrant + cloud | — |
n = 50, single run, no seed averaging, topK = 5. Mem0 at 1.0.6 (March 2026);
2.x is not yet re-run, so read this as a point-in-time comparison, not a current
one. Raw output: bench/results/, reproduce with
bench/hotpotqa-eval.ts and
bench/mem0-hotpotqa.py.
These are not HotpotQA's official metrics and must not be compared to the
HotpotQA leaderboard. The official scorer, hotpot_evaluate_v1.py, reports
answer EM/F1 under its own normalize_answer, plus supporting-fact F1 over
(title, sentence_id) pairs, plus joint EM/F1. The table above is a
title-level retrieval metric defined in bench/hotpotqa-eval.ts, and
"answer proxy" is not a HotpotQA metric at all — it is token recall of the
gold answer against retrieved text. The comparison is valid in one direction
only: Ori and Mem0 went through the same harness on the same questions,
so the ratio between the two columns means something. The absolute numbers
do not transfer anywhere.
At n = 50 the Wilson 95% intervals are Ori [0.75, 0.94] and Mem0
[0.18, 0.43] on Recall@5. They do not overlap, so the gap is real, but the
two-decimal precision in the table is not: read 0.87 as "high 0.80s".
Latency is not reported here. The evaluation harness does not record it, so any number would be recalled rather than measured. What is measured is that Ori answers from markdown plus a local SQLite index with no API key and no network.
LoCoMo — Long-Term Conversational Memory
1,536 questions over 10 conversations. Retrieval is BM25 + embedding + PageRank fusion at top-5. No API key and no network: the answer column is an extractive proxy, token recall of the ground-truth answer against retrieved text, not a generated answer.
| Category | Recall | Answer F1 | MRR | n | |---|:---:|:---:|:---:|:---:| | open-domain | 0.943 | 0.929 | — | 841 | | single-hop | 0.863 | 0.758 | — | 321 | | multi-hop | 0.528 | 0.670 | — | 282 | | temporal | 0.565 | 0.478 | — | 92 | | overall | 0.827 | 0.819 | 0.729 | 1,536 |
Raw output: bench/results/locomo-eval-2026-09-19T22-37-31-698Z.json.
Reproduce with npx tsx bench/locomo-eval.ts --json; the run takes 48 s.
Multi-hop and temporal are the weak categories and are reported as such.
Two corrections to earlier versions of this file, both found on 2026-09-19:
- It previously reported 695 questions and an overall recall of 0.687. That
bench/README.md carried a third set of numbers again (44.7% recall) that
reproduces nothing in the current harness. One number now, with the run file
beside it.
- The 2026-09-19 run reproduces the 2026-07-22 run to three decimals, so these
09ac45d and the
lambda change in 72fdd13.
No comparison table against published LoCoMo leaderboards is given, on purpose. Those are LLM-judge scores; the above is token F1. They are different quantities and putting them in one column would invent a ranking rather than report one. A previous version of this README did exactly that.
LoCoMo itself has known defects. An independent audit found 6.4% of questions carry wrong answer keys, putting the theoretical ceiling at 93.57%, and the standard gpt-4o-mini judge accepts 62.81% of deliberately wrong answers. At least one published score exceeds the mathematical ceiling. A close result on this benchmark is weak evidence in either direction, which is why it is reported here and not led with.
LongMemEval-S — Retrieval, 500 Questions
Session granularity, 470 scored (the official scorer excludes the 30
abstention questions). No API key, no network, no LLM judge — the
benchmark's own scorer imports sys, json and numpy and nothing else.
| | recall_any@k | recall_all@k | ndcg_any@k | |---|:---:|:---:|:---:| | @1 | 0.866 | 0.300 | 0.866 | | @5 | 0.966 | 0.830 | 0.884 | | @10 | 0.981 | 0.904 | 0.898 |
recall_all@k requires every gold session in the top k; recall_any@k
requires one. The official summary reports recall_all@5 and ndcg_any@5.
Against published figures on the same benchmark using the same embedder, all three zero-API-call:
| System | Embedder | R@1 | R@5 | R@10 | |---|---|:---:|:---:|:---:| | MemPalace (raw) | all-MiniLM-L6-v2 | 80.6% | 96.6% | 98.2% | | Lethe v1 | all-MiniLM-L6-v2 | 85.4% | 97.4% | 99.0% | | Ori Mnemos | Xenova/all-MiniLM-L6-v2 | 86.6% | 96.6% | 98.1% |
Ori leads at @1 and is at parity by @10. That is a smaller claim than it looks. An independent analysis of MemPalace (arXiv:2604.21284) concluded its 96.6% R@5 "is the performance of ChromaDB's default embedding model (all-MiniLM-L6-v2) applied to verbatim text chunks" and is reproducible with a minimal ChromaDB setup. At k=5 this metric is saturated and mostly measures the embedder, which is the same one in all three rows. The honest reading is that Ori's retrieval is not the bottleneck and this axis no longer separates systems.
Ori's recall_any@5 of 0.9660 and MemPalace's published 96.6% agree to three
significant figures. That is a coincidence, not a copied number; the full
per-question output is committed.
Weak categories, consistent with LoCoMo: multi-session 0.653 and
temporal-reasoning 0.772 recall_all@5, against 1.000 for both single-session
types. Multi-hop and temporal are where Ori loses on both benchmarks, which is
two independent measurements agreeing rather than noise.
Reproduce:
npx tsx bench/longmemeval-eval.ts --data <longmemeval_s_cleaned.json>
python bench/longmemeval-score.py
python /src/evaluation/print_retrieval_metrics.py
11 minutes, 500 questions, $0.00. bench/longmemeval-score.py imports the
benchmark's own evaluate_retrieval rather than reimplementing recall_all@k,
so these are the authors' metric definitions.
---
Quick Start
npm install -g ori-memory
ori init my-agent
cd my-agent
Connect to your agent:
# Full adapters — auto-orient at session start, capture at session end
ori bridge claude-code --vault ~/brain # hooks + MCP + CLAUDE.md
ori bridge hermes --vault ~/brain # native plugin + MCP + HERMES.md
ori bridge opencode --vault ~/brain # plugin + MCP + AGENTS.md
MCP-only adapters — tools available, no lifecycle automation
ori bridge cursor --vault ~/brain # .cursor/mcp.json
ori bridge codex --vault ~/brain # ~/.codex/config.toml
Any MCP client
ori bridge generic --vault ~/brain # prints config for manual setup
Claude Code, Hermes Agent, and OpenCode get full lifecycle integration — the agent orients at session start, captures insights at session end, and validates notes on write. Cursor, Codex, and other MCP clients get access to all 14 tools but manage their own session lifecycle.
Manual MCP config (works with any client that speaks MCP):
{
"mcpServers": {
"ori": {
"command": "ori",
"args": ["serve", "--mcp", "--vault", "/path/to/brain"],
"env": { "ORI_VAULT": "/path/to/brain" }
}
}
}
Start a session. The agent receives its identity automatically and begins onboarding on first run.
---
What's New
v0.6.0 — Navigated Recursion. ori explore no longer returns a flat synthesis. The agent sees the decomposition tree — which branches produced results, which hit dead ends — and steers the traversal itself. New session commands: explore-start, explore-expand, explore-conclude. Budget is a nudge, not a wall: soft exhaustion with explicit extension. A cross-encoder reranking stage now sits on top of four-signal fusion. RMH Constraint 2 goes from partial to real.
$ ori explore-start "why did we choose SQLite over postgres"
exploration e7f2 — 3 branches
├─ [1] storage engine tradeoffs 4 notes, strong signal
├─ [2] deployment constraints 2 notes
└─ [3] prior migration decisions dead end — no notes
next: ori explore-expand e7f2 1 | ori explore-conclude e7f2 --answered
v0.5.6 — OpenCode bridge. Full lifecycle integration: first-run onboarding, auto session capture, note validation, multi-vault support. ori bridge opencode — one command.
v0.5.5 — Ebbinghaus warmth. Notes accessed once fade fast (half-life ~7 days). Notes accessed across many sessions embed deeply (up to ~28 days). Short-term and long-term memory, structurally distinct.
Full history in the CHANGELOG.
---
Recursive Memory Harness
Ori is the first implementation of the Recursive Memory Harness (RMH) framework — a set of constraints on how persistent memory should behave for AI agents.
The core insight comes from Recursive Language Models (Zhang, Krassa & Khattab, 2026). RLM treats context not as input to be stuffed into a window, but as an environment to be navigated. The model doesn't get a bigger desk — it gets legs and walks into the library. RMH applies the same principle to persistent memory.
Three constraints define the framework:
1. Retrieval must follow the graph. Memory is not a flat vector store. Notes are nodes, wiki-links are edges. Retrieval walks the structure — Personalized PageRank at α=0.45, spreading activation along edges, community-aware traversal. The topology of the graph shapes what gets found.
2. Unresolved queries must recurse. When a single retrieval pass is insufficient, the system decomposes the question into sub-questions, retrieves against each, and synthesizes. Convergence detection stops recursion when new passes stop surfacing new information. This is what ori explore does.
3. Every retrieval must reshape the graph. Retrieval is not read-only. Co-occurrence edges grow between notes retrieved together (Hebbian learning). Q-values update based on whether retrieved notes were actually useful. The graph learns from how it is used — every query makes the next query better.
Most memory systems treat retrieval as search. RMH treats retrieval as navigation, recursion, and learning — on a graph that evolves with every session.
Read the full paper: Introducing Recursive Memory Harness
---
What It Does
- Persistent identity. Agent state — name, personality, goals, methodology — is stored in plain markdown and auto-injected at session start via MCP instructions. Identity survives client switches, machine migrations, and model changes without reconfiguration.
- Knowledge graph. Every
[[wiki-link]]is a directed edge. PageRank authority, Louvain community detection, betweenness centrality, bridge detection, orphan and dangling link analysis. Structure is queryable through MCP tools and CLI. - Three memory spaces. Identity (
self/) decays at 0.1x — barely fades. Knowledge (notes/) decays at 1.0x — lives and dies by relevance. Operations (ops/) decays at 3.0x — burns hot and clears itself. The separation is architectural, not cosmetic. - Cognitive forgetting. Notes decay using ACT-R base-level learning equations, not arbitrary TTLs. Used notes stay alive. Their neighbors stay warm through spreading activation along wiki-link edges. Structurally critical nodes are protected by Tarjan's algorithm.
ori pruneanalyzes the full activation topology before archiving anything. - Four-signal fusion. Semantic embeddings, BM25 keyword matching, personalized PageRank, and associative warmth fused through score-weighted Reciprocal Rank Fusion. Intent classification (episodic, procedural, semantic, decision) shifts signal weights automatically.
- Dampening pipeline. Three post-fusion stages validated by ablation testing: gravity dampening halves cosine-similarity ghosts with zero query-term overlap, hub dampening applies a P90 degree penalty to prevent map notes from dominating results, and resolution boost surfaces actionable knowledge (decisions, learnings) over passive observation.
- Learning retrieval (v0.4.0). Three intelligence layers improve retrieval quality from session to session, synthesized from 63 research sources. See Retrieval Intelligence below.
- Capture-promote pipeline.
ori addcaptures to inbox.ori promoteclassifies (idea, decision, learning, insight, blocker, opportunity), detects links, suggests areas. 50+ heuristic patterns. Optional LLM enhancement. - Zero cloud dependencies. Local embeddings via all-MiniLM-L6-v2 running in-process. SQLite for vectors and intelligence state. Everything on your filesystem. Zero API keys required for core functionality.
Retrieval Intelligence (v0.4.0)
Three learning layers that improve retrieval quality over time without manual tuning. Synthesized from 63 research sources across reinforcement learning, information retrieval, cognitive science, and bandit theory.
Layer 1 — Q-Value Reranking
Notes earn Q-values from session outcomes via exponential moving average updates. Over time, genuinely useful notes rise and noise sinks.
| Signal | Reward | What triggers it |
|--------|--------|-----------------|
| Forward citation | +1.0 | You [[link]] a retrieved note in new content |
| Update after retrieval | +0.5 | You edit a note you just retrieved |
| Downstream creation | +0.6 | You create a new note after retrieving |
| Within-session re-recall | +0.4 | Same note surfaces across different queries |
| Dead end (top-3, no follow-up) | −0.15 | Retrieved in top 3 but nothing follows |
After RRF fusion, Phase B reranks the candidate set with a lambda blend of similarity score and learned Q-value, plus a UCB-Tuned exploration bonus that ensures under-retrieved notes still get discovered. Exposure-aware correction prevents the same notes from dominating every session. A cumulative bias cap (MAX=3.0, compression=0.3) prevents runaway score inflation.
Layer 2 — Co-Occurrence Edges
Notes that are retrieved together grow edges between them — Hebbian learning on the knowledge graph. Edge weights are computed using NPMI normalization (genuine association beyond base rate), GloVe power-law frequency scaling, and Ebbinghaus decay with strength accumulation (frequently co-retrieved pairs decay slower).
Per-node Turrigiano homeostasis prevents hub notes from absorbing all edge weight. Bibliographic coupling bootstraps day-0 edges from existing wiki-link structure before any queries have been run.
The combined wiki-link + co-occurrence graph feeds a Personalized PageRank walk (HippoRAG, α=0.5) that surfaces notes semantic search alone would never find.
Layer 3 — Stage Meta-Learning
Each pipeline stage (BM25, PageRank, warmth, hub dampening, Q-reranking, co-occurrence PPR) is wrapped in a LinUCB contextual bandit with an 8-dimensional query feature vector. The system learns which stages help for which query types and auto-skips stages that consistently hurt.
Three-way decisions per stage: run / skip / abstain (stop the pipeline early). Cost-sensitive thresholds ensure expensive stages face a higher bar. Essential stages (semantic search, RRF fusion) never skip. An ACQO two-phase curriculum runs all st