Coding-agent memory whose status and project filters sit on the keyword leg and not the vector leg

Recall (edheltzel)

An MIT local memory for coding agents: one SQLite file with FTS5 and optional Ollama vectors, filled by Stop-hook extraction and MCP writes.

LicenceMIT in LICENSE, package.json and the Claude Code plugin manifest
Size23,703 lines of TypeScript in 109 files under src, 9,693 in 42 hook files, 1,411 lines of host adapters and a 1,752-line Go dashboard; 40,741 lines of tests
Activity345 commits dated 31 January to 2 December 2026, 282 under the maintainer's account and 63 under one other that the .mailmap also assigns Cursor Agent and Claude commits to; the GitHub repository was created on 4 March; version 0.10.3
Tests1,674 bun test cases in 147 files; CI runs bun test, lint, build and two OpenCode end-to-end suites on macOS, and the vector and install tests on Ubuntu; none run here

Carries 3 of 7 rubric mechanisms. Most systems here carry none or one (41%), and a dash means the mechanism was not found at this commit — not that the system needed it. Each mark is one LLM reviewer's reading of the code at this commit rather than a run of it — known limits.

  • Tombstone
  • Trust state
  • Bi-temporal
  • Scope enforced
  • Mutation audit
  • Human review
  • Negative evals

1. Executive Summary

Recall is a local memory for coding agents: one SQLite file with FTS5 and optional Ollama embeddings, reached through an MCP server, a CLI and lifecycle adapters for nine hosts. A Stop hook spawns a detached extractor after each turn that sends the transcript to the claude CLI or Ollama and parses decisions, learnings and breadcrumbs from the answer. A session-start hook injects an identity file and the top records of the current project.

Notable: the session-start block reads only the project it detects from the checkout, and a committed test seeds a second project at higher importance and asserts it absent. One duplicate predicate is shared by the keyword leg, the vector leg and the CLI, and is tested on each. Provenance is stamped by the write path, and the MCP add tool takes none.

Weak: the vector leg of hybrid search applies neither the decision status nor the project. memory_add supersedes any active decision in any project that shares three long words with the new one. Extraction labels records with a different project name than session start reads. No supersede, revert or prune leaves a record.

Three marks are present and four are withheld (section 9).

Licence. MIT in LICENSE (copyright 2026 Ed Heltzel), restated in package.json, site/LICENSE and the Claude Code plugin manifest; the grant is plain and the tree agrees with it. CHANGELOG.md points to an ACKNOWLEDGMENTS.md for its MemPalace credits (CHANGELOG.md:1030), a file absent from the tree; the README names MemPalace and PAI as inspiration. No SECURITY.md is committed.

2. Mental Model

A record enters as one of four kinds. An agent writes one through memory_add, stamped user_authored; the extractor writes many, stamped extracted (src/mcp-server.ts:889-901, hooks/lib/sqlite-writers.ts:88-92). Every record starts trusted. Only decisions carry a status, and it has three values: active, superseded and reverted, the last described to the agent as a decision that was wrong (src/db/schema.ts:227, src/mcp-server.ts:963-972).

A decision stops being served when someone supersedes or reverts it. The agent can do that with decision_update, a person with recall decision supersede, and memory_add does it unasked when a new decision shares three words of five letters or more with an active one (src/mcp-server.ts:875-887). Nothing links the superseded row to its replacement.

Whether a stopped decision stays out depends on which leg reads it. The keyword leg, the recent lists and the session-start block filter status = 'active'. The vector leg looks a hit up by id and returns its text whatever its status.

