@anuma/sdk 6.40.0 → 6.42.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.
@@ -27383,6 +27383,10 @@ var ENTITY_KINDS = [
27383
27383
  function normalizeEntityName(name) {
27384
27384
  return name.trim().toLowerCase();
27385
27385
  }
27386
+ var TOPIC_SALIENCE_WEIGHTS = { primary: 1, secondary: 0.6, mention: 0.3 };
27387
+ function parseTopicWeight(value) {
27388
+ return typeof value === "number" && value > 0 && value <= 1 ? value : void 0;
27389
+ }
27386
27390
  function serializeTopics(topics) {
27387
27391
  return JSON.stringify(topics);
27388
27392
  }
@@ -27398,12 +27402,14 @@ function parseTopics(value) {
27398
27402
  const out = [];
27399
27403
  for (const raw of parsed) {
27400
27404
  if (typeof raw !== "object" || raw === null) continue;
27401
- const { name, kind, source } = raw;
27405
+ const { name, kind, source, weight } = raw;
27402
27406
  if (typeof name !== "string" || name.trim().length === 0) continue;
27407
+ const parsedWeight = parseTopicWeight(weight);
27403
27408
  out.push({
27404
27409
  name,
27405
27410
  ...typeof kind === "string" && kind.length > 0 ? { kind } : {},
27406
- source: source === "user" ? "user" : "auto"
27411
+ source: source === "user" ? "user" : "auto",
27412
+ ...parsedWeight !== void 0 ? { weight: parsedWeight } : {}
27407
27413
  });
27408
27414
  }
27409
27415
  return out;
@@ -27490,21 +27496,47 @@ function displayNamesOf(entities) {
27490
27496
  }
27491
27497
  function topicsEqual(stored, computed) {
27492
27498
  if (stored === null || stored.length !== computed.length) return false;
27493
- const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source]);
27499
+ const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source, t.weight ?? null]);
27494
27500
  const storedKeys = stored.map(key).sort();
27495
27501
  const computedKeys = computed.map(key).sort();
27496
27502
  return storedKeys.every((k, i) => k === computedKeys[i]);
27497
27503
  }
