ownmem README

The project's README from github.com/grpcer/ownmem. As one markdown file: README.md.

OwnMem — Git-Native Memory for AI Coding Agents

Open-source project memory for Claude Code, Codex, Cursor, Gemini CLI, and other AI coding agents — local, deterministic, reviewable, and safely self-improving.

Git-native · AI agent memory · local recall · evidence-governed · Apache-2.0

npm version npm downloads release gates node >= 20.6 license Apache-2.0

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Français · Deutsch · Português (BR)

Why OwnMem

Most AI agent memory systems optimize for remembering more. OwnMem starts with a different question: who owns project knowledge, who may change it, and how can a bad memory be stopped before it changes a coding agent's actions?

Advantage What it means in practice
The repository owns memory Readable Markdown in .ownmem/ travels through clone, review, and rollback with the code.
One memory serves many agents Claude Code, Codex, Cursor, Gemini CLI, Grok CLI, and other hosts share one source of project truth.
Deterministic local recall Default recall makes no model or network call; the same query, config, and snapshot produce the same ranking.
Evidence before authority Content cannot declare itself trusted. Independent receipts and live evidence checks decide delivery.
Bounded growth Schemas, quotas, duplicate gates, lifecycle rules, and audits keep memory from becoming a second abandoned wiki.
Low-risk automation, review for impact Replay-proven R0 retrieval metadata can evolve unattended; prose, policy, and higher-risk changes cannot.

Architecture

OwnMem architecture: repository-owned Markdown and independent trust receipts compile into immutable snapshots; deterministic local recall passes four delivery gates, while a bounded evolution coordinator replays, promotes, observes, quarantines, and precisely rolls back low-risk changes.

OwnMem separates writing experience from delivering it to an agent:

How OwnMem governs AI agent memory

The differentiator is not one ranking formula. OwnMem turns coding-agent memory into a verifiable retrieval and evolution protocol:

Mechanism How it is enforced
Evidence-carrying memory Content hash, evidence root, lifecycle, applicability, risk, and predecessor receipts determine whether text may enter context.
Counterfactual promotion gate Automation must prove baseline miss, candidate-only recovery, and zero regression on the previously passing corpus.
Risk from change surface Risk is derived from what changed and what it can affect; an agent cannot downgrade its own proposal.
Content-addressed compensating rollback Automatic edits carry a verified inverse operation; failures or harmful outcomes restore the exact previous bytes without erasing history.
Memory-poisoning quarantine Candidates, content, authority, and evidence are separate trust domains; retrieval never grants permission to act.
Selective delivery Insufficient evidence produces advisory, quarantine, or abstention instead of invented confidence.
Immutable compiled snapshots Markdown, graph edges, ranking identity, and trust state become one reproducible runtime input.
Three anti-pollution ledgers Retrieval correctness, user/host-confirmed outcomes, and agent self-attribution never impersonate one another.

Read the detailed technical design and research mapping.

Quick start

Requires Node.js 20.6 or newer. Run this inside the repository that should own the memory:

npm install --save-dev ownmem
npx ownmem init --locale auto --hosts claude,codex,grok --layers dashboard --hook

Reopen the agent after initialization. OwnMem creates .ownmem/ and edits only managed marker regions in host files. Use --hosts claude, --hosts codex, --hosts cursor, or --hosts gemini when only one adapter is needed; preview changes with npx ownmem init --check.

Upgrading from 0.5.x: the hook configuration is now v2. Run npx ownmem init --update once. Commands that predate it are replaced where they stand, hooks you wrote yourself are never touched, and the session-start pass keeps saying the configuration is out of date until you do.

Daily use

After setup, keep working in plain language:

“Remember this: staging deployment timeouts come from the pool cap, not too few workers. Check both together next time.”

“Before changing this, check whether the project memory has seen the same failure.”

The host recalls before scoped work and schedules one locked, debounced evolution pass at the end of a turn. You normally do not need to chain promotion, trust, audit, or compile commands. Open the local console or inspect the coordinator when you want visibility:

npx ownmem dashboard --open
npx ownmem evolve status
npx ownmem evolve run --force

Telemetry and the daily pass

Runtime events expire after thirty days and never leave the machine that wrote them. The daily pass reduces each finished day to a counted package small enough to commit, so a second machine — and a report run months later — can still see it:

npx ownmem daily                       # archive yesterday, commit it, report only what is wrong
npx ownmem archive --backfill          # reduce every day still on disk to a counted package
npx ownmem report --since 7d --fleet   # merge every machine's packages, and name the missing days

Trust and automation boundary

OwnMem automates the part it can prove, not the part that merely sounds plausible.

