@fabersep/memory 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@fabersep/memory`. Versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## 0.3.0 (2026-11-29)
6
+
7
+ ### Added
8
+ - **Personal remote (feature 03):** `remote add <url>` / `remote remove`, `setup --remote`, `init --remote`. A public GitHub or GitLab repository is refused unless `--allow-public`.
9
+ - **Push after approve:** `pushMode` `ask` (default) / `auto` / `never` (`config set-push-mode`); `push` command; `--yes` on `review` and `approve` skips the question.
10
+ - **Unpushed reminder** in `status`, the first MCP answer of a session, and a new `doctor` check "Personal remote" (also `WARN` when the personal repo has no remote).
11
+ - **Two writing machines:** approve pulls with rebase before committing; a rejected push is rebased and retried once; a conflict keeps the local commit and is reported.
12
+ - **`memory_propose` says what the similarity check found:** a staged `create` carries `similar` (entries between `similarityHintFloor`, default `0.25`, and the threshold) and a short note when one is related.
13
+ - **Hygiene fix hints:** a blocked machine path says `write ~/ or $HOME instead of /Users/<name>/`; a blocked secret says to store a pointer instead.
14
+ - **`doctor` warns about a second memory index** loaded outside the managed block in `~/.claude/CLAUDE.md` or `~/.gemini/GEMINI.md`.
15
+ - **Read-only hosts:** `setup --read-only <url> [path]` for servers and CI; proposals, approvals and pushes are refused there.
16
+
17
+ ## 0.2.1 (2026-11-28)
18
+
19
+ ### Fixed
20
+ - Docs pointed to `~/.faber/memory-state/` for config and state; the real location is `~/.config/faber-memory/`.
21
+ - The MCP server reported version `0.1.0` and the compiled L0 header said `v0.1.0`; both now use the package version.
22
+ - `import --split-headings` no longer creates an empty entry for a title heading that has only sub-headings under it.
23
+
24
+ ### Added
25
+ - `--version` (also `-v`, `version`).
26
+ - The `init` instruction block for Claude Code and Antigravity now tells the agent when to call `memory_propose`; the `memory_propose` tool description says the same for MCP-only engines. Re-run `init` to pick it up.
27
+ - `import` ends with a `NOT imported: N item(s)` line when the hygiene check leaves items out.
28
+ - `docs/guide.md` (technical guide and full command reference), `CHANGELOG.md`, `CONTRIBUTING.md` and a CI test workflow.
29
+
30
+ ### Changed
31
+ - **`setup` is optional for solo use:** `init` creates `~/.faber/memory` when no memory is configured, and `init <folder>` puts it in a folder you choose. `setup` still works, and team mode still starts with `setup --team`.
32
+ - Flags that take no value (`--preview`, `--apply`, `--json`, …) no longer swallow the next argument, so `init --preview ~/notes` works.
33
+ - **`init` now applies by default** (with `.bak` backups and `--undo`). Use `init --preview` (alias `--dry-run`) to see the diff only. `--apply` still works as an alias.
34
+ - The README is now a plain-language, story-first introduction; technical detail moved to `docs/guide.md`.
35
+
36
+ ## 0.2.0 (2026-11-27)
37
+
38
+ - Local metrics ledger, `stats` (context size, retrieval, proposal funnel), `stats --cache` (prompt-cache hit rate from local engine logs), `stats --share` (anonymized benchmark card) and the read-only `doctor` checklist. Spec: `docs/features/02-metrics-and-stats`.
39
+
40
+ ## 0.1.1 (2026-11-26)
41
+
42
+ - CLI UX: review progress line, back and view keys, quit-and-save, `reject --all`, `config unset`, `reset`, team URL shorthands, `--normalize-paths`, troubleshooting guide.
43
+
44
+ ## 0.1.0 (2026-11-26)
45
+
46
+ - Core: Git-backed Markdown memory with `personal`, `team` and `project` scopes, deterministic L0 compiler, 3-tool BM25 MCP server, `pre-memory` review, hygiene scan, multi-engine `init` and zero-LLM `import`. Spec: `docs/features/01-core-memory`.
package/README.md CHANGED
@@ -1,399 +1,138 @@
1
- # FaberSEP Memory (`@fabersep/memory`)
1
+ # FaberSEP Memory
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@fabersep/memory.svg)](https://www.npmjs.com/package/@fabersep/memory)
3
4
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
4
5
 
5
- **Prefix-cache-first, Git-backed Markdown memory for AI coding agents.**
6
+ **Your AI coding assistant forgets everything when the chat ends. FaberSEP Memory gives it a memory you can read, trust and take with you.**
6
7
 
7
- Zero databases. Zero native addons. Zero runtime dependencies. Just plain Markdown files in Git, a deterministic compiled index that keeps your prompt cache warm, a human-approved `pre-memory` inbox so agents never pollute your rules, and a 3-tool MCP server (`memory_search`, `memory_get`, `memory_propose`).
8
+ <!-- Video: a 60-second walkthrough will go here. -->
8
9
 
9
10
  ---
10
11
 
11
- ## Table of Contents
12
-
13
- - [Why FaberSEP Memory?](#why-fabersep-memory)
14
- - [How It Works](#how-it-works-the-2-minute-mental-model)
15
- - [Prerequisites](#prerequisites)
16
- - [Solo / Personal Setup (5 Steps)](#step-by-step-quickstart-solo--personal-setup)
17
- - [Team Mode Setup (Shared Private Repo)](#team-mode-setup-shared-private-git-repo)
18
- - [Everyday Workflow](#everyday-workflow)
19
- - [Updating to a Newer Version](#updating-to-a-newer-version)
20
- - [Cleaning Up or Resetting](#cleaning-up-or-resetting)
21
- - [CLI Command Reference](#cli-command-reference)
22
- - [MCP Tools](#mcp-tools)
23
- - [FAQ & Comparisons](docs/why-faber-memory.md)
24
- - [Troubleshooting & Edge Cases](docs/troubleshooting.md)
12
+ ## The problem you already know
25
13
 
26
- ---
27
-
28
- ## Why FaberSEP Memory?
29
-
30
- *"Doesn't Claude Code, Antigravity, or Cursor already have built-in memory?"*
31
-
32
- Built-in auto-memory is tied to a single tool and lets agents silently overwrite your rules. Vector-DB memory servers add Docker/DB overhead and break prompt caching with dynamic injections. **`@fabersep/memory` solves all four at once:**
33
-
34
- | | Built-in Auto-Memory | Vector-DB Memory MCPs | `@fabersep/memory` |
35
- | :--- | :--- | :--- | :--- |
36
- | **Portability** | Locked to one tool | Needs hosted DB/SDK | **One Git repo across Claude, Antigravity, Cursor, Codex** |
37
- | **Safety** | Agents write silently (drift) | Auto-extracted noise | **Read-only active memory + human `pre-memory` review** |
38
- | **Prompt Cache** | Grows unpredictably | Dynamic RAG breaks prefix | **Deterministic L0 (<1,500 tok), cache-warm (~80%+)** |
39
- | **Setup & Team** | Local only, no PRs | Docker / DB / API keys | **Zero dependencies, pure Git `HEAD` + team PRs** |
14
+ It's Monday. You tell your AI assistant: *"We use pnpm here, not npm."* It says "Got it!" and does a great job.
40
15
 
41
- > Want the full breakdown (why BM25 over embeddings, why prompt caching matters, mobile/remote access)? Read **[Why FaberSEP Memory? (FAQ & Comparisons)](docs/why-faber-memory.md)**.
16
+ On Tuesday you open a new chat. It runs `npm install`.
42
17
 
43
- ---
18
+ So you write the rule down in a long instructions file. A month later that file has 300 lines nobody reads, half of them out of date. You switch from Claude to Antigravity for a day, and the other tool knows none of it. Some tools try to "remember" by themselves, and one day you find a rule in there you never wrote.
44
19
 
45
- ## How It Works (The 2-Minute Mental Model)
20
+ ## What changes with FaberSEP Memory
46
21
 
47
- ```mermaid
48
- flowchart LR
49
- subgraph Git["Git HEAD (Source of Truth)"]
50
- T["Team Repo<br/>(shared private repo)"]
51
- P["Personal Repo<br/>(~/.faber/memory)"]
52
- PR["Project Repo<br/>(.faber/memory/)"]
53
- end
22
+ The same Monday, with FaberSEP Memory:
54
23
 
