@amemhq/core 2.1.0 → 2.1.1

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.
@@ -9,7 +9,7 @@ import {
9
9
  resolveAliasRaw,
10
10
  scrollIdsRaw,
11
11
  switchToMigrated
12
- } from "./chunk-XEMQZNLD.js";
12
+ } from "./chunk-3HJV3LLV.js";
13
13
 
14
14
  // src/cli-migrate.ts
15
15
  var USAGE = `amem-migrate \u2014 move a memory store onto a different embedding model
package/dist/index.cjs CHANGED
@@ -1950,7 +1950,12 @@ async function searchMemory(query, topK = 5, agentId = "main", opts) {
1950
1950
  keywords: note.keywords,
1951
1951
  links: note.links,
1952
1952
  timestamp: note.timestamp,
1953
- similarity: embSimMap.get(id) ?? bfsSimMap.get(id) ?? 0,
1953
+ // Neither map covers a note that got here on BM25 alone: it was never in
1954
+ // the dense results, and it was not expanded into. That is a real cosine
1955
+ // nobody had measured, not a zero — and reporting 0 made a lexical match
1956
+ // look like the least relevant row in the list. Both vectors are already
1957
+ // in hand, so measuring it is one dot product.
1958
+ similarity: embSimMap.get(id) ?? bfsSimMap.get(id) ?? cosineSimilarity(queryEmbedding, note.embedding),
1954
1959
  rrf: rrfMap.get(id) ?? 0,
1955
1960
  via,
1956
1961
  topics: note.topics ?? [],