Where it fits

Good fit Choose another system when
A team wants project knowledge reviewed and migrated with code. You need a cross-repository personal profile or global user memory.
Several coding agents rotate through one repository. You need to capture every conversation automatically with no evidence or risk boundary.
Local, reproducible recall with no retrieval API bill matters. You need large-scale cloud vector search or a real-time global knowledge graph.
Bad memory must be attributable, rejectable, and reversible. Maximum recall volume matters more than governance.

Local-first by default

Research lineage

OwnMem does not claim these foundations as inventions. Its contribution is their composition into an executable protocol for repository memory:

These citations describe the research lineage; they do not imply that the papers implement OwnMem or that OwnMem reproduces their experiments.

Documentation

Document Purpose
Architecture Package boundaries, snapshots, trust, and evolution
Technical design Mechanisms, threat model, and research mapping
Plugins Optional host plugin installation
Updating Safe repository updates and version migrations
Privacy Local data and optional channel boundaries
Changelog Version history
License Apache-2.0

OwnMem is open source. Reproducible issues and pull requests are welcome.

ownmem (grpcer/ownmem)

Searching Database…

429 ·GitHub
这是什么?OwnMem 是一个开源、Git 原生的 AI 编程代理记忆系统,面向 Claude Code、Codex、Cursor 和 Gemini CLI 等。它把项目知识以可审查的 Markdown 存在你仓库的 .ownmem/ 文件夹里,让多个代理共享同一份本地、确定性的记忆。
这是 CLI 工具,还是我导入的库?它是一个用 npx 安装的 Node.js CLI,通过钩子文件(.claude/settings.json、/.codex/hooks.json)接入你的编程代理,并在你的仓库里添加一个 .ownmem/ 文件夹;它不是拿来当库导入的东西。
怎么让它跑起来?在你想让 OwnMem 管理的仓库里运行 “npx ownmem init”,然后重新打开你的编程代理,让它加载新的钩子。你可以用 “--hosts claude”、“--hosts codex”、“--hosts cursor” 或 “--hosts gemini” 只针对某个代理,并先用 “npx ownmem init --check” 预览改动。
除了 Node.js 我还需要什么?只要 Node.js 20.6 或更新版本;OwnMem 自身的依赖只有 “ajv” 和 “yaml”,默认不需要任何 API 密钥或外部服务。
每个受支持的代理开箱表现都一样吗?不一样——Codex 需要在 config.toml 里启用钩子,而且项目必须先被明确信任,它才看得到钩子文件;Grok CLI 需要通过 “/hooks-trust” 对其文件夹信任一次,否则它会静默跳过所有钩子。Cursor 和 Gemini CLI 只有指令适配器,所以它们能读取记忆,但永远不能写入。
它实际支持哪些编程代理?目前支持 Claude Code、Codex、Cursor、Gemini CLI 和 Grok CLI,其中 Claude Code 和 Grok CLI 获得完整的基于钩子的采集,而 Cursor 和 Gemini CLI 只能从记忆里读取。
记忆召回需要联网或调用 LLM 吗?不需要——默认的排序管线(精确匹配、BM25F、n-gram、模糊匹配和图匹配)完全跑在本地仓库文件和快照上;可选的 embeddings 通道只有在本地 A/B 证据证明它有帮助后才会启用。
我的项目记忆和使用数据实际去了哪里?运行时遥测事件写入一个被 Git 忽略的本地目录,三十天后过期,从不离开本机;提交的只有一个匿名、按天汇总的摘要,不含查询文本、文件路径或机器名。
如果 OwnMem 不确定某条记忆可信,会怎样?它不会瞎猜,而是在自己的证据和操作风险门控之下,把这条目以建议形式交付、隔离起来,或完全弃用,让未经证实的内容永远不会悄悄影响代理的行为。
糟糕的自动记忆编辑能撤销吗?能——每次自动编辑都带有经过验证的逆操作,所以失败或有害的改动可以恢复到之前的确切字节,而不会抹掉编辑历史。
和其他代理记忆工具相比,OwnMem 有什么不同?大多数记忆系统追求记住更多;OwnMem 反而让每个条目都过一遍证据、风险和生命周期检查的关卡,这样坏记忆在改变代理行为之前就能被拒绝、隔离或回滚。
OwnMem 能用 embeddings 或向量搜索吗?Embeddings 是可选的第六条检索通道,但在本地 A/B 对比证明它们确实能在这个仓库自己的数据上改善结果之前,它们的权重一直是零。
Creator
grpcer
Size
2.6 MB
Stars
429
Age
2mo
Commits · 90 Days