27498
- function resolveTopicsWrite(row, linked, displayNames, source) {
27504
+ function resolveTopicsWrite(row, linked, inputs, source, mode) {
27499
27505
  if (row === null || source === null) return null;
27500
- const topics = topicsForEntities(linked, displayNames, source);
27501
- if (topicsEqual(parseTopics(row.topics), topics)) return null;
27506
+ const stored = parseTopics(row.topics);
27507
+ const carried = mode === "merge" ? stored : null;
27508
+ const weights = source === "auto" ? weightsOf(carried, inputs) : null;
27509
+ const displayNames = displayNamesOf([...inputs, ...carried ?? []]);
27510
+ const topics = topicsForEntities(linked, displayNames, source, weights);
27511
+ if (topicsEqual(stored, topics)) return null;
27502
27512
  return { row, topics };
27503
27513
  }
27504
- function topicsForEntities(entities, displayNames, source) {
27514
+ function weightsOf(stored, inputs) {
27515
+ const out = /* @__PURE__ */ new Map();
27516
+ for (const topic of stored ?? []) out.set(normalizeEntityName(topic.name), topic.weight);
27517
+ for (const input of inputs) {
27518
+ const weight = parseTopicWeight(input.weight);
27519
+ if (weight === void 0) continue;
27520
+ const name = normalizeEntityName(input.name);
27521
+ if (!out.has(name)) {
27522
+ out.set(name, weight);
27523
+ continue;
27524
+ }
27525
+ const current = out.get(name);
27526
+ if (current !== void 0 && weight > current) out.set(name, weight);
27527
+ }
27528
+ return out;
27529
+ }
27530
+ function topicsForEntities(entities, displayNames, source, weights) {
27505
27531
  return entities.map((e) => {
27506
27532
  const name = displayNames.get(e.canonicalName) ?? e.canonicalName;
27507
- return { name, ...e.kind ? { kind: e.kind } : {}, source };
27533
+ const weight = weights?.get(e.canonicalName);
27534
+ return {
27535
+ name,
27536
+ ...e.kind ? { kind: e.kind } : {},
27537
+ source,
27538
+ ...weight !== void 0 ? { weight } : {}
27539
+ };
27508
27540
  });
27509
27541
  }
27510
27542
  function toEntityObjects(entityInputs) {
@@ -27512,7 +27544,7 @@ function toEntityObjects(entityInputs) {
27512
27544
  }
27513
27545
  async function resolveMemoryTopicsWrite(ctx, memoryId, linked, inputs, source) {
27514
27546
  const row = await findVaultRowInWrite(ctx, memoryId);
27515
- return resolveTopicsWrite(row, linked, displayNamesOf(toEntityObjects(inputs)), source);
27547
+ return resolveTopicsWrite(row, linked, toEntityObjects(inputs), source, "replace");
27516
27548
  }
27517
27549
  function prepareMemoryTopicsUpdate(write) {
27518
27550
  return prepareTopicsUpdate(write.row, write.topics, Date.now());
@@ -27550,8 +27582,9 @@ async function linkMemoryEntitiesOp(ctx, memoryId, entityInputs, options) {
27550
27582
  const topicsWrite = resolveTopicsWrite(
27551
27583
  vaultRow,
27552
27584
  [...carriedOver, ...entities],
27553
- displayNamesOf(normalized),
27554
- options?.topicsSource ?? "auto"
27585
+ normalized,
27586
+ options?.topicsSource ?? "auto",
27587
+ "merge"
27555
27588
  );
27556
27589
  if (entityOps.length === 0 && kindBackfills.length === 0 && toCreate.length === 0 && topicsWrite === null) {
27557
27590
  return;
@@ -27617,8 +27650,9 @@ async function replaceMemoryEntities(ctx, memoryId, entityInputs, options) {
27617
27650
  const topicsWrite = resolveTopicsWrite(
27618
27651
  vaultRow,
27619
27652
  entities,
27620
- displayNamesOf(normalized),
27621
- options.topicsSource
27653
+ normalized,
27654
+ options.topicsSource,
27655
+ "replace"
27622
27656
  );
27623
27657
  if (entityOps.length === 0 && kindBackfills.length === 0 && toCreate.length === 0 && toDestroy.length === 0 && topicsWrite === null) {
27624
27658
  return;
@@ -32599,9 +32633,9 @@ For each durable fact, output:
32599
32633
  - type: one of identity | preference | relationship | plan | ongoing_context | constraint | other
32600
32634
  - confidence: 0.0-1.0; how sure you are this is durable AND true. Only include facts >= 0.7.
32601
32635
  - sourceMessageIds: which message IDs from the conversation contained the evidence
32602
- - entities: named entities mentioned, each as an object { "name": string, "kind": one of "person" | "organization" | "place" | "event" | "product" | "thing" | "concept" | "other" }. Optional \u2014 include only NAMED entities, skip generic/common nouns. ${ENTITY_KIND_GUIDELINES} Examples:
32603
- - "started a new job at Hollowpoint Labs and I'm learning Haskell for it" \u2192 entities: [{ "name": "Hollowpoint Labs", "kind": "organization" }, { "name": "Haskell", "kind": "concept" }]
32604
- - "running the Berlin Half in May and I track workouts in Whoop" \u2192 entities: [{ "name": "Berlin Half", "kind": "event" }, { "name": "Whoop", "kind": "product" }]
32636
+ - entities: named entities mentioned, each as an object { "name": string, "kind": one of "person" | "organization" | "place" | "event" | "product" | "thing" | "concept" | "other", "salience": one of "primary" | "secondary" | "mention" }. Optional \u2014 include only NAMED entities, skip generic/common nouns. ${ENTITY_KIND_GUIDELINES} Salience is how central the entity is to the fact: "primary" = the fact is ABOUT it (usually exactly one per fact), "secondary" = a meaningful part of it, "mention" = named in passing. Examples:
32637
+ - "started a new job at Hollowpoint Labs and I'm learning Haskell for it" \u2192 entities: [{ "name": "Hollowpoint Labs", "kind": "organization", "salience": "primary" }, { "name": "Haskell", "kind": "concept", "salience": "secondary" }]
32638
+ - "running the Berlin Half in May and I track workouts in Whoop" \u2192 entities: [{ "name": "Berlin Half", "kind": "event", "salience": "primary" }, { "name": "Whoop", "kind": "product", "salience": "mention" }]
32605
32639
  - eventTime: when the event in this fact occurs/occurred. Resolve relative phrases ("yesterday", "next week") against the current date given in the user message. Output one of:
32606
32640
  - { "kind": "point", "start": "YYYY-MM-DD" } for a single date ("met Sara on March 14, 2026")
32607
32641
  - { "kind": "range", "start": "YYYY-MM-DD", "end": "YYYY-MM-DD" } for a span ("Japan trip May 4\u201315, 2026")
@@ -32682,9 +32716,10 @@ function restoreCandidates(candidates, redactor, ownNames) {
32682
32716
  candidate: {
32683
32717
  ...c,
32684
32718
  content: content.text,
32685
- entities: c.entities.map((e) => ({ kind: e.kind, restored: redactor.restoreForStorage(e.name) })).filter((e) => !e.restored.unresolved).map(
32686
- (e) => e.kind !== void 0 ? { name: e.restored.text, kind: e.kind } : { name: e.restored.text }
32687
- )
32719
+ entities: c.entities.flatMap((e) => {
32720
+ const restored = redactor.restoreForStorage(e.name);
32721
+ return restored.unresolved ? [] : [{ ...e, name: restored.text }];
32722
+ })
32688
32723
  },
32689
32724
  unresolved: content.unresolved
32690
32725
  };
@@ -32913,7 +32948,12 @@ function parseEntities(raw) {
32913
32948
  const name = typeof obj.name === "string" ? obj.name.trim() : "";
32914
32949
  if (name.length === 0 || isGenericEntityName(name)) continue;
32915
32950
  const kind = typeof obj.kind === "string" && ENTITY_KINDS.includes(obj.kind) ? obj.kind : void 0;
32916
- out.push(kind !== void 0 ? { name, kind } : { name });
32951
+ const weight = typeof obj.salience === "string" && Object.keys(TOPIC_SALIENCE_WEIGHTS).includes(obj.salience) ? TOPIC_SALIENCE_WEIGHTS[obj.salience] : void 0;
32952
+ out.push({
32953
+ name,
32954
+ ...kind !== void 0 ? { kind } : {},
32955
+ ...weight !== void 0 ? { weight } : {}
32956
+ });
32917
32957
  }
32918
32958
  return out;
32919
32959
  }
@@ -34893,7 +34933,13 @@ Include only NAMED entities, skip generic/common nouns. A topic must identify a
34893
34933
  - Prefer 0 entities over a weak one. A memory whose only candidate is a generic noun has NO entities.
34894
34934
  ${ENTITY_KIND_GUIDELINES}
34895
34935
 
34896
- Each memory below is written as "<id>: <text>". Output strict JSON: {"memories": [{"id": string, "entities": [{"name": string, "kind": string}]}]}
34936
+ Give each entity a "salience" \u2014 how central it is to the memory:
34937
+ - "primary": the memory is ABOUT it. A memory with entities usually has exactly one primary; never more than two.
34938
+ - "secondary": a meaningful part of the memory, but not its subject.
34939
+ - "mention": named in passing; the memory would say much the same without it.
34940
+ Example: "Ran the Chicago Marathon with my sister Ana in 3:41" \u2192 Chicago Marathon primary, Ana secondary.
34941
+
34942
+ Each memory below is written as "<id>: <text>". Output strict JSON: {"memories": [{"id": string, "entities": [{"name": string, "kind": string, "salience": "primary" | "secondary" | "mention"}]}]}
34897
34943
  - exactly one element per input memory; copy its id EXACTLY as written (the token before the first ": "), with no brackets, quotes, or extra characters
34898
34944
  - "entities" may be empty when a memory mentions no named entities \u2014 most short memories have 0-3
34899
34945
  No prose.`;
@@ -34964,9 +35010,10 @@ List each memory's named entities.`,
34964
35010
  return out;
34965
35011
  }
34966
35012
  function restoreEntities(entities, redactor) {
34967
- return entities.map((e) => ({ kind: e.kind, restored: redactor.restoreForStorage(e.name) })).filter((e) => !e.restored.unresolved).map(
34968
- (e) => e.kind !== void 0 ? { name: e.restored.text, kind: e.kind } : { name: e.restored.text }
34969
- );
35013
+ return entities.flatMap((e) => {
35014
+ const restored = redactor.restoreForStorage(e.name);
35015
+ return restored.unresolved ? [] : [{ ...e, name: restored.text }];
35016
+ });
34970
35017
  }
34971
35018
  function parseTopicResponse(parsed, validIds) {
34972
35019
  if (typeof parsed !== "object" || parsed === null) return null;
@@ -35364,12 +35411,19 @@ var FACET_STRUCTURED_RESPONSE_HINT = {
35364
35411
  interests: `, "interests": <the same interests as an array of at most ${NEARBY_MAX_INTERESTS} strings of at most ${NEARBY_MAX_INTEREST_CODEPOINTS} characters each, e.g. ["trail running", "film photography"], or []>`
35365
35412
  };
35366
35413
  async function synthesizeProfile(ctx, options = {}) {
35367
- if (!ctx.vaultCtx) {
35368
- throw new Error("synthesizeProfile requires ctx.vaultCtx (vault-backed facts).");
35414
+ const { store } = options;
35415
+ const vaultCtx = ctx.vaultCtx;
35416
+ if (!store && !vaultCtx) {
35417
+ throw new Error(
35418
+ "synthesizeProfile requires options.store or ctx.vaultCtx (vault-backed facts)."
35419
+ );
35369
35420
  }
35370
- if (!ctx.vaultCache) {
35371
- throw new Error("synthesizeProfile requires ctx.vaultCache (semantic fact recall).");
35421
+ if (!store && !ctx.vaultCache) {
35422
+ throw new Error(
35423
+ "synthesizeProfile requires options.store or ctx.vaultCache (semantic fact recall)."
35424
+ );
35372
35425
  }
35426
+ const recallCtx = store ? { embeddingOptions: ctx.embeddingOptions, factSource: store.factSource } : ctx;
35373
35427
  const facets = options.facets ?? DEFAULT_PROFILE_FACETS;
35374
35428
  const scopes = options.scopes ?? DEFAULT_SCOPES;
35375
35429
  const config = {
@@ -35380,11 +35434,8 @@ async function synthesizeProfile(ctx, options = {}) {
35380
35434
  reviewedMemoryIdsSignature: reviewedMemoryIdsSignature(options.reviewedMemoryIds)
35381
35435
  };
35382
35436
  const previous = options.previous && options.previous.version === PROFILE_DOC_VERSION && configMatches(options.previous.config, config) ? options.previous : void 0;
35383
- const memories = await getAllVaultMemoriesOp(ctx.vaultCtx, {
35384
- scopes,
35385
- includeDeleted: true,
35386
- includeSuperseded: true
35387
- });
35437
+ const listOptions = { scopes, includeDeleted: true, includeSuperseded: true };
35438
+ const [memories, projections] = store ? await Promise.all([store.list(listOptions), store.listProjections(listOptions)]) : [await getAllVaultMemoriesOp(vaultCtx, listOptions), []];
35388
35439
  const watermark = computeVaultWatermark(memories);
35389
35440
  const observationTrends = summarizeObservationTrends(
35390
35441
  memories.filter((m) => !m.isDeleted && m.supersededBy === null).map((m) => ({
@@ -35394,11 +35445,14 @@ async function synthesizeProfile(ctx, options = {}) {
35394
35445
  }))
35395
35446
  );
35396
35447
  const presentIds = new Set(memories.map((m) => m.uniqueId));
35448
+ const unreadableMemoryIds = projections.map((p) => p.uniqueId).filter((id) => !presentIds.has(id)).sort();
35449
+ const previousUnreadable = new Set(previous?.unreadableMemoryIds ?? []);
35450
+ const sameUnreadable = unreadableMemoryIds.length === previousUnreadable.size && unreadableMemoryIds.every((id) => previousUnreadable.has(id));
35397
35451
  const hasStaleSections = previous?.sections.some((s) => s.stale);
35398
35452
  const citesMissingFact = previous?.sections.some(
35399
35453
  (s) => s.sourceMemoryIds.some((id) => !presentIds.has(id))
35400
35454
  );
35401
- if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact) {
35455
+ if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact && sameUnreadable) {
35402
35456
  const sameOrder = previous.sections.length === facets.length && facets.every((f, i) => previous.sections[i]?.key === f.key);
35403
35457
  if (sameOrder) {
35404
35458
  if (trendsEqual(previous.observationTrends, observationTrends)) return previous;
@@ -35411,12 +35465,13 @@ async function synthesizeProfile(ctx, options = {}) {
35411
35465
  };
35412
35466
  }
35413
35467
  const staleKeys = await computeStaleFacetKeys(
35414
- ctx,
35468
+ recallCtx,
35415
35469
  memories,
35416
35470
  facets,
35417
35471
  previous,
35418
35472
  watermark,
35419
- options.reviewedMemoryIds
35473
+ options.reviewedMemoryIds,
35474
+ previousUnreadable
35420
35475
  );
35421
35476
  const memoriesById = new Map(memories.map((memory) => [memory.uniqueId, memory]));
35422
35477
  const fallbackPriors = /* @__PURE__ */ new Map();
@@ -35436,7 +35491,7 @@ async function synthesizeProfile(ctx, options = {}) {
35436
35491
  if (prior && !staleKeys.has(facet.key)) {
35437
35492
  return prior;
35438
35493
  }
35439
- return synthesizeFacet(facet, ctx, options, fallbackPriors.get(facet.key));
35494
+ return synthesizeFacet(facet, recallCtx, options, fallbackPriors.get(facet.key));
35440
35495
  })
35441
35496
  );
35442
35497
  const sections = settled.map((r, i) => {
@@ -35451,12 +35506,18 @@ async function synthesizeProfile(ctx, options = {}) {
35451
35506
  );
35452
35507
  return fallbackSection(facet, fallbackPriors.get(facet.key));
35453
35508
  });
35509
+ if (!sameUnreadable && unreadableMemoryIds.length > 0) {
35510
+ getLogger().warn("[memory/synthesizeProfile] some memories could not be read", {
35511
+ unreadable: unreadableMemoryIds.length
35512
+ });
35513
+ }
35454
35514
  return {
35455
35515
  version: PROFILE_DOC_VERSION,
35456
35516
  sections,
35457
35517
  vaultWatermark: watermark,
35458
35518
  config,
35459
35519
  observationTrends,
35520
+ ...unreadableMemoryIds.length > 0 && { unreadableMemoryIds },
35460
35521
  generatedAt: Date.now()
35461
35522
  };
35462
35523
  }
@@ -35490,11 +35551,13 @@ function computeVaultWatermark(memories) {
35490
35551
  }
35491
35552
  return max;
35492
35553
  }
35493
- async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds) {
35554
+ async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds, previouslyUnreadable) {
35494
35555
  const allKeys = new Set(facets.map((f) => f.key));
35495
35556
  if (previous && watermark < previous.vaultWatermark) return allKeys;
35496
35557
  if (!previous) return allKeys;
35497
- const changed = memories.filter((m) => changeTime(m) > previous.vaultWatermark);
35558
+ const changed = memories.filter(
35559
+ (m) => changeTime(m) > previous.vaultWatermark || previouslyUnreadable.has(m.uniqueId)
35560
+ );
35498
35561
  const changedIds = new Set(changed.map((m) => m.uniqueId));
35499
35562
  const presentIds = new Set(memories.map((m) => m.uniqueId));
35500
35563
  const stale = /* @__PURE__ */ new Set();
@@ -35568,7 +35631,12 @@ async function attributeFacts(ctx, candidates, facets) {
35568
35631
  for (const fv of factVectors) {
35569
35632
  let matchedAny = false;
35570
35633
  for (let i = 0; i < facets.length; i++) {
35571
- if (cosineSimilarity(fv, queryVectors[i]) >= NEW_FACT_ATTRIBUTION_MIN_SCORE) {
35634
+ const query = queryVectors[i];
35635
+ const similarity = cosineSimilarity(
35636
+ fv,
35637
+ fv.length < query.length ? query.slice(0, fv.length) : query
35638
+ );
35639
+ if (similarity >= NEW_FACT_ATTRIBUTION_MIN_SCORE) {
35572
35640
  keys.add(facets[i].key);
35573
35641
  matchedAny = true;
35574
35642
  }
@@ -2699,6 +2699,8 @@ interface StoredTopic {
2699
2699
  name: string;
2700
2700
  kind?: string;
2701
2701
  source: TopicSource;
2702
+ /** How central the topic is to the memory, in (0, 1]; read it with {@link topicWeight}. */
2703
+ weight?: number;
2702
2704
  }
2703
2705
 
2704
2706
  /**
@@ -2710,6 +2712,7 @@ interface StoredTopic {
2710
2712
  type EntityInput = string | {
2711
2713
  name: string;
2712
2714
  kind?: EntityKind | (string & {});
2715
+ weight?: number;
2713
2716
  };
2714
2717
  interface EntityOperationsContext {
2715
2718
  database: Database;
@@ -4635,6 +4638,7 @@ interface AutoExtractMessage {
4635
4638
  interface ExtractedEntity {
4636
4639
  name: string;
4637
4640
  kind?: EntityKind;
4641
+ weight?: number;
4638
4642
  }
4639
4643
  interface ExtractedCandidate {
4640
4644
  content: string;
@@ -9762,6 +9766,12 @@ interface ProfileDoc {
9762
9766
  * without another LLM pass. Recomputed every synthesis (not delta-cached).
9763
9767
  */
9764
9768
  observationTrends: Record<ObservationTrend, number>;
9769
+ /**
9770
+ * Sorted ids the store listed but could not decrypt at synthesis time.
9771
+ * Absent when every memory was readable. A later call regenerates only when
9772
+ * this set changes, and attributes a memory once it becomes readable.
9773
+ */
9774
+ unreadableMemoryIds?: string[];
9765
9775
  /** Unix ms this doc was produced. */
9766
9776
  generatedAt: number;
9767
9777
  }
@@ -9815,6 +9825,12 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
9815
9825
  * never accidentally disable the gate by finding it empty.
9816
9826
  */
9817
9827
  reviewedMemoryIds?: readonly string[];
9828
+ /**
9829
+ * Read facts and recall through this store instead of `ctx.vaultCtx` and
9830
+ * `ctx.vaultCache`, so a remote store works. Only `ctx.embeddingOptions` is
9831
+ * then read from `ctx`.
9832
+ */
9833
+ store?: Pick<MemoryStore, "list" | "listProjections" | "factSource">;
9818
9834
  }
9819
9835
  /**
9820
9836
  * Synthesize a shareable {@link ProfileDoc} from the user's vault, on-device.
@@ -2699,6 +2699,8 @@ interface StoredTopic {
2699
2699
  name: string;
2700
2700
  kind?: string;
2701
2701
  source: TopicSource;
2702
+ /** How central the topic is to the memory, in (0, 1]; read it with {@link topicWeight}. */
2703
+ weight?: number;
2702
2704
  }
2703
2705
 
2704
2706
  /**
@@ -2710,6 +2712,7 @@ interface StoredTopic {
2710
2712
  type EntityInput = string | {
2711
2713
  name: string;
2712
2714
  kind?: EntityKind | (string & {});
2715
+ weight?: number;
2713
2716
  };
2714
2717
  interface EntityOperationsContext {
2715
2718
  database: Database;
@@ -4635,6 +4638,7 @@ interface AutoExtractMessage {
4635
4638
  interface ExtractedEntity {
4636
4639
  name: string;
4637
4640
  kind?: EntityKind;
4641
+ weight?: number;
4638
4642
  }
4639
4643
  interface ExtractedCandidate {
4640
4644
  content: string;
@@ -9762,6 +9766,12 @@ interface ProfileDoc {
9762
9766
  * without another LLM pass. Recomputed every synthesis (not delta-cached).
9763
9767
  */
9764
9768
  observationTrends: Record<ObservationTrend, number>;
9769
+ /**
9770
+ * Sorted ids the store listed but could not decrypt at synthesis time.
9771
+ * Absent when every memory was readable. A later call regenerates only when
9772
+ * this set changes, and attributes a memory once it becomes readable.
9773
+ */
9774
+ unreadableMemoryIds?: string[];
9765
9775
  /** Unix ms this doc was produced. */
9766
9776
  generatedAt: number;
9767
9777
  }
@@ -9815,6 +9825,12 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
9815
9825
  * never accidentally disable the gate by finding it empty.
9816
9826
  */
9817
9827
  reviewedMemoryIds?: readonly string[];
9828
+ /**
9829
+ * Read facts and recall through this store instead of `ctx.vaultCtx` and
9830
+ * `ctx.vaultCache`, so a remote store works. Only `ctx.embeddingOptions` is
9831
+ * then read from `ctx`.
9832
+ */
9833
+ store?: Pick<MemoryStore, "list" | "listProjections" | "factSource">;
9818
9834
  }
9819
9835
  /**
9820
9836
  * Synthesize a shareable {@link ProfileDoc} from the user's vault, on-device.