55
- T & P -->|"Deterministic compile<br/>(< 1,500 tokens)"| L0["L0: MEMORY.md<br/>(always loaded, cache-warm)"]
56
- T & P & PR -->|"In-memory BM25<br/>(auto-reindexes on HEAD)"| L1["L1: memory_search<br/>(compact summaries)"]
57
- L1 -->|"Fetch exact ID"| L2["L2: memory_get<br/>(full Markdown body)"]
24
+ 1. **Your assistant notices a lesson** ("this team uses pnpm") and *suggests* saving it. It does not save it by itself.
25
+ 2. **You approve it** with one key press when you have a minute, usually at the end of the day.
26
+ 3. **From Tuesday on, every assistant you use knows it**: Claude Code, Antigravity, Claude Desktop, Cursor. They all read the same memory.
58
27
 
59
- L0 --> Agent["AI Coding Agent"]
60
- L2 --> Agent
61
- ```
28
+ Your memory is a folder of short notes on your own computer, kept in Git so every change is saved and can be undone. Nothing goes to a cloud service, and you don't need an account, a database or an API key.
62
29
 
63
- If you are new to agent memory systems, here is everything you need to know:
30
+ ## Why you can trust it
64
31
 
65
- 1. **Git is the single source of truth.** Every active memory entry is a small Markdown file committed to Git (`HEAD`). Uncommitted files are never silently trusted.
66
- 2. **Three progressive layers (L0 -> L1 -> L2) keep context small and prompt-cache friendly:**
67
- - **L0 (`MEMORY.md`):** A short, deterministic table of contents compiled from your active `team` and `personal` entries (hard cap: 1,500 tokens). No timestamps, no pending counts, no machine paths — so your LLM prompt cache stays warm turn after turn.
68
- - **L1 (`memory_search`):** When an agent needs details, it searches your memory with a built-in pure-JS BM25 search tool and gets compact summaries back.
69
- - **L2 (`memory_get`):** The agent fetches the full Markdown body only for the exact entry it needs.
70
- 3. **Agents propose; humans approve (`pre-memory`).** Active memory is read-only for agents. When an agent learns a new rule or lesson, it calls `memory_propose`, which stages a proposal in `pre-memory`. You review and approve it in one batch — keeping your memory accurate and noise-free.
71
- 4. **Three scopes:**
72
- - **`personal`** — Your own rules, lessons, and preferences (solo local Git repo, e.g. `~/.faber/memory`).
73
- - **`team`** — Shared engineering rules in a private team Git repo.
74
- - **`project`** — Optional repo-specific memory in `<repo>/.faber/memory/`.
32
+ - **Nothing gets in without your OK.** Assistants can only suggest. You decide what stays.
33
+ - **You can read all of it.** Each memory is a small text file. Open it, edit it, delete it.
34
+ - **It stays small.** Your assistant gets a short table of contents at the start of every chat and looks up details only when it needs them. That keeps chats fast and cheap.
35
+ - **It guards against mistakes.** Passwords, API keys and paths that only work on your computer are blocked before they get saved.
36
+ - **It works with your team, too.** Share a set of rules through a private Git repository, so every teammate's assistant follows them.
75
37
 
76
38
  ---
77
39
 
78
- ## Prerequisites
79
-
80
- - **Node.js 20 or newer** (`node -v` to check)
81
- - **Git** (`git --version` to check)
82
-
83
- You do **not** need to install anything globally to try it — `npx @fabersep/memory` runs the CLI directly.
84
- *(If you prefer shorter commands, install globally once with `npm install -g @fabersep/memory` and use `faber-memory` instead of `npx @fabersep/memory`.)*
85
-
86
- ---
87
-
88
- ## Step-by-Step Quickstart (Solo / Personal Setup)
89
-
90
- Follow these 5 steps in order. Each step is safe and reversible.
91
-
92
- ### Step 1: Create your personal memory folder
93
-
94
- Run:
95
-
96
- ```bash
97
- npx @fabersep/memory setup ~/.faber/memory
98
- ```
99
-
100
- **What this does:**
101
- - Creates `~/.faber/memory` (you can pick any folder path you like) and initializes a local Git repository on branch `main`.
102
- - Saves your configuration in `~/.faber/memory-state/config.json`.
40
+ ## Get started (about 2 minutes)
103
41
 
104
- ### Step 2: Connect your AI coding agent
42
+ You need **Node.js 20 or newer** and **Git**. To check, run `node -v` and `git --version` in a terminal.
105
43
 
106
- First, run a **dry-run** to preview the exact **Before / After** changes without modifying anything:
44
+ **1. Set it up**
107
45
 
108
46
  ```bash
