@anuma/sdk 2.1.0 → 2.2.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.
@@ -4282,6 +4282,9 @@ declare class VaultMemory extends Model {
4282
4282
  /** When true, the user has manually set this memory's topics; auto-extraction
4283
4283
  * leaves its entity links alone. Null on legacy rows (treated as false). */
4284
4284
  topicsUserManaged: boolean | null;
4285
+ /** Unix ms of the last LLM topic-extraction pass. Null = never extracted
4286
+ * standalone (linked legacy rows are grandfathered as extracted). */
4287
+ topicsExtractedAt: number | null;
4285
4288
  createdAt: Date;
4286
4289
  updatedAt: Date;
4287
4290
  isDeleted: boolean;
@@ -4385,6 +4388,10 @@ interface StoredVaultMemory {
4385
4388
  /** When true, the user has manually set this memory's topics (entity links);
4386
4389
  * auto-extraction leaves them alone. False on legacy/auto rows. */
4387
4390
  topicsUserManaged: boolean;
4391
+ /** Unix ms of the last LLM topic-extraction pass over this memory's content.
4392
+ * Null = never extracted standalone; rows that already carry entity links
4393
+ * are grandfathered as extracted (see getMemoriesNeedingTopicExtractionOp). */
4394
+ topicsExtractedAt: number | null;
4388
4395
  createdAt: Date;
4389
4396
  updatedAt: Date;
4390
4397
  isDeleted: boolean;
@@ -4503,6 +4510,62 @@ declare function deleteVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: stri
4503
4510
  * Get all non-deleted, unfiled vault memories (folder_id is null).
4504
4511
  */
4505
4512
  declare function getUnfiledVaultMemoriesOp(ctx: VaultMemoryOperationsContext): Promise<StoredVaultMemory[]>;
4513
+ /**
4514
+ * Result of {@link getMemoriesNeedingTopicExtractionOp}: which memories the
4515
+ * background topic worker should run LLM entity extraction on, and which it
4516
+ * should merely stamp as already-extracted.
4517
+ */
4518
+ interface MemoriesNeedingTopicExtraction {
4519
+ /**
4520
+ * Memories to run LLM topic extraction on (decrypted): never-extracted rows
4521
+ * with no entity links, plus stamped rows edited since their last pass
4522
+ * (`updated_at` > `topics_extracted_at`). Edited rows come first (they get
4523
+ * priority under `limit`), each group newest-created first.
4524
+ */
4525
+ pending: StoredVaultMemory[];
4526
+ /**
4527
+ * IDs of rows that already have entity links but no watermark — legacy rows
4528
+ * extracted by the conversation pipeline before v36. Grandfather these with
4529
+ * {@link stampTopicsExtractedAtOp} (no LLM call) so a later content edit
4530
+ * makes them re-extractable instead of invisible forever. Bounded by the
4531
+ * same `limit` as {@link pending} — stamping loads a Model per row, so the
4532
+ * grandfather backlog is drained across sweeps rather than in one spike.
4533
+ */
4534
+ linkedUnstamped: string[];
4535
+ }
4536
+ /**
4537
+ * Sweep query for the background topic-extraction worker: partition the
4538
+ * user's non-deleted, non-user-managed memories by what the worker should do
4539
+ * with them (see {@link MemoriesNeedingTopicExtraction}). User-managed rows
4540
+ * are never returned — the user owns their topics, including an intentionally
4541
+ * empty set. Requires `ctx.entityCtx` for the entity-links check.
4542
+ */
4543
+ declare function getMemoriesNeedingTopicExtractionOp(ctx: VaultMemoryOperationsContext, options?: {
4544
+ limit?: number;
4545
+ }): Promise<MemoriesNeedingTopicExtraction>;
4546
+ /**
4547
+ * Stamp `topics_extracted_at` on the given memories — the topic worker calls
4548
+ * this after a successful extraction pass (including zero-entity results, so
4549
+ * quiet memories aren't re-asked every sweep) and to grandfather
4550
+ * `linkedUnstamped` rows without an LLM call. Preserves `updated_at` so a
4551
+ * stamp never inflates the recency multiplier — and never masks a concurrent
4552
+ * content edit from the next sweep. Skips deleted, foreign-user, and
4553
+ * user-managed rows. Returns the IDs actually stamped.
4554
+ *
4555
+ * ALL eligibility AND `updated_at` are read from the LIVE Model inside the
4556
+ * serialized writer — never a pre-writer snapshot. Writers are serialized, so
4557
+ * a content edit or topic-override that commits before this writer runs is
4558
+ * observed here: its fresh `updated_at` is preserved (so the next sweep's
4559
+ * `updated_at > stamp` check still fires) and a mid-pass user-managed flip
4560
+ * skips the row. Reading `updated_at` from a raw pre-fetch instead would write
4561
+ * a stale value back, pushing `updated_at < topics_extracted_at` and hiding
4562
+ * the edited memory from every future sweep.
4563
+ *
4564
+ * Callers bound the input via `getMemoriesNeedingTopicExtractionOp`'s `limit`
4565
+ * (both `pending` and `linkedUnstamped` are capped), so the per-row Model load
4566
+ * needed to `prepareUpdate` stays bounded and never spikes the RecordCache.
4567
+ */
4568
+ declare function stampTopicsExtractedAtOp(ctx: VaultMemoryOperationsContext, memoryIds: readonly string[], extractedAt: number): Promise<string[]>;
4506
4569
  declare function deleteAllVaultMemoriesForUserOp(ctx: VaultMemoryOperationsContext, userId: string): Promise<number>;
4507
4570
  declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
4508
4571
 
@@ -5683,6 +5746,112 @@ interface ReflectResult {
5683
5746
  */
5684
5747
  declare function reflect(query: string, ctx: RecallContext, options: ReflectOptions): Promise<ReflectResult>;
5685
5748
 
5749
+ /**
5750
+ * Standalone topic (entity) extraction for EXISTING memories.
5751
+ *
5752
+ * The conversation pipeline (autoExtract.ts) assigns entities only to facts it
5753
+ * extracts from a live transcript — manually created, imported, and edited
5754
+ * memories never get LLM topics and used to fall back to a client-side regex.
5755
+ * This module is the LLM half of "continuously LLM-managed topics": a batched
5756
+ * pass that takes memories already in the vault, asks the extraction model for
5757
+ * their named entities, REPLACES their auto-managed links (guarded — a manual
5758
+ * edit or delete always wins), and stamps `topics_extracted_at` so the sweep
5759
+ * query (`getMemoriesNeedingTopicExtractionOp`) only revisits edited memories.
5760
+ *
5761
+ * Batching: memories are classified ~10 per LLM call (mirroring the folder
5762
+ * Auto-Sort harness) with per-memory content truncation, so a whole-vault
5763
+ * backfill or a bulk import costs ceil(n/10) requests, not n.
5764
+ */
5765
+
5766
+ /** Memories per LLM call. Mirrors the folder Auto-Sort batch size — the cost
5767
+ * lever that makes a whole-vault backfill viable. */
5768
+ declare const TOPIC_EXTRACTION_BATCH_SIZE = 10;
5769
+ /** One memory to extract topics for. `content` must be the DECRYPTED text. */
5770
+ interface TopicExtractionInput {
5771
+ id: string;
5772
+ content: string;
5773
+ }
5774
+ /**
5775
+ * Options for the topic-extraction LLM call. Auth follows the portal dual
5776
+ * pattern — one of `apiKey` / `getToken` is required (see {@link PortalLlmAuth}).
5777
+ */
5778
+ interface TopicExtractOptions extends PortalLlmAuth {
5779
+ baseUrl?: string;
5780
+ /** Defaults to {@link DEFAULT_EXTRACTION_MODEL} — the sanctioned extraction
5781
+ * model. Don't point this at a second model without an eval. */
5782
+ model?: string;
5783
+ /** Override the global fetch implementation (useful for tests). */
5784
+ fetchFn?: typeof fetch;
5785
+ maxAttempts?: number;
5786
+ timeoutMs?: number;
5787
+ totalTimeoutMs?: number;
5788
+ backoffMs?: (attempt: number) => number;
5789
+ /**
5790
+ * The user's existing entity vocabulary (canonical names). Included in the
5791
+ * prompt so independent batches reuse canonical names instead of fragmenting
5792
+ * ("ZetaChain" / "Zetachain" / "zeta chain" as three graph nodes). Truncated
5793
+ * to the first {@link MAX_VOCABULARY_NAMES} names — pass the most-linked
5794
+ * names first.
5795
+ */
5796
+ existingEntityNames?: readonly string[];
5797
+ /**
5798
+ * When set, PII in memory contents is replaced with tagged placeholders
5799
+ * before the LLM call and returned entity names are de-anonymized (entities
5800
+ * whose placeholders can't be restored are dropped) — mirrors
5801
+ * `ExtractFactsOptions.piiRedaction`. Vault contents hold REAL values, so
5802
+ * callers that redact the conversation pipeline must redact this pass too.
5803
+ */
5804
+ piiRedaction?: boolean | PiiRedactor;
5805
+ }
5806
+ /**
5807
+ * Ask the extraction LLM for the named entities of each memory, in batches of
5808
+ * {@link TOPIC_EXTRACTION_BATCH_SIZE}. Pure LLM step — no persistence.
5809
+ *
5810
+ * Returns memoryId → entities. A memory PRESENT with an empty array is a
5811
+ * successful, explicit "no named entities" answer; a memory ABSENT from the
5812
+ * map is UNANSWERED — its batch failed after retries, returned an unusable
5813
+ * shape, or the model omitted its id. Callers must retry absent ids in a
5814
+ * later sweep, never stamp them.
5815
+ */
5816
+ declare function extractEntitiesForMemories(memories: readonly TopicExtractionInput[], options: TopicExtractOptions): Promise<Map<string, ExtractedEntity[]>>;
5817
+ /** Outcome of one {@link extractAndLinkEntitiesForMemoriesOp} run. */
5818
+ interface TopicExtractionRunResult {
5819
+ /** memoryId → entities the LLM returned (post-validation, post-linking). */
5820
+ entitiesByMemory: Map<string, ExtractedEntity[]>;
5821
+ /** Memories stamped `topics_extracted_at` this run — includes zero-entity
5822
+ * results so quiet memories aren't re-asked every sweep. */
5823
+ stampedIds: string[];
5824
+ /** Memories NOT processed: missing/deleted/foreign rows, user-managed rows
5825
+ * (including ones that became user-managed mid-run), and members of failed
5826
+ * LLM batches. Skipped ids are not stamped, so failed batches are retried
5827
+ * by a later sweep — callers should apply their own attempt caps. */
5828
+ skippedIds: string[];
5829
+ }
5830
+ /**
5831
+ * Run LLM topic extraction over existing vault memories and persist the
5832
+ * results: REPLACE each memory's auto-managed entity links with the extracted
5833
+ * set (via {@link replaceMemoryEntitiesGuardedOp} — an edited memory drops the
5834
+ * entities its previous content mentioned) and stamp `topics_extracted_at`.
5835
+ *
5836
+ * User intent is enforced twice: rows already user-managed are skipped up
5837
+ * front, and the replace write re-checks the vault row INSIDE its writer
5838
+ * (user-managed / deleted / absent ⇒ null, and the memory is neither linked
5839
+ * nor stamped) so a manual topic edit or delete landing during the LLM
5840
+ * round-trip wins — a manual edit's own replace semantics also erase anything
5841
+ * this pass linked just before it. The watermark is captured BEFORE contents
5842
+ * are read: an edit landing mid-run keeps `updated_at` > stamp, so the next
5843
+ * sweep re-extracts it rather than trusting this run's stale read.
5844
+ *
5845
+ * Requires `ctx.entityCtx`. Contents are decrypted via the ctx's wallet
5846
+ * fields, exactly like the vault read ops; a memory whose decryption fails is
5847
+ * skipped (retried next sweep), not fatal to the run.
5848
+ */
5849
+ declare function extractAndLinkEntitiesForMemoriesOp(ctx: VaultMemoryOperationsContext, memoryIds: readonly string[], options: TopicExtractOptions & {
5850
+ /** Watermark timestamp (Unix ms) recorded as `topics_extracted_at`.
5851
+ * Defaults to now; tests pass a fixed value. */
5852
+ now?: number;
5853
+ }): Promise<TopicExtractionRunResult>;
5854
+
5686
5855
  /**
5687
5856
  * Text Chunking Utilities
5688
5857
  *
@@ -6345,8 +6514,12 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
6345
6514
  * rows, grandfathered as compatible with the current model)
6346
6515
  * - v35: Added conversation_memory table recording which vault memories a
6347
6516
  * conversation drew on, so the conversation-level Memories panel survives reload
6517
+ * - v36: Added topics_extracted_at column to memory_vault — watermark of the last
6518
+ * LLM topic-extraction pass, so the background topic worker re-extracts only
6519
+ * memories edited since (updated_at > topics_extracted_at) instead of
6520
+ * re-running the whole vault
6348
6521
  */
6349
- declare const SDK_SCHEMA_VERSION = 35;
6522
+ declare const SDK_SCHEMA_VERSION = 36;
6350
6523
  /**
6351
6524
  * Combined WatermelonDB schema for all SDK storage modules.
6352
6525
  *
@@ -6425,6 +6598,7 @@ declare const sdkSchema: Readonly<{
6425
6598
  * - v31 → v32: Added `pinned_at` column to conversations for pinning chats
6426
6599
  * - v32 → v33: Added `embedding_model` column to memory_vault (null grandfathered as current-model-compatible)
6427
6600
  * - v34 → v35: Added `conversation_memory` table (conversation ↔ recalled memory ids)
6601
+ * - v35 → v36: Added `topics_extracted_at` column to memory_vault (watermark for the background topic-extraction worker; null + existing links grandfathered as extracted)
6428
6602
  */
6429
6603
  declare const sdkMigrations: Readonly<{
6430
6604
  validated: true;
@@ -6946,4 +7120,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
6946
7120
  */
6947
7121
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
6948
7122
 
6949
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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 TextChunk, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndRetain, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getLogger, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, streamCancelPath, streamReplayPath, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
7123
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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, TOPIC_EXTRACTION_BATCH_SIZE, 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, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, 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, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
@@ -4282,6 +4282,9 @@ declare class VaultMemory extends Model {
4282
4282
  /** When true, the user has manually set this memory's topics; auto-extraction
4283
4283
  * leaves its entity links alone. Null on legacy rows (treated as false). */
4284
4284
  topicsUserManaged: boolean | null;
4285
+ /** Unix ms of the last LLM topic-extraction pass. Null = never extracted
4286
+ * standalone (linked legacy rows are grandfathered as extracted). */
4287
+ topicsExtractedAt: number | null;
4285
4288
  createdAt: Date;
4286
4289
  updatedAt: Date;
4287
4290
  isDeleted: boolean;
@@ -4385,6 +4388,10 @@ interface StoredVaultMemory {
4385
4388
  /** When true, the user has manually set this memory's topics (entity links);
4386
4389
  * auto-extraction leaves them alone. False on legacy/auto rows. */
4387
4390
  topicsUserManaged: boolean;
4391
+ /** Unix ms of the last LLM topic-extraction pass over this memory's content.
4392
+ * Null = never extracted standalone; rows that already carry entity links
4393
+ * are grandfathered as extracted (see getMemoriesNeedingTopicExtractionOp). */
4394
+ topicsExtractedAt: number | null;
4388
4395
  createdAt: Date;
4389
4396
  updatedAt: Date;
4390
4397
  isDeleted: boolean;
@@ -4503,6 +4510,62 @@ declare function deleteVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: stri
4503
4510
  * Get all non-deleted, unfiled vault memories (folder_id is null).
4504
4511
  */
4505
4512
  declare function getUnfiledVaultMemoriesOp(ctx: VaultMemoryOperationsContext): Promise<StoredVaultMemory[]>;
4513
+ /**
4514
+ * Result of {@link getMemoriesNeedingTopicExtractionOp}: which memories the
4515
+ * background topic worker should run LLM entity extraction on, and which it
4516
+ * should merely stamp as already-extracted.
4517
+ */
4518
+ interface MemoriesNeedingTopicExtraction {
4519
+ /**
4520
+ * Memories to run LLM topic extraction on (decrypted): never-extracted rows
4521
+ * with no entity links, plus stamped rows edited since their last pass
4522
+ * (`updated_at` > `topics_extracted_at`). Edited rows come first (they get
4523
+ * priority under `limit`), each group newest-created first.
4524
+ */
4525
+ pending: StoredVaultMemory[];
4526
+ /**
4527
+ * IDs of rows that already have entity links but no watermark — legacy rows
4528
+ * extracted by the conversation pipeline before v36. Grandfather these with
4529
+ * {@link stampTopicsExtractedAtOp} (no LLM call) so a later content edit
4530
+ * makes them re-extractable instead of invisible forever. Bounded by the
4531
+ * same `limit` as {@link pending} — stamping loads a Model per row, so the
4532
+ * grandfather backlog is drained across sweeps rather than in one spike.
4533
+ */
4534
+ linkedUnstamped: string[];
4535
+ }
4536
+ /**
4537
+ * Sweep query for the background topic-extraction worker: partition the
4538
+ * user's non-deleted, non-user-managed memories by what the worker should do
4539
+ * with them (see {@link MemoriesNeedingTopicExtraction}). User-managed rows
4540
+ * are never returned — the user owns their topics, including an intentionally
4541
+ * empty set. Requires `ctx.entityCtx` for the entity-links check.
4542
+ */
4543
+ declare function getMemoriesNeedingTopicExtractionOp(ctx: VaultMemoryOperationsContext, options?: {
4544
+ limit?: number;
4545
+ }): Promise<MemoriesNeedingTopicExtraction>;
4546
+ /**
4547
+ * Stamp `topics_extracted_at` on the given memories — the topic worker calls
4548
+ * this after a successful extraction pass (including zero-entity results, so
4549
+ * quiet memories aren't re-asked every sweep) and to grandfather
4550
+ * `linkedUnstamped` rows without an LLM call. Preserves `updated_at` so a
4551
+ * stamp never inflates the recency multiplier — and never masks a concurrent
4552
+ * content edit from the next sweep. Skips deleted, foreign-user, and
4553
+ * user-managed rows. Returns the IDs actually stamped.
4554
+ *
4555
+ * ALL eligibility AND `updated_at` are read from the LIVE Model inside the
4556
+ * serialized writer — never a pre-writer snapshot. Writers are serialized, so
4557
+ * a content edit or topic-override that commits before this writer runs is
4558
+ * observed here: its fresh `updated_at` is preserved (so the next sweep's
4559
+ * `updated_at > stamp` check still fires) and a mid-pass user-managed flip
4560
+ * skips the row. Reading `updated_at` from a raw pre-fetch instead would write
4561
+ * a stale value back, pushing `updated_at < topics_extracted_at` and hiding
4562
+ * the edited memory from every future sweep.
4563
+ *
4564
+ * Callers bound the input via `getMemoriesNeedingTopicExtractionOp`'s `limit`
4565
+ * (both `pending` and `linkedUnstamped` are capped), so the per-row Model load
4566
+ * needed to `prepareUpdate` stays bounded and never spikes the RecordCache.
4567
+ */
4568
+ declare function stampTopicsExtractedAtOp(ctx: VaultMemoryOperationsContext, memoryIds: readonly string[], extractedAt: number): Promise<string[]>;
4506
4569
  declare function deleteAllVaultMemoriesForUserOp(ctx: VaultMemoryOperationsContext, userId: string): Promise<number>;
4507
4570
  declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
4508
4571
 
@@ -5683,6 +5746,112 @@ interface ReflectResult {
5683
5746
  */
5684
5747
  declare function reflect(query: string, ctx: RecallContext, options: ReflectOptions): Promise<ReflectResult>;
5685
5748
 
5749
+ /**
5750
+ * Standalone topic (entity) extraction for EXISTING memories.
5751
+ *
5752
+ * The conversation pipeline (autoExtract.ts) assigns entities only to facts it
5753
+ * extracts from a live transcript — manually created, imported, and edited
5754
+ * memories never get LLM topics and used to fall back to a client-side regex.
5755
+ * This module is the LLM half of "continuously LLM-managed topics": a batched
5756
+ * pass that takes memories already in the vault, asks the extraction model for
5757
+ * their named entities, REPLACES their auto-managed links (guarded — a manual
5758
+ * edit or delete always wins), and stamps `topics_extracted_at` so the sweep
5759
+ * query (`getMemoriesNeedingTopicExtractionOp`) only revisits edited memories.
5760
+ *
5761
+ * Batching: memories are classified ~10 per LLM call (mirroring the folder
5762
+ * Auto-Sort harness) with per-memory content truncation, so a whole-vault
5763
+ * backfill or a bulk import costs ceil(n/10) requests, not n.
5764
+ */
5765
+
5766
+ /** Memories per LLM call. Mirrors the folder Auto-Sort batch size — the cost
5767
+ * lever that makes a whole-vault backfill viable. */
5768
+ declare const TOPIC_EXTRACTION_BATCH_SIZE = 10;
5769
+ /** One memory to extract topics for. `content` must be the DECRYPTED text. */
5770
+ interface TopicExtractionInput {
5771
+ id: string;
5772
+ content: string;
5773
+ }
5774
+ /**
5775
+ * Options for the topic-extraction LLM call. Auth follows the portal dual
5776
+ * pattern — one of `apiKey` / `getToken` is required (see {@link PortalLlmAuth}).
5777
+ */
5778
+ interface TopicExtractOptions extends PortalLlmAuth {
5779
+ baseUrl?: string;
5780
+ /** Defaults to {@link DEFAULT_EXTRACTION_MODEL} — the sanctioned extraction
5781
+ * model. Don't point this at a second model without an eval. */
5782
+ model?: string;
5783
+ /** Override the global fetch implementation (useful for tests). */
5784
+ fetchFn?: typeof fetch;
5785
+ maxAttempts?: number;
5786
+ timeoutMs?: number;
5787
+ totalTimeoutMs?: number;
5788
+ backoffMs?: (attempt: number) => number;
5789
+ /**
5790
+ * The user's existing entity vocabulary (canonical names). Included in the
5791
+ * prompt so independent batches reuse canonical names instead of fragmenting
5792
+ * ("ZetaChain" / "Zetachain" / "zeta chain" as three graph nodes). Truncated
5793
+ * to the first {@link MAX_VOCABULARY_NAMES} names — pass the most-linked
5794
+ * names first.
5795
+ */
5796
+ existingEntityNames?: readonly string[];
5797
+ /**
5798
+ * When set, PII in memory contents is replaced with tagged placeholders
5799
+ * before the LLM call and returned entity names are de-anonymized (entities
5800
+ * whose placeholders can't be restored are dropped) — mirrors
5801
+ * `ExtractFactsOptions.piiRedaction`. Vault contents hold REAL values, so
5802
+ * callers that redact the conversation pipeline must redact this pass too.
5803
+ */
5804
+ piiRedaction?: boolean | PiiRedactor;
5805
+ }
5806
+ /**
5807
+ * Ask the extraction LLM for the named entities of each memory, in batches of
5808
+ * {@link TOPIC_EXTRACTION_BATCH_SIZE}. Pure LLM step — no persistence.
5809
+ *
5810
+ * Returns memoryId → entities. A memory PRESENT with an empty array is a
5811
+ * successful, explicit "no named entities" answer; a memory ABSENT from the
5812
+ * map is UNANSWERED — its batch failed after retries, returned an unusable
5813
+ * shape, or the model omitted its id. Callers must retry absent ids in a
5814
+ * later sweep, never stamp them.
5815
+ */
5816
+ declare function extractEntitiesForMemories(memories: readonly TopicExtractionInput[], options: TopicExtractOptions): Promise<Map<string, ExtractedEntity[]>>;
5817
+ /** Outcome of one {@link extractAndLinkEntitiesForMemoriesOp} run. */
5818
+ interface TopicExtractionRunResult {
5819
+ /** memoryId → entities the LLM returned (post-validation, post-linking). */
5820
+ entitiesByMemory: Map<string, ExtractedEntity[]>;
5821
+ /** Memories stamped `topics_extracted_at` this run — includes zero-entity
5822
+ * results so quiet memories aren't re-asked every sweep. */
5823
+ stampedIds: string[];
5824
+ /** Memories NOT processed: missing/deleted/foreign rows, user-managed rows
5825
+ * (including ones that became user-managed mid-run), and members of failed
5826
+ * LLM batches. Skipped ids are not stamped, so failed batches are retried
5827
+ * by a later sweep — callers should apply their own attempt caps. */
5828
+ skippedIds: string[];
5829
+ }
5830
+ /**
5831
+ * Run LLM topic extraction over existing vault memories and persist the
5832
+ * results: REPLACE each memory's auto-managed entity links with the extracted
5833
+ * set (via {@link replaceMemoryEntitiesGuardedOp} — an edited memory drops the
5834
+ * entities its previous content mentioned) and stamp `topics_extracted_at`.
5835
+ *
5836
+ * User intent is enforced twice: rows already user-managed are skipped up
5837
+ * front, and the replace write re-checks the vault row INSIDE its writer
5838
+ * (user-managed / deleted / absent ⇒ null, and the memory is neither linked
5839
+ * nor stamped) so a manual topic edit or delete landing during the LLM
5840
+ * round-trip wins — a manual edit's own replace semantics also erase anything
5841
+ * this pass linked just before it. The watermark is captured BEFORE contents
5842
+ * are read: an edit landing mid-run keeps `updated_at` > stamp, so the next
5843
+ * sweep re-extracts it rather than trusting this run's stale read.
5844
+ *
5845
+ * Requires `ctx.entityCtx`. Contents are decrypted via the ctx's wallet
5846
+ * fields, exactly like the vault read ops; a memory whose decryption fails is
5847
+ * skipped (retried next sweep), not fatal to the run.
5848
+ */
5849
+ declare function extractAndLinkEntitiesForMemoriesOp(ctx: VaultMemoryOperationsContext, memoryIds: readonly string[], options: TopicExtractOptions & {
5850
+ /** Watermark timestamp (Unix ms) recorded as `topics_extracted_at`.
5851
+ * Defaults to now; tests pass a fixed value. */
5852
+ now?: number;
5853
+ }): Promise<TopicExtractionRunResult>;
5854
+
5686
5855
  /**
5687
5856
  * Text Chunking Utilities
5688
5857
  *
@@ -6345,8 +6514,12 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
6345
6514
  * rows, grandfathered as compatible with the current model)
6346
6515
  * - v35: Added conversation_memory table recording which vault memories a
6347
6516
  * conversation drew on, so the conversation-level Memories panel survives reload
6517
+ * - v36: Added topics_extracted_at column to memory_vault — watermark of the last
6518
+ * LLM topic-extraction pass, so the background topic worker re-extracts only
6519
+ * memories edited since (updated_at > topics_extracted_at) instead of
6520
+ * re-running the whole vault
6348
6521
  */
6349
- declare const SDK_SCHEMA_VERSION = 35;
6522
+ declare const SDK_SCHEMA_VERSION = 36;
6350
6523
  /**
6351
6524
  * Combined WatermelonDB schema for all SDK storage modules.
6352
6525
  *
@@ -6425,6 +6598,7 @@ declare const sdkSchema: Readonly<{
6425
6598
  * - v31 → v32: Added `pinned_at` column to conversations for pinning chats
6426
6599
  * - v32 → v33: Added `embedding_model` column to memory_vault (null grandfathered as current-model-compatible)
6427
6600
  * - v34 → v35: Added `conversation_memory` table (conversation ↔ recalled memory ids)
6601
+ * - v35 → v36: Added `topics_extracted_at` column to memory_vault (watermark for the background topic-extraction worker; null + existing links grandfathered as extracted)
6428
6602
  */
6429
6603
  declare const sdkMigrations: Readonly<{
6430
6604
  validated: true;
@@ -6946,4 +7120,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
6946
7120
  */
6947
7121
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
6948
7122
 
6949
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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 TextChunk, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndRetain, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getLogger, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, streamCancelPath, streamReplayPath, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
7123
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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, TOPIC_EXTRACTION_BATCH_SIZE, 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, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, 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, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };