@melandlabs/memory-store 1.3.0 → 1.3.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.
@@ -745,6 +745,13 @@ interface UnifiedSearchDeps {
745
745
  * audits. Default `false` preserves the current-truth behaviour.
746
746
  */
747
747
  includeDeprecated?: boolean;
748
+ /**
749
+ * Forward `asOf` from `UnifiedMemorySearchInput` so time-travel
750
+ * callers can ask "what was true at this instant?". Implementations
751
+ * that don't yet honour the field should ignore it — the rest of
752
+ * the unified pipeline stays correct.
753
+ */
754
+ asOf?: string;
748
755
  /** Optional peer scope resolved from `UnifiedMemorySearchInput.peerFilter`. */
749
756
  peers?: ReadonlyArray<Peer>;
750
757
  /** Optional `FactType` filter resolved from `UnifiedMemorySearchInput.factTypes`. */
@@ -810,6 +817,13 @@ interface UnifiedSearchDeps {
810
817
  * audits. Default `false` preserves the current-truth behaviour.
811
818
  */
812
819
  includeDeprecated?: boolean;
820
+ /**
821
+ * Forward `asOf` from `UnifiedMemorySearchInput` so time-travel
822
+ * callers can ask "what was true at this instant?". Implementations
823
+ * that don't yet honour the field should ignore it — the rest of
824
+ * the unified pipeline stays correct.
825
+ */
826
+ asOf?: string;
813
827
  /** Optional peer scope resolved from `UnifiedMemorySearchInput.peerFilter`. */
814
828
  peers?: ReadonlyArray<Peer>;
815
829
  /** Optional `FactType` filter resolved from `UnifiedMemorySearchInput.factTypes`. */
package/dist/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { M as MemoryStoreConfig } from './config-CbE2t4SW.js';
1
+ import { M as MemoryStoreConfig } from './config-BuWr-nvt.js';
2
2
  import '@melandlabs/memory-consolidation';
3
3
  import '@melandlabs/contracts/peer';
4
4
  import '@melandlabs/contracts';
package/dist/http.js CHANGED
@@ -922,6 +922,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
922
922
  threshold,
923
923
  botId: "botId" in filter ? filter.botId : void 0,
924
924
  includeDeprecated,
925
+ ...input.asOf ? { asOf: input.asOf } : {},
925
926
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
926
927
  ...factTypes ? { factTypes } : {},
927
928
  ...runtimeContext ?? {}
@@ -970,6 +971,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
970
971
  limit,
971
972
  threshold,
972
973
  includeDeprecated: input.includeDeprecated === true,
974
+ ...input.asOf ? { asOf: input.asOf } : {},
973
975
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
974
976
  ...factTypes ? { factTypes } : {}
975
977
  });
@@ -1037,6 +1039,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1037
1039
  limit: Math.ceil(limit / filters.length),
1038
1040
  botId,
1039
1041
  includeDeprecated,
1042
+ ...input.asOf ? { asOf: input.asOf } : {},
1040
1043
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1041
1044
  ...factTypes ? { factTypes } : {},
1042
1045
  ...runtimeContext ?? {}
@@ -1067,6 +1070,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1067
1070
  limit: Math.ceil(limit / filters.length),
1068
1071
  botId,
1069
1072
  includeDeprecated,
1073
+ ...input.asOf ? { asOf: input.asOf } : {},
1070
1074
  ...factTypes ? { factTypes } : {}
1071
1075
  })
1072
1076
  )
@@ -1219,15 +1223,10 @@ function createUnifiedSearch(deps = {}) {
1219
1223
  unionEvidence = evidence;
1220
1224
  }