109
47
  npx @fabersep/memory init
110
48
  ```
111
49
 
112
- When the preview looks good, apply it:
50
+ This creates your memory folder (`~/.faber/memory`, with its own Git history), finds the AI assistants on your computer and connects them. It keeps a backup of every file it touches, and you can undo it at any time with `npx @fabersep/memory init --undo`.
113
51
 
114
- ```bash
115
- npx @fabersep/memory init --apply
116
- ```
117
-
118
- **What this does:**
119
- - Compiles your L0 index first to `~/.faber/memory-state/MEMORY.md`.
120
- - Creates a `.bak` backup of every file it touches.
121
- - Adds a clearly marked `<!-- faber-memory:start --> ... <!-- faber-memory:end -->` block and registers the `faber-memory` MCP server (`npx -y @fabersep/memory serve`).
122
- - **Trust & safety:** `init --apply` never disables your AI tool's built-in settings behind your back (for example, it does not edit `~/.claude/settings.json`). If you use Claude Code and want to avoid running two parallel memory systems, see [how to optionally disable Claude auto-memory](docs/troubleshooting.md#claude-auto-memory).
123
-
124
- > **Tip:** Target specific engines with `--engine`:
125
- > ```bash
126
- > npx @fabersep/memory init --engine claude-code,antigravity --apply
127
- > ```
128
- > Revert the wiring cleanly at any time (keeps your memory repos & proposals intact):
129
- > ```bash
130
- > npx @fabersep/memory init --undo
131
- > ```
132
-
133
- #### Supported Engines & What `init --apply` Wires
134
-
135
- | Engine | Instruction File | MCP Config | Notes |
136
- | :--- | :--- | :--- | :--- |
137
- | **Claude Code** | `~/.claude/CLAUDE.md` (`@path` include) | `~/.claude.json` | Native `@path` L0 include + MCP tools |
138
- | **Antigravity** | `~/.gemini/GEMINI.md` (read-at-start rule) | `~/.gemini/config/mcp_config.json` | Reads L0 at start + MCP tools |
139
- | **Claude Desktop** | — | `claude_desktop_config.json` | MCP tools (`--engine claude-desktop`) |
140
- | **Cursor** | — (GAP) | `~/.cursor/mcp.json` | MCP-only |
141
- | **Codex** | — (GAP) | — | MCP-only (manual config) |
142
-
143
- ### Step 3: Import your existing memory files (optional, zero LLM)
144
-
145
- Already have Markdown notes, Claude auto-memory files, an `AGENTS.md`, or Cursor rules? You can import them deterministically without spending any LLM tokens.
146
-
147
- Pick the command that matches your source:
52
+ Want your notes in another folder? Give its path:
148
53
 
149
54
  ```bash