Diagram — every decision starts active; the keyword leg and session start filter status and project, the vector leg filters neither, and fusion merges both
Diagram source
%% caption: every decision starts active; the keyword leg and session start filter status and project, the vector leg filters neither, and fusion merges both
flowchart TD
    STOP["Stop hook:<br/>detached extractor"] --> EXT["claude CLI or Ollama<br/>quality gate, scrub"]
    EXT --> JEV{"Jev key?"}
    JEV -- "yes" --> KEEP["keep, demote<br/>or drop"]
    JEV -- "no" --> ROWS
    KEEP --> ROWS["rows: active,<br/>provenance extracted"]
    ADD["memory_add<br/>user_authored"] --> OVL{"3 long words shared<br/>with an active one?"}
    OVL -- "yes, any project" --> SUP["old decision<br/>superseded"]
    OVL --> ROWS
    ROWS --> DB["SQLite: FTS5<br/>+ embeddings"]
    DB --> KW["keyword leg:<br/>active, project, not dup"]
    DB --> VEC["vector leg:<br/>not dup only"]
    KW --> RRF["RRF fusion"]
    VEC --> RRF
    RRF --> CTX["agent context"]
    DB --> L1["session start:<br/>active, detected project"]
    L1 --> CTX

3. Architecture

src/ holds the database layer, the library and the CLI: schema and migrations in src/db/, records, search and lifecycle in src/lib/memory.ts, dedup, aging, repair and the learned tail in src/lib/, and one command module per CLI verb. src/mcp-server.ts is the stdio MCP server. hooks/ holds the Claude Code lifecycle scripts and a self-contained hooks/lib/ that does not import from src/, so the extractor and session-start code carry their own copies of some helpers. hosts/ carries the OpenCode, Pi, omp and JCode adapters, the Claude and Codex plugin bundles, and the Go dashboard.

Deployment and ergonomics

./packaging/install.sh builds the CLI with Bun, registers per-host hooks and symlinks, and creates ~/.agents/Recall/recall.db with mode 0600. Embeddings need a local Ollama and a manual recall embed backfill; without them search is keyword-only. package.json names the package recall-memory, the npm name the README warns belongs to an unrelated project. The optional Jev scorer sends scrubbed candidates to an outside service when a key is set.

4. Essential Implementation Paths

  • Capture. The Stop hook checks a tracker and a semaphore, then spawns itself detached with --extract (hooks/RecallExtract.ts:1143-1144). The child runs the shared core: model call, quality gate, scrub, threat report, dual write (hooks/lib/extract-core.ts:84-129).
  • Parse and score. dualWriteToSqlite parses decisions, learnings and breadcrumbs, scores them through Jev when a key resolves, and writes kept rows, demoted ones at importance 3 (hooks/lib/extraction-parsers.ts:236-300, hooks/lib/jev.ts:433-444).
  • Agent write. memory_add scrubs, runs auto-supersede for decisions and inserts the row (src/mcp-server.ts:823-961).
  • Keyword search. search runs one FTS5 query per table with the status, duplicate and project predicates (src/lib/memory.ts:416-512).
  • Hybrid search. hybridSearch runs search with the project, then vectorSearch with no project, and fuses both by reciprocal rank (src/mcp-server.ts:303-455).
  • Session start. gatherContext detects the project and assembles L0 and L1 (hooks/lib/session-start-context.ts:438-456).

5. Memory Data Model

decisions holds the text, reasoning, alternatives, status, importance 1 to 10, provenance and a confidence of high, medium or low (src/db/schema.ts:218-234). learnings and breadcrumbs have the same project, importance and provenance columns and no status; a breadcrumb may carry expires_at (:237-269). loa_entries hold a session extract with message range, parent entry and source ids (:278-303). messages hold raw turns. telos and documents hold the person's goals and imported files.

dedup_lineage records a survivor and a duplicate with a reason, similarity and a status of marked or deleted; its only writer is an INSERT (src/db/schema.ts:388-404, src/lib/dedup.ts:645-650). A marked duplicate stays in its table and is hidden by notMarkedDuplicateSql (src/lib/dedup.ts:252-259).

There is one time per record, created_at. A supersede or revert changes the status in place and leaves no time or reason.

6. Retrieval Mechanics

Keyword search ranks each table by FTS5 BM25, ranking decisions by confidence first; a bias_type multiplies one table's rank by 4 (src/lib/memory.ts:344-357, :457-468). Hybrid search fuses that list with a cosine list from sqlite-vec or a brute-force scan (src/mcp-server.ts:228-279).

