@edihasaj/recall 0.8.7 → 0.8.9

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  computeMemoryValueReport
3
- } from "./chunk-B6ZL6O6A.js";
3
+ } from "./chunk-WEA6TDEJ.js";
4
4
  import {
5
5
  desc
6
6
  } from "./chunk-3GRPT3EJ.js";
@@ -180,4 +180,4 @@ export {
180
180
  diffQualitySnapshots,
181
181
  formatQualityReport
182
182
  };
183
- //# sourceMappingURL=chunk-EXWSATQS.js.map
183
+ //# sourceMappingURL=chunk-2EKCJ2V3.js.map
@@ -2,8 +2,9 @@ import {
2
2
  recordInjectionValueEvents,
3
3
  recordMemoryInjections,
4
4
  recordOutcomeValueEvent,
5
- resolveMemoryInjectionOutcome
6
- } from "./chunk-B6ZL6O6A.js";
5
+ resolveMemoryInjectionOutcome,
6
+ textMatchScore
7
+ } from "./chunk-WEA6TDEJ.js";
7
8
  import {
8
9
  computeHealthScore,
9
10
  getRepoQualityProfile,
@@ -4933,6 +4934,7 @@ var DEFAULT_CONFIG = {
4933
4934
  };
4934
4935
  var QUERY_RESULT_LIMIT = 2;
4935
4936
  var QUERY_VECTOR_RELEVANCE_FLOOR = 0.7;
4937
+ var QUERY_TEXT_MATCH_FLOOR = 0.45;
4936
4938
  var HISTORY_VECTOR_RELEVANCE_FLOOR = 0.7;
4937
4939
  var HISTORY_LEXICAL_RELEVANCE_FLOOR = 0.01;
4938
4940
  function normalizeQueryForRetrieval(text) {
@@ -5091,6 +5093,19 @@ async function compileContextHybrid(db, req) {
5091
5093
  const retrievalById = new Map(
5092
5094
  retrieval.map((item) => [item.memory.id, item])
5093
5095
  );
5096
+ if (effectiveQuery) {
5097
+ for (const memory of passing) {
5098
+ if (retrievalById.has(memory.id)) continue;
5099
+ const lexical = textMatchScore(effectiveQuery, memory.text);
5100
+ if (lexical.score < QUERY_TEXT_MATCH_FLOOR) continue;
5101
+ retrievalById.set(memory.id, {
5102
+ memory,
5103
+ score: lexical.score,
5104
+ similarity: 0,
5105
+ lexical_score: lexical.score
5106
+ });
5107
+ }
5108
+ }
5094
5109
  const summaries = getMemoryFeedbackSummaries(db, passing.map((m) => m.id));
5095
5110
  const emptySummary = { followed: 0, overridden: 0, contradicted: 0, ignored: 0, resolved: 0 };
5096
5111
  const ranked = passing.filter((memory) => {
@@ -6565,4 +6580,4 @@ export {
6565
6580
  pruneMemories,
6566
6581
  formatPruneReport
6567
6582
  };
6568
- //# sourceMappingURL=chunk-EYUHIYTR.js.map
6583
+ //# sourceMappingURL=chunk-5QN5GGCV.js.map