150
- # 1. Any folder of Markdown (.md) files
151
- npx @fabersep/memory import --from markdown-dir ./path/to/your/memory
152
-
153
- # 2. Existing Claude Code auto-memory folder
154
- npx @fabersep/memory import --from claude-memory ~/.claude/projects/<your-project>/memory
155
-
156
- # 3. A single AGENTS.md or CLAUDE.md (split each # / ## heading into its own entry)
157
- npx @fabersep/memory import --from agents-md ./AGENTS.md --split-headings
158
-
159
- # 4. Existing Cursor rules
160
- npx @fabersep/memory import --from cursor-rules ./.cursor/rules
161
- ```
162
-
163
- **What this does:**
164
- - Scans your files, infers frontmatter (`id`, `type`, `summary`), skips old index files (`MEMORY.md`, `CATALOG.md`, `README.md`, `INDEX.md`), checks for near-duplicates and hygiene issues (secrets or machine-specific paths), and stages valid items into **`pre-memory`**.
165
- - Nothing becomes active until you approve it in Step 4.
166
- - **Have `/Users/<name>/...` or `/home/<name>/...` paths in your old notes?** Add `--normalize-paths` to automatically convert them to portable `~/` paths in the staged copy (your source files stay untouched). See [Machine-Specific Paths](docs/troubleshooting.md#machine-specific-paths).
167
-
168
- ### Step 4: Review and approve staged proposals
169
-
170
- Review everything waiting in `pre-memory`:
171
-
172
- ```bash
173
- npx @fabersep/memory review
55
+ npx @fabersep/memory init ~/my-notes
174
56
  ```
175
57
 
176
- You will see a numbered progress bar (`[ 1 / 17 ] Approved: 0 | Rejected: 0 | Skipped: 0`) and each proposal in a clean card. Actions:
177
- - `a` — **approve** (queued for a single batch commit)
178
- - `e` — **edit** the body before approving
179
- - `r` — **reject** and remove the proposal
180
- - `s` — **skip** for now
181
- - `v` — **view full** body (when a long entry is truncated)
182
- - `b` — **back** to the previous proposal to change your mind
183
- - `q` — **quit & save** everything you approved/rejected so far in one commit (pressing `Ctrl+C` also saves your progress safely)
184
-
185
- *(Shortcuts: `npx @fabersep/memory review --approve-all`, `npx @fabersep/memory approve <id1> <id2>`, or `npx @fabersep/memory reject <id>`.)*
186
-
187
- ### Step 5: Verify everything is healthy
188
-
189
- Check your current setup and pending queue:
58
+ **2. Check that everything is connected**
190
59
 
191
60
  ```bash