The two legs filter differently. The keyword leg drops non-active decisions, marked duplicates and, when asked, other projects (src/lib/memory.ts:463-465). The vector leg drops marked duplicates and rows that are not published, then resolves each hit's text by id (src/mcp-server.ts:129-190, src/lib/published-records.ts:22-38, src/lib/memory.ts:716-725). Embeddings are built for every decision regardless of status (src/lib/repair.ts:66-76, src/commands/embed.ts:78-85). A superseded decision with a close vector returns through memory_hybrid_search, context_for_agent and recall hybrid.

memory_search with a project and no keyword hit retries through hybrid search, whose comment calls it a global query; the guard checks only for a table filter (src/mcp-server.ts:531-537, src/lib/search-fallback.ts:40-45). The vector half of that retry reads every project.

Session start ranks by importance with four LoA slots reserved, keeps low-confidence decisions out, and caps the block at 12 records (hooks/lib/session-start-context.ts:27-28, :236-247, :385-406).

7. Write Mechanics

Extraction does not block the agent: the hook returns once the child is spawned, and a record is searchable when the child commits after its model call returns. A tracker skips a transcript that has not grown. The quality gate requires 50 words and two named section headers (hooks/lib/extraction-quality.ts:12-30). No background pass rewrites the whole store; aging and prune run on request or from a quarterly cron.

The project label is composed on the write side apart from the read side. The Claude extractor uses the most recently modified folder under ~/.claude/sessions/<date> or the directory basename (hooks/RecallExtract.ts:630-644). Markdown drops from OpenCode and Pi are labelled <host>/<session id> (:799-811). The batch catch-up decodes Claude's project directory by turning every hyphen into a slash, and falls back to $HOME when that path does not exist (hooks/RecallBatchExtract.ts:272-281). Session start reads the git remote's repository name first (hooks/lib/session-start-context.ts:60-74). A record labelled one way is invisible to a session that names the project the other.

Operational cost

One model call per extraction, with inputs over 120,000 characters chunked (hooks/lib/extraction-input.ts:4), and one Jev request when configured. Embedding is a separate local Ollama call per record at backfill time.

8. Agent Integration

The MCP server registers nine tools: memory_search, memory_hybrid_search, memory_recall, loa_show, memory_add, decision_update, memory_dump, memory_stats and context_for_agent (src/mcp-server.ts:496, :617, :698, :767, :823, :964, :1032, :1135, :1170). Every read takes project as an optional argument. Claude Code gets SessionStart, Stop and PreCompact hooks and a plugin with twelve skills; Codex, Pi, omp, OpenCode, Grok, Cursor, JCode and Empryo get the subsets their hosts support.

The learned tail runs after extraction and writes up to 15 notes into a managed block of ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md and the other hosts' global rules files (hooks/lib/learned-tail.ts:41-60, hooks/RecallExtract.ts:565-590). A high-confidence note stamped user_authored qualifies on its own (hooks/lib/learned-tail.ts:394-399), and memory_add stamps every agent write that way.

9. Reliability, Safety, and Trust

Two legs, two predicates

The status and project predicates live in the SQL of the keyword leg and of the session-start fetchers. The duplicate predicate lives in a shared function that the keyword leg, the vector leg and the CLI each call, with a test on each path (tests/commands/dedup.test.ts:448-491). Fusion merges both lists with no second filter. The predicate written once reached every leg; the two written per query reached one.

Supersession by word overlap

memory_add runs an FTS5 OR query over the first ten words of four letters or more in the new decision, then supersedes any of the top three active matches sharing three words of five letters or more (src/lib/memory.ts:234-253, src/mcp-server.ts:875-887). The query takes no project. A decision about "database migration strategy" in one repository can retire one in another, and the reply lists the ids it superseded. No test covers this path.

Provenance and the tail

Provenance is stamped by the write path, and ADR-0001 records why the MCP add tool takes no provenance argument (docs/adr/0001-record-provenance-automatic-write-path-metadata.md:19). The value it stamps is user_authored whether a person or the agent chose the words, and the learned tail treats that value as enough to copy a high-confidence note into every host's global rules file.

