@anuma/sdk 3.4.0 → 3.6.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.
@@ -3357,11 +3357,20 @@ async function getModel() {
3357
3357
  function sigmoid(x) {
3358
3358
  return 1 / (1 + Math.exp(-x));
3359
3359
  }
3360
+ function formatRerankDoc(content, dateMs) {
3361
+ if (dateMs === null || dateMs === void 0 || !Number.isFinite(dateMs)) return content;
3362
+ const d = new Date(dateMs);
3363
+ if (!Number.isFinite(d.getTime())) return content;
3364
+ const yyyy = d.getFullYear();
3365
+ const mm = String(d.getMonth() + 1).padStart(2, "0");
3366
+ const dd = String(d.getDate()).padStart(2, "0");
3367
+ return `[Date: ${yyyy}-${mm}-${dd}] ${content}`;
3368
+ }
3360
3369
  async function rerankPairs(query, items) {
3361
3370
  if (items.length === 0 || !query) return [];
3362
3371
  const { tokenizer, model } = await getModel();
3363
3372
  const queries = items.map(() => query);
3364
- const docs = items.map((i) => i.content);
3373
+ const docs = items.map((i) => formatRerankDoc(i.content, i.dateMs));
3365
3374
  const tokenize2 = tokenizer;
3366
3375
  const inputs = tokenize2(queries, { text_pair: docs, padding: true, truncation: true });
3367
3376
  const forward = model;
@@ -3710,6 +3719,23 @@ function createVaultEmbeddingCache(maxSize = DEFAULT_VAULT_CACHE_SIZE) {
3710
3719
  function normalizeEventTimeKind(kind) {
3711
3720
  return kind === "point" || kind === "range" || kind === "ongoing" ? kind : null;
3712
3721
  }
3722
+ function rerankDateMs(item) {
3723
+ if (item.eventTimeStart !== null && item.eventTimeStart !== void 0 && Number.isFinite(item.eventTimeStart) && item.eventTimeStart > 0) {
3724
+ return item.eventTimeStart;
3725
+ }
3726
+ if (item.lastObservedAt !== null && item.lastObservedAt !== void 0 && Number.isFinite(item.lastObservedAt) && item.lastObservedAt > 0) {
3727
+ return item.lastObservedAt;
3728
+ }
3729
+ const updatedMs = item.updatedAt?.getTime();
3730
+ if (updatedMs !== null && updatedMs !== void 0 && Number.isFinite(updatedMs) && updatedMs > 0) {
3731
+ return updatedMs;
3732
+ }
3733
+ const createdMs = item.createdAt?.getTime();
3734
+ if (createdMs !== null && createdMs !== void 0 && Number.isFinite(createdMs) && createdMs > 0) {
3735
+ return createdMs;
3736
+ }
3737
+ return void 0;
3738
+ }
3713
3739
  var SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
3714
3740
  var SUPERSESSION_MIN_AGE_GAP_MS = 30 * 24 * 60 * 60 * 1e3;
3715
3741
  var SUPERSESSION_BOOST_FACTOR = 0.8;
@@ -3916,6 +3942,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
3916
3942
  }
3917
3943
  let combined;
3918
3944
  let tailSlice = [];
3945
+ const itemById = new Map(items.map((i) => [i.id, i]));
3919
3946
  if (options?.rerank) {
3920
3947
  const rerankTopN = options.rerankTopN ?? 30;
3921
3948
  const ceWeight = options.ceWeight ?? 0.1;
@@ -3923,7 +3950,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
3923
3950
  try {
3924
3951
  const reranked = await rerankPairs(
3925
3952
  query,
3926
- headSlice.map((r) => ({ id: r.uniqueId, content: r.content }))
3953
+ headSlice.map((r) => ({
3954
+ id: r.uniqueId,
3955
+ content: r.content,
3956
+ // C4: date-prefix the CE doc so temporal alignment influences rank.
3957
+ dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
3958
+ }))
3927
3959
  );
3928
3960
  tailSlice = v2Ranked.slice(rerankTopN);
3929
3961
  const v2ScoreById = new Map(headSlice.map((r) => [r.uniqueId, r.similarity]));
@@ -3958,11 +3990,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
3958
3990
  const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
3959
3991
  const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
3960
3992
  const seen = new Set(combined.map((r) => r.uniqueId));
3961
- const itemById = new Map(items.map((i) => [i.id, i]));
3993
+ const itemById2 = new Map(items.map((i) => [i.id, i]));
3962
3994
  for (const lane of sideLanesAsync) {
3963
3995
  for (const id of lane) {
3964
3996
  if (seen.has(id)) continue;
3965
- const it = itemById.get(id);
3997
+ const it = itemById2.get(id);
3966
3998
  if (!it) continue;
3967
3999
  fusedHead.push({
3968
4000
  uniqueId: id,
@@ -3981,11 +4013,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
3981
4013
  if (options?.mmr) {
3982
4014
  const lambda = options.mmrLambda ?? 0.7;
3983
4015
  const mmrTopN = options.mmrTopN ?? 20;
3984
- const itemById = new Map(items.map((i) => [i.id, i]));
4016
+ const itemById2 = new Map(items.map((i) => [i.id, i]));
3985
4017
  const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
3986
4018
  id: r.uniqueId,
3987
4019
  score: r.similarity,
3988
- embedding: itemById.get(r.uniqueId)?.embedding ?? [],
4020
+ embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
3989
4021
  content: r.content
3990
4022
  }));
3991
4023
  const picked = applyMMR(mmrCandidates, limit, lambda);
@@ -4107,7 +4139,12 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
4107
4139
  try {
4108
4140
  const reranked = await rerankPairs(
4109
4141
  originalQuery,
4110
- headSlice.map((r) => ({ id: r.uniqueId, content: r.content }))
4142
+ headSlice.map((r) => ({
4143
+ id: r.uniqueId,
4144
+ content: r.content,
4145
+ // C4: date-prefix the CE doc so temporal alignment influences rank.
4146
+ dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
4147
+ }))
4111
4148
  );
4112
4149
  const ceById = new Map(reranked.map((r) => [r.id, r.score]));
4113
4150
  const head = headSlice.map((r) => ({
@@ -4525,7 +4562,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
4525
4562
  legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
4526
4563
  );
4527
4564
  }
4528
- const { recall: recall2 } = await import("./recall-7ZX6T2VD.mjs");
4565
+ const { recall: recall2 } = await import("./recall-IO4KJ5W7.mjs");
4529
4566
  const result = await recall2(
4530
4567
  query,
4531
4568
  { vaultCtx, embeddingOptions, vaultCache: cache },
@@ -4442,11 +4442,20 @@ async function getModel() {
4442
4442
  function sigmoid(x) {
4443
4443
  return 1 / (1 + Math.exp(-x));
4444
4444
  }
4445
+ function formatRerankDoc(content, dateMs) {
4446
+ if (dateMs === null || dateMs === void 0 || !Number.isFinite(dateMs)) return content;
4447
+ const d = new Date(dateMs);
4448
+ if (!Number.isFinite(d.getTime())) return content;
4449
+ const yyyy = d.getFullYear();
4450
+ const mm = String(d.getMonth() + 1).padStart(2, "0");
4451
+ const dd = String(d.getDate()).padStart(2, "0");
4452
+ return `[Date: ${yyyy}-${mm}-${dd}] ${content}`;
4453
+ }
4445
4454
  async function rerankPairs(query, items) {
4446
4455
  if (items.length === 0 || !query) return [];
4447
4456
  const { tokenizer, model } = await getModel();
4448
4457
  const queries = items.map(() => query);
4449
- const docs = items.map((i) => i.content);
4458
+ const docs = items.map((i) => formatRerankDoc(i.content, i.dateMs));
4450
4459
  const tokenize2 = tokenizer;
4451
4460
  const inputs = tokenize2(queries, { text_pair: docs, padding: true, truncation: true });
4452
4461
  const forward = model;
@@ -5721,6 +5730,23 @@ var init_recall = __esm({
5721
5730
  function normalizeEventTimeKind(kind) {
5722
5731
  return kind === "point" || kind === "range" || kind === "ongoing" ? kind : null;
5723
5732
  }
5733
+ function rerankDateMs(item) {
5734
+ if (item.eventTimeStart !== null && item.eventTimeStart !== void 0 && Number.isFinite(item.eventTimeStart) && item.eventTimeStart > 0) {
5735
+ return item.eventTimeStart;
5736
+ }
5737
+ if (item.lastObservedAt !== null && item.lastObservedAt !== void 0 && Number.isFinite(item.lastObservedAt) && item.lastObservedAt > 0) {
5738
+ return item.lastObservedAt;
5739
+ }
5740
+ const updatedMs = item.updatedAt?.getTime();
5741
+ if (updatedMs !== null && updatedMs !== void 0 && Number.isFinite(updatedMs) && updatedMs > 0) {
5742
+ return updatedMs;
5743
+ }
5744
+ const createdMs = item.createdAt?.getTime();
5745
+ if (createdMs !== null && createdMs !== void 0 && Number.isFinite(createdMs) && createdMs > 0) {
5746
+ return createdMs;
5747
+ }
5748
+ return void 0;
5749
+ }
5724
5750
  function supersessionDelta(olderScore, newerScore, boostFactor = SUPERSESSION_BOOST_FACTOR) {
5725
5751
  const gap = olderScore - newerScore;
5726
5752
  return gap * boostFactor;
@@ -5862,8 +5888,8 @@ function rankFusedVaultMemories(query, queryEmbedding, items, options) {
5862
5888
  const proofCount = Math.max(1, item?.proofCount ?? 1);
5863
5889
  const proofBoost = 1 + proofCountAlpha * Math.log(1 + proofCount) - proofCountAlpha * Math.log(2);
5864
5890
  const rawTypeWeight = item?.factType ? factTypeWeights?.[item.factType] : void 0;
5865
- const typeWeight = rawTypeWeight !== void 0 && Number.isFinite(rawTypeWeight) && rawTypeWeight > 0 ? rawTypeWeight : 1;
5866
- return recencyBoost * proofBoost * typeWeight;
5891
+ const typeWeight2 = rawTypeWeight !== void 0 && Number.isFinite(rawTypeWeight) && rawTypeWeight > 0 ? rawTypeWeight : 1;
5892
+ return recencyBoost * proofBoost * typeWeight2;
5867
5893
  };
5868
5894
  let combined = [...baseRanked, ...admitted].map((r) => ({
5869
5895
  ...r,
@@ -5923,6 +5949,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5923
5949
  }
5924
5950
  let combined;
5925
5951
  let tailSlice = [];
5952
+ const itemById = new Map(items.map((i) => [i.id, i]));
5926
5953
  if (options?.rerank) {
5927
5954
  const rerankTopN = options.rerankTopN ?? 30;
5928
5955
  const ceWeight = options.ceWeight ?? 0.1;
@@ -5930,7 +5957,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5930
5957
  try {
5931
5958
  const reranked = await rerankPairs(
5932
5959
  query,
5933
- headSlice.map((r) => ({ id: r.uniqueId, content: r.content }))
5960
+ headSlice.map((r) => ({
5961
+ id: r.uniqueId,
5962
+ content: r.content,
5963
+ // C4: date-prefix the CE doc so temporal alignment influences rank.
5964
+ dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
5965
+ }))
5934
5966
  );
5935
5967
  tailSlice = v2Ranked.slice(rerankTopN);
5936
5968
  const v2ScoreById = new Map(headSlice.map((r) => [r.uniqueId, r.similarity]));
@@ -5965,11 +5997,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5965
5997
  const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
5966
5998
  const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
5967
5999
  const seen = new Set(combined.map((r) => r.uniqueId));
5968
- const itemById = new Map(items.map((i) => [i.id, i]));
6000
+ const itemById2 = new Map(items.map((i) => [i.id, i]));
5969
6001
  for (const lane of sideLanesAsync) {
5970
6002
  for (const id of lane) {
5971
6003
  if (seen.has(id)) continue;
5972
- const it = itemById.get(id);
6004
+ const it = itemById2.get(id);
5973
6005
  if (!it) continue;
5974
6006
  fusedHead.push({
5975
6007
  uniqueId: id,
@@ -5988,11 +6020,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5988
6020
  if (options?.mmr) {
5989
6021
  const lambda = options.mmrLambda ?? 0.7;
5990
6022
  const mmrTopN = options.mmrTopN ?? 20;
5991
- const itemById = new Map(items.map((i) => [i.id, i]));
6023
+ const itemById2 = new Map(items.map((i) => [i.id, i]));
5992
6024
  const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
5993
6025
  id: r.uniqueId,
5994
6026
  score: r.similarity,
5995
- embedding: itemById.get(r.uniqueId)?.embedding ?? [],
6027
+ embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
5996
6028
  content: r.content
5997
6029
  }));
5998
6030
  const picked = applyMMR(mmrCandidates, limit, lambda);
@@ -6114,7 +6146,12 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
6114
6146
  try {
6115
6147
  const reranked = await rerankPairs(
6116
6148
  originalQuery,
6117
- headSlice.map((r) => ({ id: r.uniqueId, content: r.content }))
6149
+ headSlice.map((r) => ({
6150
+ id: r.uniqueId,
6151
+ content: r.content,
6152
+ // C4: date-prefix the CE doc so temporal alignment influences rank.
6153
+ dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
6154
+ }))
6118
6155
  );
6119
6156
  const ceById = new Map(reranked.map((r) => [r.id, r.score]));
6120
6157
  const head = headSlice.map((r) => ({
@@ -6753,6 +6790,9 @@ __export(index_exports, {
6753
6790
  DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP: () => DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP,
6754
6791
  DEFAULT_MIN_CHUNK_SIZE: () => DEFAULT_MIN_CHUNK_SIZE,
6755
6792
  DEFAULT_PROFILE_FACETS: () => DEFAULT_PROFILE_FACETS,
6793
+ DEFAULT_PROFILE_FACT_TYPE_WEIGHTS: () => DEFAULT_PROFILE_FACT_TYPE_WEIGHTS,
6794
+ DEFAULT_PROFILE_PROOF_ALPHA: () => DEFAULT_PROFILE_PROOF_ALPHA,
6795
+ DEFAULT_PROFILE_TREND_MULTIPLIERS: () => DEFAULT_PROFILE_TREND_MULTIPLIERS,
6756
6796
  DEFAULT_VAULT_CACHE_SIZE: () => DEFAULT_VAULT_CACHE_SIZE,
6757
6797
  DatabaseManager: () => DatabaseManager,
6758
6798
  ENTITY_FANOUT: () => ENTITY_FANOUT,
@@ -6878,6 +6918,7 @@ __export(index_exports, {
6878
6918
  preEmbedVaultMemories: () => preEmbedVaultMemories,
6879
6919
  quantizeEmbedding: () => quantizeEmbedding,
6880
6920
  queueManager: () => queueManager,
6921
+ rankProfileCandidates: () => rankProfileCandidates,
6881
6922
  recall: () => recall,
6882
6923
  reflect: () => reflect,
6883
6924
  refreshNotionAccessToken: () => refreshNotionAccessToken,
@@ -6887,6 +6928,7 @@ __export(index_exports, {
6887
6928
  restoreVaultMemoryOp: () => restoreVaultMemoryOp,
6888
6929
  resumeStream: () => resumeStream,
6889
6930
  retain: () => retain,
6931
+ scoreProfileSalience: () => scoreProfileSalience,
6890
6932
  screenCandidatesForInjection: () => screenCandidatesForInjection,
6891
6933
  sdkMigrations: () => sdkMigrations,
6892
6934
  sdkModelClasses: () => sdkModelClasses,
@@ -15046,6 +15088,64 @@ function createDecaySweeper(options) {
15046
15088
  // src/lib/memory/index.ts
15047
15089
  init_graphTraversal();
15048
15090
  init_observationTrend();
15091
+
15092
+ // src/lib/memory/profileSalience.ts
15093
+ init_observationTrend();
15094
+ var DEFAULT_PROFILE_PROOF_ALPHA = 0.2;
15095
+ var DEFAULT_PROFILE_FACT_TYPE_WEIGHTS = {
15096
+ identity: 1.5,
15097
+ preference: 1.5,
15098
+ relationship: 1.5,
15099
+ constraint: 1.5,
15100
+ other: 1,
15101
+ plan: 0.6,
15102
+ ongoing_context: 0.6
15103
+ };
15104
+ var DEFAULT_PROFILE_TREND_MULTIPLIERS = {
15105
+ strengthening: 1.25,
15106
+ new: 1.1,
15107
+ stable: 1,
15108
+ weakening: 0.75,
15109
+ stale: 0.5
15110
+ };
15111
+ function typeWeight(factType, weights) {
15112
+ if (!factType) return 1;
15113
+ const w = weights[factType];
15114
+ if (w !== void 0 && Number.isFinite(w) && w > 0) return w;
15115
+ return 1;
15116
+ }
15117
+ function scoreProfileSalience(input, now = Date.now(), options = {}) {
15118
+ const alpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
15119
+ const typeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
15120
+ const trendMults = { ...DEFAULT_PROFILE_TREND_MULTIPLIERS, ...options.trendMultipliers };
15121
+ const proofs = Math.max(1, input.proofCount ?? 1);
15122
+ const proofBoost = 1 + alpha * Math.log(1 + proofs) - alpha * Math.log(2);
15123
+ const trend = classifyObservationTrend(input, now);
15124
+ const tw = typeWeight(input.factType, typeWeights);
15125
+ const tm = trendMults[trend] ?? 1;
15126
+ const score = tw * proofBoost * tm;
15127
+ return Number.isFinite(score) ? score : 0;
15128
+ }
15129
+ function rankProfileCandidates(inputs, now = Date.now(), options = {}) {
15130
+ const ranked = inputs.map((input) => {
15131
+ const proofs = Math.max(1, input.proofCount ?? 1);
15132
+ return {
15133
+ id: input.id,
15134
+ score: scoreProfileSalience(input, now, options),
15135
+ trend: classifyObservationTrend(input, now),
15136
+ factType: input.factType ?? null,
15137
+ proofCount: proofs
15138
+ };
15139
+ });
15140
+ ranked.sort((a, b) => {
15141
+ if (b.score !== a.score) return b.score - a.score;
15142
+ if (b.proofCount !== a.proofCount) return b.proofCount - a.proofCount;
15143
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
15144
+ });
15145
+ return ranked;
15146
+ }
15147
+
15148
+ // src/lib/memory/index.ts
15049
15149
  init_recall();
15050
15150
 
15051
15151
  // src/lib/memory/recallTool.ts
@@ -15279,18 +15379,18 @@ async function reflect(query, ctx, options) {
15279
15379
  usage: { promptTokens: 0, completionTokens: 0, totalTokens: 0 }
15280
15380
  };
15281
15381
  if (trimmed.length === 0) return empty;
15282
- const { maxTokens: _llmMaxTokens, ...recallOptions } = options;
15283
- const recalled = await recall(trimmed, ctx, recallOptions);
15284
- const memoryIds = recalled.memories.map((m) => m.id);
15382
+ const { maxTokens: _llmMaxTokens, memories: providedMemories, ...recallOptions } = options;
15383
+ const recalledMemories = providedMemories !== void 0 ? providedMemories : (await recall(trimmed, ctx, recallOptions)).memories;
15384
+ const memoryIds = recalledMemories.map((m) => m.id);
15285
15385
  const baseResult = {
15286
15386
  text: "",
15287
15387
  basedOn: { memoryIds },
15288
15388
  usage: { promptTokens: 0, completionTokens: 0, totalTokens: 0 }
15289
15389
  };
15290
- if (recalled.memories.length === 0) {
15390
+ if (recalledMemories.length === 0) {
15291
15391
  return baseResult;
15292
15392
  }
15293
- const evidence = recalled.memories.map((m, i) => `[${i + 1}] (id: ${m.id}, kind: ${m.kind})
15393
+ const evidence = recalledMemories.map((m, i) => `[${i + 1}] (id: ${m.id}, kind: ${m.kind})
15294
15394
  ${m.content}`).join("\n\n");
15295
15395
  const baseUrl = options.baseUrl ?? DEFAULT_BASE_URL2;
15296
15396
  const model = options.llmModel ?? DEFAULT_MODEL5;
@@ -15413,6 +15513,7 @@ init_constants();
15413
15513
  init_embeddings();
15414
15514
  init_vector();
15415
15515
  init_observationTrend();
15516
+ init_recall();
15416
15517
  var DEFAULT_SYNTHESIS_MODEL = "inclusionai/ling-2.6-flash";
15417
15518
  var DEFAULT_FACET_RECALL_LIMIT = 20;
15418
15519
  var DEFAULT_FACET_MAX_TOKENS = 512;
@@ -15485,7 +15586,8 @@ async function synthesizeProfile(ctx, options = {}) {
15485
15586
  facetKeys: facets.map((f) => f.key).sort(),
15486
15587
  facetsSignature: facetsSignature(facets),
15487
15588
  scopes: [...scopes].sort(),
15488
- redacted: options.redactor !== void 0
15589
+ redacted: options.redactor !== void 0,
15590
+ reviewedMemoryIdsSignature: reviewedMemoryIdsSignature(options.reviewedMemoryIds)
15489
15591
  };
15490
15592
  const previous = options.previous && options.previous.version === PROFILE_DOC_VERSION && configMatches(options.previous.config, config) ? options.previous : void 0;
15491
15593
  const memories = await getAllVaultMemoriesOp(ctx.vaultCtx, {
@@ -15558,7 +15660,11 @@ async function synthesizeProfile(ctx, options = {}) {
15558
15660
  }
15559
15661
  function configMatches(a, b) {
15560
15662
  if (!a) return false;
15561
- return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
15663
+ return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
15664
+ }
15665
+ function reviewedMemoryIdsSignature(ids) {
15666
+ if (ids === void 0 || ids.length === 0) return "";
15667
+ return [...new Set(ids)].sort().join("\n");
15562
15668
  }
15563
15669
  function facetsSignature(facets) {
15564
15670
  return facets.map((f) => JSON.stringify([f.key, f.label, f.query, f.guidance])).sort().join("\n");
@@ -15662,18 +15768,46 @@ async function attributeFacts(ctx, candidates, facets) {
15662
15768
  return keys;
15663
15769
  }
15664
15770
  async function synthesizeFacet(facet, ctx, options, prior) {
15771
+ const scopes = options.scopes ?? DEFAULT_SCOPES;
15772
+ const limit = options.limit ?? DEFAULT_FACET_RECALL_LIMIT;
15773
+ const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
15774
+ const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
15775
+ const reviewed = options.reviewedMemoryIds;
15776
+ const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
15777
+ const recalled = await recall(facet.query, ctx, {
15778
+ scopes,
15779
+ limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
15780
+ types: ["fact"],
15781
+ factTypeWeights,
15782
+ proofCountAlpha
15783
+ });
15784
+ let memories = recalled.memories;
15785
+ if (hasReviewGate) {
15786
+ const allowed = new Set(reviewed);
15787
+ memories = memories.filter((m) => allowed.has(m.id)).slice(0, limit);
15788
+ }
15789
+ if (memories.length === 0) {
15790
+ return {
15791
+ key: facet.key,
15792
+ label: facet.label,
15793
+ text: "",
15794
+ sourceMemoryIds: [],
15795
+ generatedAt: Date.now()
15796
+ };
15797
+ }
15665
15798
  const result = await reflect(facet.query, ctx, {
15666
15799
  apiKey: options.apiKey,
15667
15800
  getToken: options.getToken,
15668
15801
  llmModel: options.llmModel ?? DEFAULT_SYNTHESIS_MODEL,
15669
15802
  baseUrl: options.baseUrl,
15670
15803
  fetchFn: options.fetchFn,
15671
- scopes: options.scopes ?? DEFAULT_SCOPES,
15672
- limit: options.limit ?? DEFAULT_FACET_RECALL_LIMIT,
15804
+ scopes,
15805
+ limit,
15673
15806
  types: ["fact"],
15674
15807
  maxTokens: DEFAULT_FACET_MAX_TOKENS,
15675
15808
  systemPrompt: buildFacetSystemPrompt(facet),
15676
- responseSchema: FACET_RESPONSE_SCHEMA
15809
+ responseSchema: FACET_RESPONSE_SCHEMA,
15810
+ memories
15677
15811
  });
15678
15812
  const noEvidence = result.basedOn.memoryIds.length === 0;
15679
15813
  const { text: text12, legitimateEmpty } = extractFacetText(result.structuredOutput);
@@ -21294,6 +21428,9 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
21294
21428
  DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP,
21295
21429
  DEFAULT_MIN_CHUNK_SIZE,
21296
21430
  DEFAULT_PROFILE_FACETS,
21431
+ DEFAULT_PROFILE_FACT_TYPE_WEIGHTS,
21432
+ DEFAULT_PROFILE_PROOF_ALPHA,
21433
+ DEFAULT_PROFILE_TREND_MULTIPLIERS,
21297
21434
  DEFAULT_VAULT_CACHE_SIZE,
21298
21435
  DatabaseManager,
21299
21436
  ENTITY_FANOUT,
@@ -21419,6 +21556,7 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
21419
21556
  preEmbedVaultMemories,
21420
21557
  quantizeEmbedding,
21421
21558
  queueManager,
21559
+ rankProfileCandidates,
21422
21560
  recall,
21423
21561
  reflect,
21424
21562
  refreshNotionAccessToken,
@@ -21428,6 +21566,7 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
21428
21566
  restoreVaultMemoryOp,
21429
21567
  resumeStream,
21430
21568
  retain,
21569
+ scoreProfileSalience,
21431
21570
  screenCandidatesForInjection,
21432
21571
  sdkMigrations,
21433
21572
  sdkModelClasses,
@@ -4887,7 +4887,7 @@ interface VaultSearchResult {
4887
4887
  updatedAt?: Date;
4888
4888
  /** Times this fact has been re-observed — for C2 trend labels. */
4889
4889
  proofCount?: number | null;
4890
- /** C3 re-observation watermark (Unix ms) — for C2 trend labels. */
4890
+ /** C3 re-observation watermark (Unix ms) — for C2 trends + C4 CE dates. */
4891
4891
  lastObservedAt?: number | null;
4892
4892
  /** W6 temporal-lane anchors carried through to downstream `RankedMemory`
4893
4893
  * so the recall executor can surface dates to the answer model without
@@ -7001,6 +7001,66 @@ interface LlmNeighborRefinerOptions extends PortalLlmAuth {
7001
7001
  */
7002
7002
  declare function createLlmNeighborRefiner(options: LlmNeighborRefinerOptions): NeighborRefiner;
7003
7003
 
7004
+ /**
7005
+ * Profile salience — profile-worthiness scoring for vault facts (#706).
7006
+ *
7007
+ * Distinct from query-time relevance (`recall` fusion). Answers: "is this
7008
+ * fact worth putting on a shareable profile?" using durable type, proof
7009
+ * density, and C2 observation trend. Pure + deterministic — no LLM, no DB.
7010
+ *
7011
+ * Used by:
7012
+ * - `synthesizeProfile` facet recall (default factTypeWeights)
7013
+ * - Publish-review UIs via {@link rankProfileCandidates} (nearby / client)
7014
+ *
7015
+ * Persisted `importance` is deferred until publish flow proves the need.
7016
+ */
7017
+
7018
+ /** Proof-count curve weight inside {@link scoreProfileSalience}. */
7019
+ declare const DEFAULT_PROFILE_PROOF_ALPHA = 0.2;
7020
+ /**
7021
+ * Per-FactType multipliers for profile synthesis / salience.
7022
+ * Durable identity-class types (never age-archive in decay) rank higher;
7023
+ * ephemeral plan/ongoing_context rank lower. Untyped / `other` stay neutral.
7024
+ */
7025
+ declare const DEFAULT_PROFILE_FACT_TYPE_WEIGHTS: Partial<Record<FactType, number>>;
7026
+ /** C2 trend multipliers for profile-worthiness. */
7027
+ declare const DEFAULT_PROFILE_TREND_MULTIPLIERS: Record<ObservationTrend, number>;
7028
+ interface ProfileSalienceInput extends ObservationTrendInput {
7029
+ /** Vault memory id — required for {@link rankProfileCandidates}. */
7030
+ id: string;
7031
+ /** Extractor FactType; null/undefined → neutral weight (1.0). */
7032
+ factType?: string | null;
7033
+ }
7034
+ interface RankedProfileCandidate {
7035
+ id: string;
7036
+ score: number;
7037
+ trend: ObservationTrend;
7038
+ factType?: string | null;
7039
+ proofCount: number;
7040
+ }
7041
+ interface ScoreProfileSalienceOptions {
7042
+ /** Override type weights (merged over {@link DEFAULT_PROFILE_FACT_TYPE_WEIGHTS}). */
7043
+ factTypeWeights?: Partial<Record<FactType, number>>;
7044
+ /** Override trend multipliers. */
7045
+ trendMultipliers?: Partial<Record<ObservationTrend, number>>;
7046
+ /** Proof-count α. Default: {@link DEFAULT_PROFILE_PROOF_ALPHA}. */
7047
+ proofCountAlpha?: number;
7048
+ }
7049
+ /**
7050
+ * Score a vault fact for profile-worthiness.
7051
+ *
7052
+ * `typeWeight * (1 + α·log(1+proofCount) − α·log(2)) * trendMultiplier`
7053
+ *
7054
+ * The proof term mirrors vault fusion's log curve (neutral at proofCount=1).
7055
+ * Pass `now` for deterministic evals.
7056
+ */
7057
+ declare function scoreProfileSalience(input: ProfileSalienceInput, now?: number, options?: ScoreProfileSalienceOptions): number;
7058
+ /**
7059
+ * Rank vault facts by profile-worthiness (descending score).
7060
+ * Ties broken by higher proofCount, then id ascending for stability.
7061
+ */
7062
+ declare function rankProfileCandidates(inputs: readonly ProfileSalienceInput[], now?: number, options?: ScoreProfileSalienceOptions): RankedProfileCandidate[];
7063
+
7004
7064
  /**
7005
7065
  * Unified Recall API — single retrieval surface above vault + engine.
7006
7066
  *
@@ -7138,6 +7198,12 @@ interface ReflectOptions extends RecallOptions, PortalLlmAuth {
7138
7198
  fetchFn?: typeof fetch;
7139
7199
  /** Optional JSON Schema to coerce structured outputs. */
7140
7200
  responseSchema?: Record<string, unknown>;
7201
+ /**
7202
+ * Skip Stage-1 {@link recall} and synthesize from these memories instead.
7203
+ * Used by `synthesizeProfile` after intersecting recall with a
7204
+ * `reviewedMemoryIds` gate so the LLM never sees unreviewed evidence.
7205
+ */
7206
+ memories?: RankedMemory[];
7141
7207
  }
7142
7208
  interface ReflectResult {
7143
7209
  /** The synthesized answer text. */
@@ -7261,8 +7327,9 @@ interface ProfileSection {
7261
7327
  /** Fingerprint of the config that produced a {@link ProfileDoc}. Delta reuse
7262
7328
  * (both the wholesale fast path and per-section reuse) is only valid when the
7263
7329
  * current call's config matches — otherwise reused sections could carry the
7264
- * wrong scope's evidence, un-redacted text under a now-present redactor, or an
7265
- * old section shape. */
7330
+ * wrong scope's evidence, un-redacted text under a now-present redactor, an
7331
+ * old section shape, or text grounded in memory ids that are no longer in the
7332
+ * publish-review set. */
7266
7333
  interface ProfileConfigFingerprint {
7267
7334
  /** Facet keys present in the doc, sorted. */
7268
7335
  facetKeys: ProfileFacetKey[];
@@ -7277,6 +7344,14 @@ interface ProfileConfigFingerprint {
7277
7344
  /** Whether a PII redactor gated the section text. Reusing un-gated text under
7278
7345
  * a now-present redactor would leak PII, so this flips the fingerprint. */
7279
7346
  redacted: boolean;
7347
+ /**
7348
+ * Order-independent digest of {@link SynthesizeProfileOptions.reviewedMemoryIds}.
7349
+ * Empty string when the review gate is off (omit / empty array). Changing the
7350
+ * set must invalidate reuse — otherwise a narrowed review keeps text grounded
7351
+ * in unreviewed ids, and a widened review leaves previously-cleared sections
7352
+ * empty.
7353
+ */
7354
+ reviewedMemoryIdsSignature: string;
7280
7355
  }
7281
7356
  /** A synthesized profile. Server-authoritative once published; the client
7282
7357
  * caches it and passes it back as {@link SynthesizeProfileOptions.previous}. */
@@ -7322,6 +7397,24 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
7322
7397
  * Omit only when the caller redacts downstream — `nearby` also moderates
7323
7398
  * server-side, but the client should never publish un-gated text. */
7324
7399
  redactor?: PiiRedactor;
7400
+ /**
7401
+ * Per-FactType score multipliers for facet recall. Default:
7402
+ * {@link DEFAULT_PROFILE_FACT_TYPE_WEIGHTS} (durable types boosted).
7403
+ * Does not change global chat `recall()` defaults.
7404
+ */
7405
+ factTypeWeights?: Partial<Record<FactType, number>>;
7406
+ /**
7407
+ * Proof-count α for facet recall. Default: {@link DEFAULT_PROFILE_PROOF_ALPHA}
7408
+ * (0.2). Chat recall stays at 0.1.
7409
+ */
7410
+ proofCountAlpha?: number;
7411
+ /**
7412
+ * When non-empty, intersect each facet's recalled evidence with this id set
7413
+ * before the LLM runs (publish-review gate). Empty intersection → empty
7414
+ * section (legitimate no-evidence), not a stale fallback. Omit / empty →
7415
+ * no gate.
7416
+ */
7417
+ reviewedMemoryIds?: readonly string[];
7325
7418
  }
7326
7419
  /**
7327
7420
  * Synthesize a shareable {@link ProfileDoc} from the user's vault, on-device.
@@ -8793,4 +8886,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
8793
8886
  */
8794
8887
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
8795
8888
 
8796
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
8889
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };