@hilbras/remembra 3.3.0 → 3.5.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.
@@ -63,9 +63,10 @@ in `/repo/b`. Global memories are always visible.
63
63
  | `content` | string | required — written as a standalone statement |
64
64
  | `scope` | string | defaults to `global` |
65
65
  | `tags` | string[] | boosts keyword matching |
66
- | `importance` | 1–5 | defaults to 3; higher ranks higher |
66
+ | `importance` | 1–5 | defaults to 3; higher ranks higher (same weight in both modes) |
67
67
  | `source` | string | originating session/client (optional) |
68
- | `id` | 8-char id | assigned automatically |
68
+ | `provenance` | `explicit \| auto` | set automatically: `explicit` = stored deliberately, `auto` = digest-extracted; pre-3.4.0 files are neutral |
69
+ | `id` | 12-char id | assigned automatically (collision-safe) |
69
70
  | `createdAt` / `updatedAt` | ISO timestamps | assigned automatically |
70
71
 
71
72
  ## Retrieval ranking
@@ -75,13 +76,29 @@ When `memory_search` runs, memories are scored in layers:
75
76
  1. **Roles always pass** (+1000) — instructions never get filtered out.
76
77
  2. **Scope gate** — other projects' memories are excluded entirely;
77
78
  the current scope scores highest (+150), `global` always passes (+100).
78
- 3. **Importance** — up to +50 for importance 5.
79
- 4. **Recency** — decays over roughly a 30-day half-life (up to +20).
80
- 5. **Keyword overlap** up to +60 based on the fraction of query terms matched
81
- in content and tags.
82
-
83
- Embeddings are planned for v2 and will slot in behind the same `memory_search`
84
- interface without changing any client.
79
+ 3. **Provenance** — deliberately stored memories +10 over auto-extracted ones.
80
+ 4. **Importance** — up to +20 for importance 5 *identical weight in keyword
81
+ and semantic mode, so enabling embeddings never reorders by importance*.
82
+ 5. **Recency** exponential decay, ~30-day half-life (up to +20). Never a
83
+ hard cutoff: a 90-day-old memory still earns ~2.5 points.
84
+ 6. **Keyword overlap** up to +60 based on the fraction of query terms matched
85
+ in content and tags (keyword mode). With embeddings on, cosine similarity
86
+ (up to +100) takes over as the primary signal while importance, provenance
87
+ and recency keep the same weights.
88
+
89
+ ## Duplicate handling
90
+
91
+ Digest extraction dedupes in three tiers:
92
+
93
+ 1. **Exact** — normalized `type + scope + content` match → skip (or revive if
94
+ archived).
95
+ 2. **Fuzzy fast path** — textually near-identical (punctuation/case/typos,
96
+ Sørensen–Dice ≥ 0.9 over bigrams) *and* unchanged quantities → skip
97
+ without an LLM call. A changed number (100→500 rpm, v2→v3) is a different
98
+ fact and always falls through.
99
+ 3. **LLM merge** — similar-but-evolved memories go to the model, which stores,
100
+ skips, or merges them (the old text is preserved under a `> superseded`
101
+ note).
85
102
 
86
103
  ## Storage format
87
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hilbras/remembra",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "External memory for AI assistants — remember facts, decisions, roles and history across sessions. MCP server for OpenCode, Claude Code, Cline, Kimi Code and more.",
5
5
  "type": "module",
6
6
  "bin": {