Marks

  • trust_state — present. Decision status filters keyword search, the recent lists and session start; only decisions carry it, and the vector leg ignores it.
  • scope_enforced — present. Session start reads only the detected project, with a populated leakage test; search scopes only when asked, and its vector leg never does.
  • negative_eval — present. Another project's rows absent from the session-start block, and a marked duplicate absent from keyword, CLI semantic and CLI hybrid results beside its survivor.
  • bitemporal — withheld. One created_at per record; supersede and revert record no time.
  • audit_log — withheld. dedup_lineage is insert-only and records dedup marks and deletes; supersede, revert, prune, aging and pinning change rows with no record.
  • human_review — withheld. Nothing waits in a state for a person. The omp recall_dump tool asks for a yes in the omp UI before saving (hosts/omp/recall.ts:475-481); the MCP memory_dump saves without asking.
  • tombstone — withheld. A reverted decision is a status on its row, and extraction inserts a re-extracted decision as a new active row. The extractor appends a "things to reject" section to REJECTIONS.log (hooks/RecallExtract.ts:477-492), which no write path reads.

10. Tests, Evals, and Benchmarks

The tree carries 1,674 bun test cases in 147 files. CI runs bun test, lint, the build and the OpenCode end-to-end suites on macOS, and the vector and install tests on Ubuntu (.github/workflows/ci.yml). I ran none of them.

The negative cases are populated. The leakage test seeds project B at importance 10 beside six project A decisions and asserts A's block holds no B row (tests/hooks/l1-golden-leakage.test.ts:113-124, tests/fixtures/l1-golden/seed.ts:24-35). The dedup tests mark one of an identical pair and assert the survivor present and the duplicate absent on the keyword, CLI semantic and CLI hybrid paths (tests/commands/dedup.test.ts:93-111, :448-474).

The decision lifecycle is tested as transitions on the row (tests/lib/memory.test.ts:177-222), not as absence from a read. Cases to want first: a superseded decision with a close embedding, queried through memory_hybrid_search; a project-scoped hybrid query over two projects; and a memory_add in one project beside a similar decision in another.

docs/benchmarks/ holds suites for token cost, precision under noise and latency, with 39 committed result files; the supersession suite is listed as planned and has no code (docs/benchmarks/README.md). No paper describes Recall: CITATION.cff is absent, and a search for arXiv, DOI and BibTeX references returns nothing.

11. For Your Own Build

Steal

  • Derive the session's scope from the checkout. The session-start block needs no argument from the model, and a leakage test with the other project at higher importance proves the filter, not the ranking.
  • Put an exclusion in one shared function. The duplicate predicate reaches every leg because it is one function each leg calls.
  • Stamp provenance on the write path. Give the agent's add tool no provenance argument.

Avoid

  • Do not filter status in per-leg SQL. Put status and scope in the shared predicate the vector leg calls, and test against the fused result.
  • Do not supersede on word overlap across scopes. Scope the similarity query and name the replacement on the retired row.
  • Do not compose the project label twice. One function, used by the writer and the reader.
  • Do not let a tool's stamp stand for a person. user_authored on an agent write promotes it into every host's global rules.

Fit

Fits one developer who wants a zero-infrastructure memory shared by several coding agents on one machine, and who mostly reads it through the session-start block. The keyword path and session start are coherent; the semantic path does not hold the same rules.

Walk away if memory must be correctable with the correction holding on every read, if several projects with similar vocabulary share one database, or if a change to memory must leave a trail.

12. Open Questions

  • Whether the vector leg is meant to omit the status and project predicates, given that the duplicate predicate was added to it.
  • Whether memory_add auto-supersede is meant to search across projects.
  • Whether anything in the install writes the ~/.claude/sessions folders the extractor reads, since nothing in the tree creates them.

