@oh-my-pi/pi-mnemopi 18.10.4 → 18.11.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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.11.0] - 2026-10-14
6
+
7
+ ### Fixed
8
+
9
+ - Fixed polyphonic recall ranking unrelated memories above relevant ones when the query shared only a common word such as "that" with an extracted fact subject ([#15512](https://github.com/can1357/oh-my-pi/issues/15512)).
10
+
5
11
  ## [18.9.0] - 2026-10-11
6
12
 
7
13
  ### Added
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-mnemopi",
4
- "version": "18.10.4",
4
+ "version": "18.11.0",
5
5
  "description": "Local SQLite memory engine for omp agents",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -42,10 +42,10 @@
42
42
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
43
43
  },
44
44
  "dependencies": {
45
- "@oh-my-pi/pi-ai": "18.10.4",
46
- "@oh-my-pi/pi-catalog": "18.10.4",
47
- "@oh-my-pi/pi-natives": "18.10.4",
48
- "@oh-my-pi/pi-utils": "18.10.4"
45
+ "@oh-my-pi/pi-ai": "18.11.0",
46
+ "@oh-my-pi/pi-catalog": "18.11.0",
47
+ "@oh-my-pi/pi-natives": "18.11.0",
48
+ "@oh-my-pi/pi-utils": "18.11.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "fastembed": "3.0.0",
@@ -5,6 +5,7 @@ import { closeQuietly, type DatabasePath, openDatabase } from "../db";
5
5
  import { backfillConsolidatedFacts, ensureVeracityConsolidator } from "./beam/consolidate";
6
6
  import type { BeamMemoryState, JsonValue, Metadata, RecallResult, RecallTierLabel } from "./beam/types";
7
7
  import { EpisodicGraph } from "./episodic-graph";
8
+ import { STOP_WORDS } from "./synonyms";
8
9
  import { VeracityConsolidator } from "./veracity-consolidation";
9
10
 
10
11
  export type PolyphonicVoice = "hybrid" | "vector" | "graph" | "fact" | "temporal";
@@ -229,15 +230,20 @@ function queryTokens(query: string): string[] {
229
230
  return tokens;
230
231
  }
231
232
 
232
- /** Subject candidates for the fact voice: every 3+ char query word plus adjacent word pairs. */
233
+ /**
234
+ * Subject candidates for the fact voice: every 3+ char query word plus adjacent word pairs.
235
+ * Stopwords never anchor a subject on their own — the regex extractor stores sentence-initial
236
+ * words like `That` as subjects, so a bare `that` in the query would pull in unrelated memories.
237
+ */
233
238
  function factSubjectCandidates(query: string): string[] {
234
239
  const tokens = queryTokens(query);
235
240
  const seen = new Set<string>();
236
241
  for (let i = 0; i < tokens.length; i++) {
237
242
  const word = tokens[i] as string;
238
- if (word.length >= 3) seen.add(word);
243
+ const isContent = !STOP_WORDS.has(word);
244
+ if (isContent && word.length >= 3) seen.add(word);
239
245
  const next = tokens[i + 1];
240
- if (next !== undefined) seen.add(`${word} ${next}`);
246
+ if (next !== undefined && (isContent || !STOP_WORDS.has(next))) seen.add(`${word} ${next}`);
241
247
  }
242
248
  return [...seen];
243
249
  }