1221
1225
  if (typeof deps.embedQuery !== "function") {
1222
- warnings.push({
1223
- source: "memory",
1224
- code: "semantic_unavailable",
1225
- message: "Semantic search is unavailable because no embedding provider is configured."
1226
- });
1227
1226
  warnings.push({
1228
1227
  source: "memory",
1229
1228
  code: "memory_lexical_search_fallback",
1230
- message: "Semantic search not configured, using keyword search as fallback"
1229
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1231
1230
  });
1232
1231
  const keywords2 = deriveLexicalKeywords(input.query);
1233
1232
  const lexical2 = filterByDateRange(
@@ -1332,6 +1331,7 @@ function createUnifiedSearch(deps = {}) {
1332
1331
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1333
1332
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1334
1333
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1334
+ const includeDeprecated = input.includeDeprecated === true;
1335
1335
  lexical = (await Promise.all(
1336
1336
  lexFilters.map(
1337
1337
  (botId) => searchRawMessagesLexical({
@@ -1339,6 +1339,8 @@ function createUnifiedSearch(deps = {}) {
1339
1339
  keywords,
1340
1340
  limit,
1341
1341
  botId,
1342
+ includeDeprecated,
1343
+ ...input.asOf ? { asOf: input.asOf } : {},
1342
1344
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1343
1345
  ...factTypes ? { factTypes } : {},
1344
1346
  ...runtimeContext ?? {}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _melandlabs_memory_consolidation from '@melandlabs/memory-consolidation';
2
2
  import { OwnerScope } from '@melandlabs/memory-consolidation';
3
- import { d as SearchInput, e as SearchOutput, M as MemoryStoreConfig } from './config-CbE2t4SW.js';
4
- export { E as EmbedQueryFn, H as HitChannel, i as HitSignals, I as IterativeRecallCandidate, B as IterativeRecallExecutor, C as IterativeRecallPlanner, D as IterativeRecallPlannerOptions, F as IterativeRecallResult, G as IterativeRecallSearchRequest, J as IterativeRecallSearchResult, K as IterativeRecallStats, L as MemoryStoreDb, a as MemoryStoreEnv, Q as QueryRewriter, N as QueryRewriterInput, O as QueryRewriterOptions, c as SearchEvidence, P as SearchProviderApplicabilityInput, j as SearchSource, S as SearchTier, k as UnifiedMemoryMergeStrategy, l as UnifiedMemoryRankedList, R as UnifiedMemoryReasoningInfo, m as UnifiedMemoryReasoningStrategy, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult, n as UnifiedMemorySearchSource, b as UnifiedMemorySearchWarning, T as UnifiedSearchInsightsResult, V as UnifiedSearchKnowledgeResult, W as UnifiedSearchReasoningDeps, X as VectorBackend, o as clampUnifiedMemorySearchLimit, p as clampUnifiedMemorySearchThreshold, Y as createIdentityIterativePlanner, Z as createIdentityRewriter, _ as createIterativeRecallPlanner, $ as createUserVoiceRewriter, r as isRawMemorySemanticResult, s as listNameToChannel, t as materializeSignals, u as mergeUnifiedMemorySearchResults, v as mergeUnifiedMemorySearchResultsRrf, x as normalizeUnifiedMemoryReasoningStrategy, y as normalizeUnifiedMemorySearchSources, z as toKnowledgeResult, A as toMemoryResult } from './config-CbE2t4SW.js';
5
- import { U as UnifiedSearch, S as SearchRuntimeContext, A as ApplyConsolidateInput, a as ApplyConsolidateOutput } from './unified-search-2YQ6EGuQ.js';
6
- export { b as applyReflectedPlan, c as createUnifiedSearch } from './unified-search-2YQ6EGuQ.js';
3
+ import { d as SearchInput, e as SearchOutput, M as MemoryStoreConfig } from './config-BuWr-nvt.js';
4
+ export { E as EmbedQueryFn, H as HitChannel, i as HitSignals, I as IterativeRecallCandidate, B as IterativeRecallExecutor, C as IterativeRecallPlanner, D as IterativeRecallPlannerOptions, F as IterativeRecallResult, G as IterativeRecallSearchRequest, J as IterativeRecallSearchResult, K as IterativeRecallStats, L as MemoryStoreDb, a as MemoryStoreEnv, Q as QueryRewriter, N as QueryRewriterInput, O as QueryRewriterOptions, c as SearchEvidence, P as SearchProviderApplicabilityInput, j as SearchSource, S as SearchTier, k as UnifiedMemoryMergeStrategy, l as UnifiedMemoryRankedList, R as UnifiedMemoryReasoningInfo, m as UnifiedMemoryReasoningStrategy, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult, n as UnifiedMemorySearchSource, b as UnifiedMemorySearchWarning, T as UnifiedSearchInsightsResult, V as UnifiedSearchKnowledgeResult, W as UnifiedSearchReasoningDeps, X as VectorBackend, o as clampUnifiedMemorySearchLimit, p as clampUnifiedMemorySearchThreshold, Y as createIdentityIterativePlanner, Z as createIdentityRewriter, _ as createIterativeRecallPlanner, $ as createUserVoiceRewriter, r as isRawMemorySemanticResult, s as listNameToChannel, t as materializeSignals, u as mergeUnifiedMemorySearchResults, v as mergeUnifiedMemorySearchResultsRrf, x as normalizeUnifiedMemoryReasoningStrategy, y as normalizeUnifiedMemorySearchSources, z as toKnowledgeResult, A as toMemoryResult } from './config-BuWr-nvt.js';
5
+ import { U as UnifiedSearch, S as SearchRuntimeContext, A as ApplyConsolidateInput, a as ApplyConsolidateOutput } from './unified-search-CtFFRj2O.js';
6
+ export { b as applyReflectedPlan, c as createUnifiedSearch } from './unified-search-CtFFRj2O.js';
7
7
  import { StoreVsaFactInput, StoreVsaFactOutput, VsaRecallInput, VsaRecallOutput, VsaListInput, VsaFactSummary, VsaForgetInput, VsaForgetOutput, VsaFactStorage } from '@melandlabs/contracts';
8
8
  export { DerivedFact, DerivedKind, EntityEdge, EntityKind, StoreVsaFactInput, StoreVsaFactOutput, VsaFact, VsaFactStorage, VsaFactSummary, VsaForgetInput, VsaForgetOutput, VsaListInput, VsaRecallInput, VsaRecallOutput, VsaRecallScore, VsaVocabularyEntry } from '@melandlabs/contracts';
9
9
  import { RawMessageStore, getRawMessageManager } from './storage/raw-message-store.js';
package/dist/index.js CHANGED
@@ -1044,6 +1044,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
1044
1044
  threshold,
1045
1045
  botId: "botId" in filter ? filter.botId : void 0,
1046
1046
  includeDeprecated,
1047
+ ...input.asOf ? { asOf: input.asOf } : {},
1047
1048
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1048
1049
  ...factTypes ? { factTypes } : {},
1049
1050
  ...runtimeContext ?? {}
@@ -1092,6 +1093,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
1092
1093
  limit,
1093
1094
  threshold,
1094
1095
  includeDeprecated: input.includeDeprecated === true,
1096
+ ...input.asOf ? { asOf: input.asOf } : {},
1095
1097
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1096
1098
  ...factTypes ? { factTypes } : {}
1097
1099
  });
@@ -1159,6 +1161,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1159
1161
  limit: Math.ceil(limit / filters.length),
1160
1162
  botId,
1161
1163
  includeDeprecated,
1164
+ ...input.asOf ? { asOf: input.asOf } : {},
1162
1165
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1163
1166
  ...factTypes ? { factTypes } : {},
1164
1167
  ...runtimeContext ?? {}
@@ -1189,6 +1192,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1189
1192
  limit: Math.ceil(limit / filters.length),
1190
1193
  botId,
1191
1194
  includeDeprecated,
1195
+ ...input.asOf ? { asOf: input.asOf } : {},
1192
1196
  ...factTypes ? { factTypes } : {}
1193
1197
  })
1194
1198
  )
@@ -1341,15 +1345,10 @@ function createUnifiedSearch(deps = {}) {
1341
1345
  unionEvidence = evidence;
1342
1346
  }
1343
1347
  if (typeof deps.embedQuery !== "function") {
1344
- warnings.push({
1345
- source: "memory",
1346
- code: "semantic_unavailable",
1347
- message: "Semantic search is unavailable because no embedding provider is configured."
1348
- });
1349
1348
  warnings.push({
1350
1349
  source: "memory",
1351
1350
  code: "memory_lexical_search_fallback",
1352
- message: "Semantic search not configured, using keyword search as fallback"
1351
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1353
1352
  });
1354
1353
  const keywords2 = deriveLexicalKeywords(input.query);
1355
1354
  const lexical2 = filterByDateRange(
@@ -1454,6 +1453,7 @@ function createUnifiedSearch(deps = {}) {
1454
1453
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1455
1454
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1456
1455
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1456
+ const includeDeprecated = input.includeDeprecated === true;
1457
1457
  lexical = (await Promise.all(
1458
1458
  lexFilters.map(
1459
1459
  (botId) => searchRawMessagesLexical({
@@ -1461,6 +1461,8 @@ function createUnifiedSearch(deps = {}) {
1461
1461
  keywords,
1462
1462
  limit,
1463
1463
  botId,
1464
+ includeDeprecated,
1465
+ ...input.asOf ? { asOf: input.asOf } : {},
1464
1466
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1465
1467
  ...factTypes ? { factTypes } : {},
1466
1468
  ...runtimeContext ?? {}
package/dist/mcp.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { M as MemoryStoreConfig } from './config-CbE2t4SW.js';
2
+ import { M as MemoryStoreConfig } from './config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
package/dist/mcp.js CHANGED
@@ -923,6 +923,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
923
923
  threshold,
924
924
  botId: "botId" in filter ? filter.botId : void 0,
925
925
  includeDeprecated,
926
+ ...input.asOf ? { asOf: input.asOf } : {},
926
927
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
927
928
  ...factTypes ? { factTypes } : {},
928
929
  ...runtimeContext ?? {}
@@ -971,6 +972,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
971
972
  limit,
972
973
  threshold,
973
974
  includeDeprecated: input.includeDeprecated === true,
975
+ ...input.asOf ? { asOf: input.asOf } : {},
974
976
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
975
977
  ...factTypes ? { factTypes } : {}
976
978
  });
@@ -1038,6 +1040,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1038
1040
  limit: Math.ceil(limit / filters.length),
1039
1041
  botId,
1040
1042
  includeDeprecated,
1043
+ ...input.asOf ? { asOf: input.asOf } : {},
1041
1044
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1042
1045
  ...factTypes ? { factTypes } : {},
1043
1046
  ...runtimeContext ?? {}
@@ -1068,6 +1071,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1068
1071
  limit: Math.ceil(limit / filters.length),
1069
1072
  botId,
1070
1073
  includeDeprecated,
1074
+ ...input.asOf ? { asOf: input.asOf } : {},
1071
1075
  ...factTypes ? { factTypes } : {}
1072
1076
  })
1073
1077
  )
@@ -1220,15 +1224,10 @@ function createUnifiedSearch(deps = {}) {
1220
1224
  unionEvidence = evidence;
1221
1225
  }
1222
1226
  if (typeof deps.embedQuery !== "function") {
1223
- warnings.push({
1224
- source: "memory",
1225
- code: "semantic_unavailable",
1226
- message: "Semantic search is unavailable because no embedding provider is configured."
1227
- });
1228
1227
  warnings.push({
1229
1228
  source: "memory",
1230
1229
  code: "memory_lexical_search_fallback",
1231
- message: "Semantic search not configured, using keyword search as fallback"
1230
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1232
1231
  });
1233
1232
  const keywords2 = deriveLexicalKeywords(input.query);
1234
1233
  const lexical2 = filterByDateRange(
@@ -1333,6 +1332,7 @@ function createUnifiedSearch(deps = {}) {
1333
1332
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1334
1333
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1335
1334
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1335
+ const includeDeprecated = input.includeDeprecated === true;
1336
1336
  lexical = (await Promise.all(
1337
1337
  lexFilters.map(
1338
1338
  (botId) => searchRawMessagesLexical({
@@ -1340,6 +1340,8 @@ function createUnifiedSearch(deps = {}) {
1340
1340
  keywords,
1341
1341
  limit,
1342
1342
  botId,
1343
+ includeDeprecated,
1344
+ ...input.asOf ? { asOf: input.asOf } : {},
1343
1345
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1344
1346
  ...factTypes ? { factTypes } : {},
1345
1347
  ...runtimeContext ?? {}
@@ -1,7 +1,7 @@
1
1
  import { DerivedFact } from '@melandlabs/contracts/derived-fact';
2
2
  import { FactType } from '@melandlabs/contracts/fact-type';
3
3
  import { Peer } from '@melandlabs/contracts/peer';
4
- import { U as UnifiedSearchDeps } from '../config-CbE2t4SW.js';
4
+ import { U as UnifiedSearchDeps } from '../config-BuWr-nvt.js';
5
5
  import '@melandlabs/memory-consolidation';
6
6
  import '@melandlabs/contracts';
7
7
  import '@melandlabs/contracts/entity-edge';
@@ -1,5 +1,5 @@
1
1
  import { EntityEdge } from '@melandlabs/contracts/entity-edge';
2
- import { U as UnifiedSearchDeps } from '../config-CbE2t4SW.js';
2
+ import { U as UnifiedSearchDeps } from '../config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -1,5 +1,5 @@
1
- export { H as HitChannel, i as HitSignals, c as SearchEvidence, d as SearchInput, e as SearchOutput, j as SearchSource, S as SearchTier, k as UnifiedMemoryMergeStrategy, l as UnifiedMemoryRankedList, m as UnifiedMemoryReasoningStrategy, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult, n as UnifiedMemorySearchSource, b as UnifiedMemorySearchWarning, o as clampUnifiedMemorySearchLimit, p as clampUnifiedMemorySearchThreshold, q as deriveLexicalKeywords, r as isRawMemorySemanticResult, s as listNameToChannel, t as materializeSignals, u as mergeUnifiedMemorySearchResults, v as mergeUnifiedMemorySearchResultsRrf, w as normalizeUnifiedMemoryMergeStrategy, x as normalizeUnifiedMemoryReasoningStrategy, y as normalizeUnifiedMemorySearchSources, z as toKnowledgeResult, A as toMemoryResult } from '../config-CbE2t4SW.js';
2
- export { S as SearchRuntimeContext, U as UnifiedSearch, c as createUnifiedSearch } from '../unified-search-2YQ6EGuQ.js';
1
+ export { H as HitChannel, i as HitSignals, c as SearchEvidence, d as SearchInput, e as SearchOutput, j as SearchSource, S as SearchTier, k as UnifiedMemoryMergeStrategy, l as UnifiedMemoryRankedList, m as UnifiedMemoryReasoningStrategy, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult, n as UnifiedMemorySearchSource, b as UnifiedMemorySearchWarning, o as clampUnifiedMemorySearchLimit, p as clampUnifiedMemorySearchThreshold, q as deriveLexicalKeywords, r as isRawMemorySemanticResult, s as listNameToChannel, t as materializeSignals, u as mergeUnifiedMemorySearchResults, v as mergeUnifiedMemorySearchResultsRrf, w as normalizeUnifiedMemoryMergeStrategy, x as normalizeUnifiedMemoryReasoningStrategy, y as normalizeUnifiedMemorySearchSources, z as toKnowledgeResult, A as toMemoryResult } from '../config-BuWr-nvt.js';
2
+ export { S as SearchRuntimeContext, U as UnifiedSearch, c as createUnifiedSearch } from '../unified-search-CtFFRj2O.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -1033,6 +1033,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
1033
1033
  threshold,
1034
1034
  botId: "botId" in filter ? filter.botId : void 0,
1035
1035
  includeDeprecated,
1036
+ ...input.asOf ? { asOf: input.asOf } : {},
1036
1037
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1037
1038
  ...factTypes ? { factTypes } : {},
1038
1039
  ...runtimeContext ?? {}
@@ -1081,6 +1082,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
1081
1082
  limit,
1082
1083
  threshold,
1083
1084
  includeDeprecated: input.includeDeprecated === true,
1085
+ ...input.asOf ? { asOf: input.asOf } : {},
1084
1086
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1085
1087
  ...factTypes ? { factTypes } : {}
1086
1088
  });
@@ -1148,6 +1150,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1148
1150
  limit: Math.ceil(limit / filters.length),
1149
1151
  botId,
1150
1152
  includeDeprecated,
1153
+ ...input.asOf ? { asOf: input.asOf } : {},
1151
1154
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1152
1155
  ...factTypes ? { factTypes } : {},
1153
1156
  ...runtimeContext ?? {}
@@ -1178,6 +1181,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1178
1181
  limit: Math.ceil(limit / filters.length),
1179
1182
  botId,
1180
1183
  includeDeprecated,
1184
+ ...input.asOf ? { asOf: input.asOf } : {},
1181
1185
  ...factTypes ? { factTypes } : {}
1182
1186
  })
1183
1187
  )
@@ -1330,15 +1334,10 @@ function createUnifiedSearch(deps = {}) {
1330
1334
  unionEvidence = evidence;
1331
1335
  }
1332
1336
  if (typeof deps.embedQuery !== "function") {
1333
- warnings.push({
1334
- source: "memory",
1335
- code: "semantic_unavailable",
1336
- message: "Semantic search is unavailable because no embedding provider is configured."
1337
- });
1338
1337
  warnings.push({
1339
1338
  source: "memory",
1340
1339
  code: "memory_lexical_search_fallback",
1341
- message: "Semantic search not configured, using keyword search as fallback"
1340
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1342
1341
  });
1343
1342
  const keywords2 = deriveLexicalKeywords(input.query);
1344
1343
  const lexical2 = filterByDateRange(
@@ -1443,6 +1442,7 @@ function createUnifiedSearch(deps = {}) {
1443
1442
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1444
1443
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1445
1444
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1445
+ const includeDeprecated = input.includeDeprecated === true;
1446
1446
  lexical = (await Promise.all(
1447
1447
  lexFilters.map(
1448
1448
  (botId) => searchRawMessagesLexical({
@@ -1450,6 +1450,8 @@ function createUnifiedSearch(deps = {}) {
1450
1450
  keywords,
1451
1451
  limit,
1452
1452
  botId,
1453
+ includeDeprecated,
1454
+ ...input.asOf ? { asOf: input.asOf } : {},
1453
1455
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1454
1456
  ...factTypes ? { factTypes } : {},
1455
1457
  ...runtimeContext ?? {}
@@ -924,6 +924,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
924
924
  threshold,
925
925
  botId: "botId" in filter ? filter.botId : void 0,
926
926
  includeDeprecated,
927
+ ...input.asOf ? { asOf: input.asOf } : {},
927
928
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
928
929
  ...factTypes ? { factTypes } : {},
929
930
  ...runtimeContext ?? {}
@@ -972,6 +973,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
972
973
  limit,
973
974
  threshold,
974
975
  includeDeprecated: input.includeDeprecated === true,
976
+ ...input.asOf ? { asOf: input.asOf } : {},
975
977
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
976
978
  ...factTypes ? { factTypes } : {}
977
979
  });
@@ -1039,6 +1041,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1039
1041
  limit: Math.ceil(limit / filters.length),
1040
1042
  botId,
1041
1043
  includeDeprecated,
1044
+ ...input.asOf ? { asOf: input.asOf } : {},
1042
1045
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1043
1046
  ...factTypes ? { factTypes } : {},
1044
1047
  ...runtimeContext ?? {}
@@ -1069,6 +1072,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1069
1072
  limit: Math.ceil(limit / filters.length),
1070
1073
  botId,
1071
1074
  includeDeprecated,
1075
+ ...input.asOf ? { asOf: input.asOf } : {},
1072
1076
  ...factTypes ? { factTypes } : {}
1073
1077
  })
1074
1078
  )
@@ -1221,15 +1225,10 @@ function createUnifiedSearch(deps = {}) {
1221
1225
  unionEvidence = evidence;
1222
1226
  }
1223
1227
  if (typeof deps.embedQuery !== "function") {
1224
- warnings.push({
1225
- source: "memory",
1226
- code: "semantic_unavailable",
1227
- message: "Semantic search is unavailable because no embedding provider is configured."
1228
- });
1229
1228
  warnings.push({
1230
1229
  source: "memory",
1231
1230
  code: "memory_lexical_search_fallback",
1232
- message: "Semantic search not configured, using keyword search as fallback"
1231
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1233
1232
  });
1234
1233
  const keywords2 = deriveLexicalKeywords(input.query);
1235
1234
  const lexical2 = filterByDateRange(
@@ -1334,6 +1333,7 @@ function createUnifiedSearch(deps = {}) {
1334
1333
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1335
1334
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1336
1335
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1336
+ const includeDeprecated = input.includeDeprecated === true;
1337
1337
  lexical = (await Promise.all(
1338
1338
  lexFilters.map(
1339
1339
  (botId) => searchRawMessagesLexical({
@@ -1341,6 +1341,8 @@ function createUnifiedSearch(deps = {}) {
1341
1341
  keywords,
1342
1342
  limit,
1343
1343
  botId,
1344
+ includeDeprecated,
1345
+ ...input.asOf ? { asOf: input.asOf } : {},
1344
1346
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1345
1347
  ...factTypes ? { factTypes } : {},
1346
1348
  ...runtimeContext ?? {}
@@ -925,6 +925,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
925
925
  threshold,
926
926
  botId: "botId" in filter ? filter.botId : void 0,
927
927
  includeDeprecated,
928
+ ...input.asOf ? { asOf: input.asOf } : {},
928
929
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
929
930
  ...factTypes ? { factTypes } : {},
930
931
  ...runtimeContext ?? {}
@@ -973,6 +974,7 @@ async function runSemanticSearchForEmbedding(deps, input, queryEmbedding, limit,
973
974
  limit,
974
975
  threshold,
975
976
  includeDeprecated: input.includeDeprecated === true,
977
+ ...input.asOf ? { asOf: input.asOf } : {},
976
978
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
977
979
  ...factTypes ? { factTypes } : {}
978
980
  });
@@ -1040,6 +1042,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1040
1042
  limit: Math.ceil(limit / filters.length),
1041
1043
  botId,
1042
1044
  includeDeprecated,
1045
+ ...input.asOf ? { asOf: input.asOf } : {},
1043
1046
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1044
1047
  ...factTypes ? { factTypes } : {},
1045
1048
  ...runtimeContext ?? {}
@@ -1070,6 +1073,7 @@ async function runLexicalSearchForKeywords(deps, input, keywords, limit, logger,
1070
1073
  limit: Math.ceil(limit / filters.length),
1071
1074
  botId,
1072
1075
  includeDeprecated,
1076
+ ...input.asOf ? { asOf: input.asOf } : {},
1073
1077
  ...factTypes ? { factTypes } : {}
1074
1078
  })
1075
1079
  )
@@ -1222,15 +1226,10 @@ function createUnifiedSearch(deps = {}) {
1222
1226
  unionEvidence = evidence;
1223
1227
  }
1224
1228
  if (typeof deps.embedQuery !== "function") {
1225
- warnings.push({
1226
- source: "memory",
1227
- code: "semantic_unavailable",
1228
- message: "Semantic search is unavailable because no embedding provider is configured."
1229
- });
1230
1229
  warnings.push({
1231
1230
  source: "memory",
1232
1231
  code: "memory_lexical_search_fallback",
1233
- message: "Semantic search not configured, using keyword search as fallback"
1232
+ message: "No embedding provider is configured; using lexical (BM25) search as fallback. Pass an `embedQuery` function via `unified.embedQuery` to enable semantic retrieval."
1234
1233
  });
1235
1234
  const keywords2 = deriveLexicalKeywords(input.query);
1236
1235
  const lexical2 = filterByDateRange(
@@ -1335,6 +1334,7 @@ function createUnifiedSearch(deps = {}) {
1335
1334
  const lexFilters = input.botIds && input.botIds.length > 0 ? input.botIds : [void 0];
1336
1335
  const searchRawMessagesLexical = deps.searchRawMessagesLexical;
1337
1336
  const factTypes = input.factTypes?.length ? input.factTypes : void 0;
1337
+ const includeDeprecated = input.includeDeprecated === true;
1338
1338
  lexical = (await Promise.all(
1339
1339
  lexFilters.map(
1340
1340
  (botId) => searchRawMessagesLexical({
@@ -1342,6 +1342,8 @@ function createUnifiedSearch(deps = {}) {
1342
1342
  keywords,
1343
1343
  limit,
1344
1344
  botId,
1345
+ includeDeprecated,
1346
+ ...input.asOf ? { asOf: input.asOf } : {},
1345
1347
  ...peerPeers.length > 0 ? { peers: peerPeers } : {},
1346
1348
  ...factTypes ? { factTypes } : {},
1347
1349
  ...runtimeContext ?? {}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { U as UnifiedSearchDeps } from '../config-CbE2t4SW.js';
2
+ import { U as UnifiedSearchDeps } from '../config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -1,4 +1,4 @@
1
- import { a as MemoryStoreEnv } from '../config-CbE2t4SW.js';
1
+ import { a as MemoryStoreEnv } from '../config-BuWr-nvt.js';
2
2
  import '@melandlabs/memory-consolidation';
3
3
  import '@melandlabs/contracts/peer';
4
4
  import '@melandlabs/contracts';
@@ -1,5 +1,5 @@
1
1
  import { RawMessageStorageManager, RawMessageSearchChunk, RawMessageSearchIndexStats } from '@melandlabs/indexeddb';
2
- import { a as MemoryStoreEnv, M as MemoryStoreConfig } from '../config-CbE2t4SW.js';
2
+ import { a as MemoryStoreEnv, M as MemoryStoreConfig } from '../config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -1,5 +1,5 @@
1
1
  import { SQLiteRawMessageManager } from '@melandlabs/sqlite';
2
- import { a as MemoryStoreEnv } from '../config-CbE2t4SW.js';
2
+ import { a as MemoryStoreEnv } from '../config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -55,6 +55,12 @@ declare function lexicalSearchRawMessages(input: {
55
55
  * audits. Default `false` preserves the current-truth behaviour.
56
56
  */
57
57
  includeDeprecated?: boolean;
58
+ /**
59
+ * Forward `asOf` from `UnifiedMemorySearchInput` so time-travel
60
+ * callers can ask "what was true at this instant?". Ignored by hosts
61
+ * that don't yet honour the field.
62
+ */
63
+ asOf?: string;
58
64
  platform?: string;
59
65
  botId?: string;
60
66
  factTypes?: Array<"world" | "experience" | "mental_model">;
@@ -1,5 +1,5 @@
1
1
  import { VectorSearchResult } from '@melandlabs/rag/vector-service';
2
- import { a as MemoryStoreEnv } from '../config-CbE2t4SW.js';
2
+ import { a as MemoryStoreEnv } from '../config-BuWr-nvt.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
@@ -1,4 +1,4 @@
1
- import { S as SearchTier, b as UnifiedMemorySearchWarning, c as SearchEvidence, U as UnifiedSearchDeps, d as SearchInput, e as SearchOutput, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult } from './config-CbE2t4SW.js';
1
+ import { S as SearchTier, b as UnifiedMemorySearchWarning, c as SearchEvidence, U as UnifiedSearchDeps, d as SearchInput, e as SearchOutput, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult } from './config-BuWr-nvt.js';
2
2
  import { MemoryApplicabilityContext, OwnerScope, MemoryConsolidationPlan, ReflectApplyClusterKeyFn, MemoryStorageAdapterLike, MemoryGraphStoreWithOperationHistory, MemoryGraphUpdateResult } from '@melandlabs/memory-consolidation';
3
3
  import { MemoryStorageAdapter } from '@melandlabs/ai/memory';
4
4
  import { Peer } from '@melandlabs/contracts/peer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melandlabs/memory-store",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -64,19 +64,19 @@
64
64
  "@modelcontextprotocol/sdk": "^1.25.3",
65
65
  "hono": "^4.6.14",
66
66
  "zod": "^4.3.6",
67
- "@melandlabs/contracts": "0.7.0",
68
- "@melandlabs/ai": "0.10.4",
69
- "@melandlabs/okf": "0.3.2",
70
- "@melandlabs/memory-consolidation": "0.5.3",
71
- "@melandlabs/rag": "0.3.1",
72
- "@melandlabs/shared": "0.4.1",
67
+ "@melandlabs/ai": "0.10.6",
68
+ "@melandlabs/contracts": "0.8.0",
73
69
  "@melandlabs/env-config": "0.4.0",
74
- "@melandlabs/sqlite": "0.5.3",
70
+ "@melandlabs/memory-consolidation": "0.5.3",
71
+ "@melandlabs/okf": "0.3.4",
72
+ "@melandlabs/rag": "0.3.3",
73
+ "@melandlabs/shared": "0.4.2",
74
+ "@melandlabs/sqlite": "0.5.4",
75
75
  "@melandlabs/vsa": "0.3.0"
76
76
  },
77
77
  "peerDependencies": {
78
- "@melandlabs/ai-rag": "0.2.10",
79
- "@melandlabs/indexeddb": "0.5.9"
78
+ "@melandlabs/ai-rag": "0.2.12",
79
+ "@melandlabs/indexeddb": "0.5.10"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "@melandlabs/ai-rag": {
@@ -89,8 +89,8 @@
89
89
  "devDependencies": {
90
90
  "@types/node": "^22.13.10",
91
91
  "typescript": "^5.6.3",
92
- "@melandlabs/config": "0.3.0",
93
- "@melandlabs/ai-rag": "0.2.10"
92
+ "@melandlabs/ai-rag": "0.2.12",
93
+ "@melandlabs/config": "0.3.0"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "tsup",