Appendix: File Index

  • Schema and migrations: src/db/schema.ts, src/db/migrations.ts, src/db/vec.ts
  • Records, search, lifecycle: src/lib/memory.ts, src/lib/published-records.ts, src/lib/search-fallback.ts
  • Dedup, aging, prune, repair: src/lib/dedup.ts, src/lib/aging.ts, src/commands/prune.ts, src/lib/repair.ts, src/commands/embed.ts
  • MCP server: src/mcp-server.ts
  • Capture and extraction: hooks/RecallExtract.ts, hooks/RecallBatchExtract.ts, hooks/lib/extract-core.ts, hooks/lib/extraction-parsers.ts, hooks/lib/sqlite-writers.ts, hooks/lib/jev.ts, hooks/lib/extraction-quality.ts
  • Session start and tail: hooks/lib/session-start-context.ts, hooks/RecallStart.ts, hooks/lib/learned-tail.ts
  • Hosts: hosts/omp/recall.ts, hosts/plugins/recall-claude/
  • Provenance decision: docs/adr/0001-record-provenance-automatic-write-path-metadata.md
  • Tests: tests/hooks/l1-golden-leakage.test.ts, tests/fixtures/l1-golden/seed.ts, tests/commands/dedup.test.ts, tests/lib/memory.test.ts

Recorded searches

Run from the repository root at the pinned commit with /usr/bin/git grep. .gitmodules is absent.

  • Every reader of decision status. git grep -n -E "status ?= ?'active'|'superseded'|'reverted'" -- src hooks lib hosts, outside the host-ingest generation tables, returns the similarity lookup at src/lib/memory.ts:244, the keyword leg at :463, the recent list at :776-777, session start at hooks/lib/session-start-context.ts:241, :318, the tail at hooks/lib/learned-tail.ts:254, the dedup scan at src/lib/dedup.ts:296, prune at src/commands/prune.ts:117 and the writers; nothing in src/db/vec.ts, src/lib/published-records.ts or src/commands/embed.ts.
  • The vector leg takes no project. git grep -n -E "vectorSearch" -- src returns the definition at src/mcp-server.ts:228 and calls at :349 and :602, each with an embedding and a limit only.
  • No validity time. git grep -n -i -E "valid_from|valid_to|valid_until|valid_at|as_of" -- src hooks hosts lib returns nothing.
  • No review state. git grep -n -i -E "approve|needs_review|pending_review|awaiting_review" -- src hooks hosts lib returns the omp dump confirmation at hosts/omp/recall.ts:479-481 and four --no-approve flags in lib/install-lib.sh.
  • No value tombstone. git grep -n -i -E "tombstone|rejected_value|blocklist|denylist" -- src hooks hosts lib returns one comment at src/db/migrations.ts:449. git grep -n -E "REJECTIONS_PATH|REJECTIONS\.log" -- src hooks hosts lib returns the writer in hooks/RecallExtract.ts, the document importer pattern at src/commands/import-docs.ts:28 and the archive scrubber; no write path reads it.
  • The lineage table is insert-only. git grep -n -E "INSERT INTO dedup_lineage|UPDATE dedup_lineage|DELETE FROM dedup_lineage" -- src hooks hosts lib returns src/lib/dedup.ts:649 only.
  • No security policy, acknowledgements file or citation file. git ls-files | grep -i -E 'security|acknowledg|citation' returns nothing, while CHANGELOG.md:1030 links ACKNOWLEDGMENTS.md.
  • No paper. git grep -n -i -E "arxiv|doi\.org|bibtex" -- . returns nothing.

History

2026-12-04 — 9305d58f…. First reading, from the 2026-12-03 triage shortlist, at the head of main reached on 2026-12-04; the shortlist assessed 396e55ed6102, which the depth-1 clone does not hold. Screened: seven auto-run surfaces (.claude-plugin/, .claude/settings.json, .claude/settings.local.json, .mcp.json, hooks/, and the nested plugin hosts/plugins/recall-claude/ with its plugin.json and .mcp.json); one build-time execution point (the package.json prepublishOnly script). Seven dependency surfaces sit inside the cooldown, a count the depth-1 clone inflates; one floating surface (package.json); AGENTS.md and CLAUDE.md read as data. Nothing was installed, built or run, and none of the 1,674 tests was run. Three marks (section 9).