feat(memory): Pillar B — cross-project recall + opt-in proactive injection (0.16.0)#33
Merged
Merged
Conversation
Pillar B foundation (bd claude-memory-9z9): recall reasoning across ALL projects, not just the current repo. - tj-core::memory: a global SQLite index (data_dir/memory.sqlite) mirroring high-signal events (decisions, rejections, constraints) with their embeddings from every project. sync_from_project (idempotent, flags superseded decisions), search (cosine top-k, down-ranks contradicted), count. paths::memory_db(). - tj-cli: `task-journal recall "<query>"` — cross-project semantic search of prior decisions/rejections/constraints. embed/ask now sync the project into the global index (best-effort, never fails the command). Tests: sync+search across a project (core, ranks the right decision + model-scoped), CLI recall surfacing a decision from a *different* project via the shared index. Green on default and --no-default-features. Next (P2.2): opt-in proactive injection on UserPromptSubmit — fast keyword path, hard token budget, dedup, gated; default stays quiet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(P2.2, 0.16.0) Completes Pillar B (bd claude-memory-9z9). - tj-core::memory: FTS5 mirror on the global index + keyword_search — a fast, embedding-free lookup cheap enough to run on every prompt. - tj-cli `recall-hook`: opt-in UserPromptSubmit injector. Reads the prompt, keyword-searches the global index for relevant prior decisions/rejections/ constraints across all projects, and emits a budgeted additionalContext block — a guardrail before the agent re-decides or repeats a dead-end. Never blocks the prompt (silent on miss/error). Gated by TJ_PROACTIVE_RECALL=0; budget via TJ_RECALL_BUDGET_CHARS / TJ_RECALL_K; reuses the classifier recursion guard. - install-hooks --proactive-recall wires it into UserPromptSubmit alongside the nudge; OFF by default (no behaviour change unless opted in). is_tj uninstall filter updated so re-install stays idempotent. Tests: keyword_search match/no-match (core), recall-hook injects + is gated (CLI), install-hooks --proactive-recall wires it and default does not (CLI). Green on default and --no-default-features. Version 0.16.0; inter-crate version reqs bumped to resolve the release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pillar B of the memory epic (
claude-memory-9z9): the journal recalls relevant prior reasoning across your entire history, not just the current repo — the thing single-project memory tools can't do.data_dir/memory.sqlite): mirrors high-signal events (decisions, rejections, constraints) + embeddings + an FTS5 index from every project.ask/embedkeep it current (best-effort). Superseded decisions down-ranked.task-journal recall "<query>": cross-project semantic search of prior decisions/rejections/constraints.install-hooks --proactive-recall): a UserPromptSubmit hook that injects a budgeted block of relevant priors before you act — a guardrail against re-deciding or repeating a dead-end. Off by default. Fast keyword path (no model load on the prompt path, so no latency regression); gated byTJ_PROACTIVE_RECALL=0, budgeted byTJ_RECALL_BUDGET_CHARS/TJ_RECALL_K; reuses the recursion guard; silent on miss/error.Why two retrieval paths
recall(on-demand) uses the model2vec semantic backend. The per-prompt hook uses keyword/FTS5 — loading a model on every prompt would be too slow, and we just removed spam from that exact hook in 0.14.4, so the proactive path is deliberately cheap and opt-in.Tests
keyword_searchmatch/no-match (core),recallsurfacing a decision from a different project (CLI),recall-hookinjects + is gated byTJ_PROACTIVE_RECALL=0(CLI),install-hooks --proactive-recallwires it and the default does not (CLI).fmt/clippyclean on default and--no-default-features.🤖 Generated with Claude Code