192
- npx @fabersep/memory status
61
+ npx @fabersep/memory doctor
193
62
  ```
194
63
 
195
- Run the strict validation check (schema, duplicates, 1,500-token L0 budget, and hygiene rules):
196
-
197
- ```bash
198
- npx @fabersep/memory compile --check
199
- ```
64
+ You should see `PASS` lines. Each `WARN` or `FAIL` line comes with a one-line hint on how to fix it.
200
65
 
201
- If both succeed, restart (or start a new session in) your AI coding agent — it now has access to your compiled L0 memory and the 3 `faber-memory` MCP tools.
66
+ **3. Start a new chat in your assistant**
202
67
 
203
- ---
68
+ Tell it something about your project that it would otherwise get wrong, for example:
204
69
 
205
- ## Team Mode Setup (Shared Private Git Repo)
70
+ > *"In this project we run the tests with `make test`, never `npm test`. Please remember that."*
206
71
 
207
- Use Team Mode to share rules across a team — or across your own multiple machines via a private Git repo.
72
+ It should suggest saving this as a memory. (If it doesn't, ask it: *"Propose this as a memory."*)
208
73
 
209
- If you are **starting from scratch in Team Mode**, run these 4 steps:
74
+ **4. Approve what you want to keep**
210
75
 
211
76
  ```bash
212
- # 1. Clone and register your private team memory repo
213
- # Accepts HTTPS, github.com/org/repo, org/repo, or SSH (git@github.com:org/repo.git)
214
- npx @fabersep/memory setup --team https://github.com/your-org/team-memory.git
215
-
216
- # Optional: clone into a custom directory (default: ~/.faber/memory-state/clones/team)
217
- # npx @fabersep/memory setup --team https://github.com/your-org/team-memory.git --path ~/team-memory
218
-
219
- # 2. Connect your AI coding agent (skip if you already ran init --apply in Solo setup)
220
- npx @fabersep/memory init --apply
221
-
222
- # 3. (Optional) Import existing Markdown notes into the team scope
223
- npx @fabersep/memory import --from markdown-dir ./path/to/your/memory --scope team
224
-
225
- # 4. Review & approve (pushes to the team repo and compiles L0)
226
77
  npx @fabersep/memory review
