@edihasaj/recall 0.9.1 → 0.9.2

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.
Files changed (42) hide show
  1. package/dist/{chunk-3PPYB7BX.js → chunk-57OKXD4B.js} +6 -6
  2. package/dist/{chunk-EZUMD27V.js → chunk-CYQPEGXG.js} +42 -17
  3. package/dist/{chunk-EZUMD27V.js.map → chunk-CYQPEGXG.js.map} +1 -1
  4. package/dist/{chunk-A27AP4NR.js → chunk-HGZOF7YH.js} +16 -7
  5. package/dist/chunk-HGZOF7YH.js.map +1 -0
  6. package/dist/{chunk-G6YAXFT4.js → chunk-IBNDQXUB.js} +46 -7
  7. package/dist/chunk-IBNDQXUB.js.map +1 -0
  8. package/dist/{chunk-YDSCPOIJ.js → chunk-K5PIUKRM.js} +2 -2
  9. package/dist/{chunk-GE5BPNHC.js → chunk-OGZO2WKA.js} +6 -6
  10. package/dist/{chunk-4W4J7Z24.js → chunk-PLOL3UCO.js} +3 -3
  11. package/dist/{chunk-DWA2IO5N.js → chunk-QLAFLCY4.js} +10 -3
  12. package/dist/chunk-QLAFLCY4.js.map +1 -0
  13. package/dist/{chunk-FNQABJTM.js → chunk-UPSMHCTY.js} +2 -2
  14. package/dist/{cleanup-MBXKIGT6.js → cleanup-62AZROOV.js} +4 -4
  15. package/dist/cli.js +17 -17
  16. package/dist/daemon.js +9 -9
  17. package/dist/{dispatcher-YN6545TF.js → dispatcher-GJNTZX2I.js} +4 -4
  18. package/dist/{ingest-7FAOX7YV.js → ingest-BLMXKKGP.js} +2 -2
  19. package/dist/mcp.js +7 -7
  20. package/dist/{memory-value-ZLVZTE5M.js → memory-value-B3AQW4IE.js} +4 -4
  21. package/dist/{quality-UUEBGSAQ.js → quality-MIDMOC3L.js} +5 -5
  22. package/dist/{retrieval-YU2PLBUS.js → retrieval-FHCKFVXX.js} +3 -3
  23. package/dist/{tasks-AEKGKZZF.js → tasks-6CDIKOIR.js} +4 -4
  24. package/dist/webui/assets/{index-DAoAhOb4.js → index-2DR_ysOm.js} +391 -267
  25. package/dist/webui/assets/{index-DAoAhOb4.js.map → index-2DR_ysOm.js.map} +1 -1
  26. package/dist/webui/index.html +1 -1
  27. package/package.json +1 -1
  28. package/dist/chunk-A27AP4NR.js.map +0 -1
  29. package/dist/chunk-DWA2IO5N.js.map +0 -1
  30. package/dist/chunk-G6YAXFT4.js.map +0 -1
  31. /package/dist/{chunk-3PPYB7BX.js.map → chunk-57OKXD4B.js.map} +0 -0
  32. /package/dist/{chunk-YDSCPOIJ.js.map → chunk-K5PIUKRM.js.map} +0 -0
  33. /package/dist/{chunk-GE5BPNHC.js.map → chunk-OGZO2WKA.js.map} +0 -0
  34. /package/dist/{chunk-4W4J7Z24.js.map → chunk-PLOL3UCO.js.map} +0 -0
  35. /package/dist/{chunk-FNQABJTM.js.map → chunk-UPSMHCTY.js.map} +0 -0
  36. /package/dist/{cleanup-MBXKIGT6.js.map → cleanup-62AZROOV.js.map} +0 -0
  37. /package/dist/{dispatcher-YN6545TF.js.map → dispatcher-GJNTZX2I.js.map} +0 -0
  38. /package/dist/{ingest-7FAOX7YV.js.map → ingest-BLMXKKGP.js.map} +0 -0
  39. /package/dist/{memory-value-ZLVZTE5M.js.map → memory-value-B3AQW4IE.js.map} +0 -0
  40. /package/dist/{quality-UUEBGSAQ.js.map → quality-MIDMOC3L.js.map} +0 -0
  41. /package/dist/{retrieval-YU2PLBUS.js.map → retrieval-FHCKFVXX.js.map} +0 -0
  42. /package/dist/{tasks-AEKGKZZF.js.map → tasks-6CDIKOIR.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  graphQuery
3
- } from "./chunk-YDSCPOIJ.js";
3
+ } from "./chunk-K5PIUKRM.js";
4
4
  import {
5
5
  captureCorrectionFallback,
6
6
  compileContext,
@@ -26,7 +26,7 @@ import {
26
26
  scanAndStore,
27
27
  sessionEndFallback,
28
28
  signalOutcomeFallback
29
- } from "./chunk-EZUMD27V.js";
29
+ } from "./chunk-CYQPEGXG.js";
30
30
  import {
31
31
  DEFAULT_LEASE_SECONDS,
32
32
  TaskClaimConflictError,
@@ -47,17 +47,17 @@ import {
47
47
  releaseTask,
48
48
  rollbackMemory,
49
49
  submitTask
50
- } from "./chunk-G6YAXFT4.js";
50
+ } from "./chunk-IBNDQXUB.js";
51
51
  import {
52
52
  recordCompletionUseValueEventsSemantic
53
- } from "./chunk-4W4J7Z24.js";
53
+ } from "./chunk-PLOL3UCO.js";
54
54
  import {
55
55
  confirmMemory,
56
56
  demoteGlobalMemory,
57
57
  getMemory,
58
58
  queryMemories,
59
59
  rejectMemory
60
- } from "./chunk-A27AP4NR.js";
60
+ } from "./chunk-HGZOF7YH.js";
61
61
  import {
62
62
  loadEmbeddingConfigFromEnv,
63
63
  tagActivitySource
@@ -1197,4 +1197,4 @@ function createRecallMcpServer(db = initDb()) {
1197
1197
  export {
1198
1198
  createRecallMcpServer
1199
1199
  };
1200
- //# sourceMappingURL=chunk-3PPYB7BX.js.map
1200
+ //# sourceMappingURL=chunk-57OKXD4B.js.map
@@ -6,16 +6,16 @@ import {
6
6
  recordAudit,
7
7
  redactSensitiveValue,
8
8
  seedScannedConfidence
9
- } from "./chunk-G6YAXFT4.js";
9
+ } from "./chunk-IBNDQXUB.js";
10
10
  import {
11
11
  recordInjectionValueEvents,
12
12
  recordMemoryInjections,
13
13
  recordOutcomeValueEvent,
14
14
  resolveMemoryInjectionOutcome
15
- } from "./chunk-4W4J7Z24.js";
15
+ } from "./chunk-PLOL3UCO.js";
16
16
  import {
17
17
  textMatchScore
18
- } from "./chunk-DWA2IO5N.js";
18
+ } from "./chunk-QLAFLCY4.js";
19
19
  import {
20
20
  asc,
21
21
  desc
@@ -34,7 +34,7 @@ import {
34
34
  recordFeedback,
35
35
  rejectMemory,
36
36
  statusFromConfidence
37
- } from "./chunk-A27AP4NR.js";
37
+ } from "./chunk-HGZOF7YH.js";
38
38
  import {
39
39
  CONFIDENCE,
40
40
  RetrievalEvalCase,
@@ -4864,6 +4864,7 @@ var QUERY_VECTOR_RELEVANCE_FLOOR = 0.7;
4864
4864
  var QUERY_TEXT_MATCH_FLOOR = 0.45;
4865
4865
  var HISTORY_VECTOR_RELEVANCE_FLOOR = 0.7;
4866
4866
  var HISTORY_LEXICAL_RELEVANCE_FLOOR = 0.01;
4867
+ var CONFIDENCE_EPSILON = 1e-9;
4867
4868
  function normalizeQueryForRetrieval(text) {
4868
4869
  if (!text) return "";
4869
4870
  let out = text;
@@ -4895,10 +4896,10 @@ function compileContext(db, req) {
4895
4896
  const allActive = dedupeById([...repoActive, ...globalActive]);
4896
4897
  const scoped = req.path ? allActive.filter((m) => pathMatches(m, req.path)) : allActive;
4897
4898
  const passing = scoped.filter(
4898
- (m) => m.confidence >= config.confidence_threshold
4899
+ (m) => m.confidence + CONFIDENCE_EPSILON >= config.confidence_threshold
4899
4900
  );
4900
4901
  const dropped = scoped.filter(
4901
- (m) => m.confidence < config.confidence_threshold
4902
+ (m) => m.confidence + CONFIDENCE_EPSILON < config.confidence_threshold
4902
4903
  );
4903
4904
  if (passing.length === 0 && selectedHistory.length === 0) {
4904
4905
  return {
@@ -4996,7 +4997,7 @@ async function compileContextHybrid(db, req) {
4996
4997
  const candidateConfidenceFloor = Math.min(config.confidence_threshold, 0.45);
4997
4998
  const passing = scoped.filter((memory) => {
4998
4999
  if (memory.status === "active") {
4999
- return memory.confidence >= config.confidence_threshold;
5000
+ return memory.confidence + CONFIDENCE_EPSILON >= config.confidence_threshold;
5000
5001
  }
5001
5002
  if (memory.status === "candidate" && config.include_candidates) {
5002
5003
  return memory.confidence >= candidateConfidenceFloor;
@@ -5022,15 +5023,22 @@ async function compileContextHybrid(db, req) {
5022
5023
  );
5023
5024
  if (effectiveQuery) {
5024
5025
  for (const memory of passing) {
5025
- if (retrievalById.has(memory.id)) continue;
5026
5026
  const lexical = textMatchScore(effectiveQuery, memory.text);
5027
5027
  if (lexical.score < QUERY_TEXT_MATCH_FLOOR) continue;
5028
- retrievalById.set(memory.id, {
5029
- memory,
5030
- score: lexical.score,
5031
- similarity: 0,
5032
- lexical_score: lexical.score
5033
- });
5028
+ const existing = retrievalById.get(memory.id);
5029
+ retrievalById.set(
5030
+ memory.id,
5031
+ existing ? {
5032
+ ...existing,
5033
+ score: Math.max(existing.score, lexical.score),
5034
+ lexical_score: Math.max(existing.lexical_score, lexical.score)
5035
+ } : {
5036
+ memory,
5037
+ score: lexical.score,
5038
+ similarity: 0,
5039
+ lexical_score: lexical.score
5040
+ }
5041
+ );
5034
5042
  }
5035
5043
  }
5036
5044
  const summaries = getMemoryFeedbackSummaries(db, passing.map((m) => m.id));
@@ -5767,16 +5775,29 @@ async function runRetrievalEval(db, input, options = {}) {
5767
5775
  }
5768
5776
  async function runValueRetrievalEval(db, options = {}) {
5769
5777
  const since = options.sinceIso ?? new Date(Date.now() - 14 * 864e5).toISOString();
5778
+ const caseLimit = options.limit ?? 50;
5770
5779
  const conditions = [
5771
5780
  gte(memoryValueEvents.created_at, since),
5772
- inArray(memoryValueEvents.event_type, ["retrieval_miss", "used"])
5781
+ inArray(memoryValueEvents.event_type, ["retrieval_miss", "used"]),
5782
+ eq(memories.auto_inject, true),
5783
+ or(
5784
+ and(
5785
+ eq(memoryValueEvents.event_type, "retrieval_miss"),
5786
+ inArray(memories.status, ["active", "candidate"])
5787
+ ),
5788
+ and(
5789
+ eq(memoryValueEvents.event_type, "used"),
5790
+ eq(memories.status, "active")
5791
+ )
5792
+ )
5773
5793
  ];
5774
5794
  if (options.repo) conditions.push(eq(memoryValueEvents.repo, options.repo));
5775
- const rows = db.select().from(memoryValueEvents).where(and(...conditions)).orderBy(desc(memoryValueEvents.created_at)).limit(options.limit ?? 50).all();
5795
+ const rows = db.select({ ...getTableColumns(memoryValueEvents) }).from(memoryValueEvents).innerJoin(memories, eq(memoryValueEvents.memory_id, memories.id)).where(and(...conditions)).orderBy(desc(memoryValueEvents.created_at)).limit(Math.max(caseLimit * 10, 500)).all();
5776
5796
  let skippedEvents = 0;
5777
5797
  const sourceEvents = { retrieval_miss: 0, used: 0 };
5778
5798
  const cases = [];
5779
5799
  for (const row of rows) {
5800
+ if (cases.length >= caseLimit) break;
5780
5801
  if (row.event_type === "retrieval_miss") sourceEvents.retrieval_miss += 1;
5781
5802
  if (row.event_type === "used") sourceEvents.used += 1;
5782
5803
  const memory = row.memory_id ? getMemory(db, row.memory_id) : null;
@@ -5796,6 +5817,10 @@ async function runValueRetrievalEval(db, options = {}) {
5796
5817
  skippedEvents += 1;
5797
5818
  continue;
5798
5819
  }
5820
+ if (row.event_type === "used" && textMatchScore(queryText, memory.text).score < 0.45 && !(typeof evidence.semantic_similarity === "number" && evidence.semantic_similarity >= 0.78)) {
5821
+ skippedEvents += 1;
5822
+ continue;
5823
+ }
5799
5824
  const repo = memory.repo ?? row.repo;
5800
5825
  if (!repo) {
5801
5826
  skippedEvents += 1;
@@ -6497,4 +6522,4 @@ export {
6497
6522
  pruneMemories,
6498
6523
  formatPruneReport
6499
6524
  };
6500
- //# sourceMappingURL=chunk-EZUMD27V.js.map
6525
+ //# sourceMappingURL=chunk-CYQPEGXG.js.map