227
78
  ```
228
79
 
229
- To pull teammates' updates later:
80
+ You'll see each suggestion as a card. Press `a` to keep it, `e` to edit it first, `r` to throw it away, `s` to skip, or `q` to save and quit.
230
81
 
231
- ```bash
232
- npx @fabersep/memory sync
233
- ```
82
+ Now open a **new** chat and ask: *"How do I run the tests here?"* Your assistant answers `make test`, without you telling it again.
234
83
 
235
- **How team approvals push:**
236
- - **`--submit-mode auto` (default):** Pushes directly to the team repo's default branch via a clean temporary worktree. If branch protection rejects the push, it automatically falls back to creating a branch and opening a PR.
237
- - **`--submit-mode pr`:** Always submits via a Pull Request (`npx @fabersep/memory config set-submit-mode pr`).
238
-
239
- *(See also: [Step 2: Connect your AI coding agent](#step-2-connect-your-ai-coding-agent) · [Step 3: Import](#step-3-import-your-existing-memory-files-optional-zero-llm) · [Step 4: Review](#step-4-review-and-approve-staged-proposals))*
84
+ > **Already have notes?** If you keep rules in an `AGENTS.md`, a `CLAUDE.md`, Cursor rules or a folder of Markdown files, you can bring them in. They go to the same review step first. See [Importing existing notes](docs/guide.md#importing-existing-notes).
240
85
 
241
86
  ---
242
87
 
243
- ## Everyday Workflow
88
+ ## A normal day with it
244
89
 
245
- ```mermaid
246
- flowchart LR
247
- A["AI Agent works<br/>in your repo"] -->|"Calls memory_propose"| B["pre-memory Inbox<br/>(safe staging)"]
248
- B -->|"Human runs<br/>faber-memory review"| C{"Approve / Edit<br/>/ Reject"}
249
- C -->|"Reject"| D["Discarded<br/>(no Git commit)"]
250
- C -->|"Approve (batched)"| E["Single Git Commit<br/>(or Team PR)"]
251
- E -->|"Auto-recompile"| F["Updated L0 MEMORY.md<br/>(ready for next session)"]
252
- ```
90
+ - **While you work:** nothing to do. Your assistant reads its short memory list at the start and looks things up as it goes.
91
+ - **When it learns something:** it suggests a memory. The suggestion waits in a "to review" box (`pre-memory`) and changes nothing yet.
92
+ - **When you have a minute:** run `npx @fabersep/memory review`. All your approvals are saved together, in one step.
93
+ - **Changed your mind?** Every memory is a file in `~/.faber/memory`. Edit or delete it like any file, then run `npx @fabersep/memory compile`. Git keeps the history.
253
94
 
254
- Once set up, daily use is simple:
255
-
256
- 1. **During a session:** Your agent loads the compact L0 index, searches deeper with `memory_search` + `memory_get`, and proposes new lessons via `memory_propose`.
257
- 2. **Whenever you have a minute:** Run `npx @fabersep/memory status` to see pending proposals, then `npx @fabersep/memory review` to approve or reject them in one batch.
258
- 3. **In team mode:** Run `npx @fabersep/memory sync` whenever you want to pull teammates' updates.
259
-
260
- ### Writing a Memory File by Hand
261
-
262
- Memory files are standard Markdown with a small YAML frontmatter block:
95
+ A memory file looks like this:
263
96
 
264
97
  ```markdown
265
98
  ---
266
- id: no-broad-process-kill
99
+ id: use-pnpm
267
100
  type: rule
268
- scope: personal
269
- summary: Never run pkill or killall by broad pattern; stop only your own PID or task.
270
- tags: [safety, shell]
101
+ summary: Use pnpm, not npm, in this team's projects.
271
102
  ---
272
103
 
273
- Never kill processes by broad name patterns like `pkill node` or `killall python`.
274
- Always stop only the specific PID or background task you started.
104
+ Run `pnpm install` and `pnpm test`. Never commit a package-lock.json.
275
105
  ```
276
106
 
277
- Valid `type` values: `rule`, `decision`, `lesson`, `preference`, `reference`.
278
- After editing or adding a file manually in your memory repo, commit it with Git and run `npx @fabersep/memory compile`.
279
-
280
107
  ---
281
108
 
282
- ## Updating to a Newer Version
283
-
284
- How you update depends on how you run `@fabersep/memory`:
285
-
286
- - **Using `npx` (no global install):**
287
- Pass `@latest` to make sure `npx` fetches the newest release instead of a cached copy:
288
- ```bash
289
- npx @fabersep/memory@latest --help
290
- ```
291
- - **Installed globally via npm:**
292
- ```bash
293
- npm install -g @fabersep/memory@latest
294
- ```
295
- - **Cloned from GitHub source:**
296
- ```bash
297
- cd /path/to/memory
298
- git pull
299
- npm install
300
- npm run build
301
- ```
302
-
303
- After updating, your existing memory repos and config continue working as-is. If a new version updates engine wiring, re-running `npx @fabersep/memory@latest init --apply` is safe and idempotent.
109
+ ## Common questions
304
110
 
305
- ---
306
-
307
- ## Cleaning Up or Resetting
308
-
309
- - **Remove only agent wiring** (keeps all memory repos and pending proposals):
310
- ```bash
311
- npx @fabersep/memory init --undo
312
- ```
313
- - **Clear all pending `pre-memory` proposals** (with confirmation):
314
- ```bash
315
- npx @fabersep/memory reject --all
316
- ```
317
- - **Disconnect a configured root** (removes it from `config.json` without deleting files on disk):
318
- ```bash
319
- npx @fabersep/memory config unset personal
320
- # or: npx @fabersep/memory config unset team
321
- ```
322
- - **Full reset** (undoes agent wiring and deletes `~/.faber/memory-state/` after confirmation; add `--include-personal-repo` to also remove your local personal Git repo):
323
- ```bash
324
- npx @fabersep/memory reset
325
- ```
326
-
327
- ---
328
-
329
- ## Installing Globally or Running from Source
111
+ **Doesn't my AI tool already have memory?**
112
+ Some do, but it stays inside that one tool, and the tool can write to it without asking you. FaberSEP Memory works across tools, and only you can approve what goes in. More in [Why FaberSEP Memory?](docs/why-faber-memory.md)
330
113
 
331
- **Global npm install** (gives you the `faber-memory` command directly):
114
+ **Does it cost anything or send my data anywhere?**
115
+ No. It's free and open source (Apache-2.0), and it runs on your computer. Your notes go only where you push them yourself, for example to a private team repository.
332
116
 
333
- ```bash
334
- npm install -g @fabersep/memory
335
- faber-memory --help
336
- ```
117
+ **Can I use it on my phone?**
118
+ Not directly yet. If you control a computer or server from your phone (for example with Claude Remote Control), memory works in that session.
337
119
 
338
- **From GitHub source** (for contributing or local development):
120
+ **How do I update or remove it?**
121
+ `npx @fabersep/memory@latest --version` fetches the newest version and prints its number. `npx @fabersep/memory init --undo` disconnects your assistants and leaves your notes in place. See [Updating and cleaning up](docs/guide.md#updating-and-cleaning-up).
339
122
 
340
- ```bash
341
- git clone https://github.com/fabersep/memory.git
342
- cd memory
343
- npm install
344
- npm test
345
- npm link
346
- ```
123
+ **Something went wrong.**
124
+ Run `npx @fabersep/memory doctor` first. Then check [Troubleshooting](docs/troubleshooting.md) or [open an issue](https://github.com/fabersep/memory/issues).
347
125
 
348
126
  ---
349
127
 
350
- ## CLI Command Reference
351
-
352
- | Command | Description |
353
- | :--- | :--- |
354
- | `setup [path]` | Initialize a local solo (personal) memory Git repo. |
355
- | `setup --team <url\|org/repo> [--path <dir>] [--submit-mode auto\|pr]` | Clone and configure a shared team memory repo. |
356
- | `config` | Print current `~/.faber/memory-state/config.json`. |
357
- | `config set-path <personal\|team> <new-path>` | Move a configured memory root while keeping its UUID. |
358
- | `config set-submit-mode <auto\|pr>` | Change team approval mode (`auto` push with PR fallback, or always `pr`). |
359
- | `config unset <personal\|team>` | Disconnect a root from config without deleting files on disk. |
360
- | `init [--apply \| --undo] [--engine ...] [--project-hint]` | Preview (Before/After), apply (with `.bak` backups), or undo user-level agent wiring. |
361
- | `compile [--check] [--repo <dir>]` | Compile L0 `MEMORY.md`, or validate schema/budget/hygiene in CI (`--check`). |
362
- | `sync [--timeout <ms>]` | Fast-forward pull remote updates and recompile L0. |
363
- | `status` | Show compiled L0 status, configured roots, warnings, and pending/stale proposals. |
364
- | `review [--approve-all]` | Interactively approve, edit, reject, skip, go back, or quit & save `pre-memory` proposals. |
365
- | `approve <id...> [--mode auto\|pr]` | Approve one or more proposals by ID in a single batch commit. |
366
- | `reject <id>` / `reject --all [--yes]` | Reject and delete one or all pending proposals. |
367
- | `reset [--include-personal-repo] [--yes]` | Undo agent wiring and wipe local state (optionally including personal repo). |
368
- | `import --from <type> <path> [--scope ...] [--split-headings] [--normalize-paths] [--approve]` | Deterministically import existing memory into `pre-memory`. |
369
- | `serve` | Run the 3-tool stdio MCP server (used by your AI agent's MCP config). |
128
+ ## Going further
370
129
 
371
- ---
130
+ - **[User guide and reference](docs/guide.md):** how it works inside, team setup, importing, every command, the MCP tools and where files live.
131
+ - **[Why FaberSEP Memory?](docs/why-faber-memory.md):** comparisons with built-in memory and vector databases, and why the design keeps prompt caching cheap.
132
+ - **[Troubleshooting](docs/troubleshooting.md):** every warning, explained.
133
+ - **[Contributing](CONTRIBUTING.md)** and **[Changelog](CHANGELOG.md)**.
372
134
 
373
- ## MCP Tools
374
-
375
- The MCP server exposes exactly **3 lean tools** (~350 tokens total tool schema):
376
-
377
- | Tool | Purpose |
378
- | :--- | :--- |
379
- | `memory_search` | Pure-JS BM25 full-text search across active `team`, `personal`, and `project` scopes (returns compact L1 summaries). Automatically reindexes on Git `HEAD` change. |
380
- | `memory_get` | Fetch the full L2 Markdown body of a specific entry by ID. |
381
- | `memory_propose` | Stage a new entry or update into `pre-memory` for human review (never writes directly to active memory). |
382
-
383
- ---
384
-
385
- ## Documentation & Specs
386
-
387
- This repository follows the [FaberSEP Spec](https://github.com/fabersep/spec) standard:
388
-
389
- - [Why FaberSEP Memory? (FAQ & Comparisons)](docs/why-faber-memory.md)
390
- - [Troubleshooting & Edge Cases](docs/troubleshooting.md)
391
- - [Master PRD](docs/master-prd.md)
392
- - [Architecture](docs/architecture.md)
393
- - [Core Memory PRD](docs/features/01-core-memory/prd.md)
394
- - [BDD Acceptance Criteria (55 scenarios)](docs/features/01-core-memory/acceptance_criteria.md)
395
-
396
- ---
135
+ FaberSEP Memory is part of [FaberSEP](https://github.com/fabersep), open-source tools that help AI coding assistants work with more discipline.
397
136
 
398
137
  ## License
399
138
 
@@ -24,3 +24,5 @@ export interface NearDuplicateMatch {
24
24
  }
25
25
  export declare function computeSimilarity(textA: string, textB: string): number;
26
26
  export declare function findNearDuplicates(candidateSummary: string, candidateBody: string, activeEntries: MemoryEntry[], pendingProposals: Proposal[], threshold: number): NearDuplicateMatch[];
27
+ /** Entries scoring in [floor, threshold): related but not blocking (01 FR-04 amendment). */
28
+ export declare function findRelatedEntries(candidateSummary: string, candidateBody: string, activeEntries: MemoryEntry[], pendingProposals: Proposal[], floor: number, threshold: number, limit?: number): NearDuplicateMatch[];
package/dist/src/bm25.js CHANGED
@@ -181,3 +181,9 @@ export function findNearDuplicates(candidateSummary, candidateBody, activeEntrie
181
181
  matches.sort((a, b) => b.similarity - a.similarity);
182
182
  return matches;
183
183
  }
184
+ /** Entries scoring in [floor, threshold): related but not blocking (01 FR-04 amendment). */
185
+ export function findRelatedEntries(candidateSummary, candidateBody, activeEntries, pendingProposals, floor, threshold, limit = 3) {
186
+ return findNearDuplicates(candidateSummary, candidateBody, activeEntries, pendingProposals, floor)
187
+ .filter((m) => m.similarity < threshold)
188
+ .slice(0, limit);
189
+ }