@anuma/sdk 6.24.1 → 6.25.1
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.
- package/dist/expo/{chunk-XDBX4FZY.mjs → chunk-EDABJLYN.mjs} +441 -2
- package/dist/{react/consolidate-XKS6IZFC.mjs → expo/consolidate-5WM3CFKK.mjs} +2 -4
- package/dist/expo/index.cjs +16259 -16469
- package/dist/expo/index.d.mts +106 -18
- package/dist/expo/index.d.ts +106 -18
- package/dist/expo/index.mjs +14022 -5927
- package/dist/index.cjs +88 -46
- package/dist/index.mjs +88 -46
- package/dist/memory/context.d.mts +20 -1
- package/dist/memory/context.d.ts +20 -1
- package/dist/{server/chunk-RKQ4MRS2.mjs → react/chunk-BPMINZPO.mjs} +443 -2
- package/dist/{expo/consolidate-XBYKAFKT.mjs → react/consolidate-A2X3M47N.mjs} +2 -4
- package/dist/react/index.cjs +17892 -18131
- package/dist/react/index.d.mts +113 -18
- package/dist/react/index.d.ts +113 -18
- package/dist/react/index.mjs +11492 -3153
- package/dist/{react/chunk-GPLMMMZN.mjs → server/chunk-DWNEDXA5.mjs} +425 -4
- package/dist/server/{consolidate-54P6QZKU.mjs → consolidate-53I4CTD7.mjs} +2 -4
- package/dist/server/index.cjs +11333 -11520
- package/dist/server/index.d.mts +113 -18
- package/dist/server/index.d.ts +113 -18
- package/dist/server/index.mjs +26288 -4192
- package/dist/telemetry/index.d.mts +4 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/tools/index.cjs +112 -2
- package/dist/tools/index.d.mts +106 -1
- package/dist/tools/index.d.ts +106 -1
- package/dist/tools/index.mjs +110 -2
- package/dist/tools/selection/index.cjs +88 -46
- package/dist/tools/selection/index.mjs +88 -46
- package/package.json +1 -1
- package/dist/expo/chunk-5LKHK5LN.mjs +0 -8142
- package/dist/expo/chunk-WUG6GTHO.mjs +0 -445
- package/dist/expo/recall-4FSY2MC4.mjs +0 -8
- package/dist/react/chunk-DOYXFYB3.mjs +0 -8472
- package/dist/react/chunk-MHZB6KIX.mjs +0 -445
- package/dist/react/recall-6FVSDGWU.mjs +0 -8
- package/dist/server/chunk-FEDRFVHD.mjs +0 -22161
- package/dist/server/chunk-YXL5VKCO.mjs +0 -429
- package/dist/server/recall-Z2WJGXOL.mjs +0 -8
package/dist/expo/index.d.mts
CHANGED
|
@@ -1358,6 +1358,28 @@ interface EmbeddingOptions {
|
|
|
1358
1358
|
* while real PII never reaches the server. Used when PII redaction is active.
|
|
1359
1359
|
*/
|
|
1360
1360
|
maskInput?: (text: string) => string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
|
|
1363
|
+
* attempt that exceeds it is aborted and counts as a transient failure, so the
|
|
1364
|
+
* bounded retry still applies. `0` disables the deadline.
|
|
1365
|
+
*/
|
|
1366
|
+
timeoutMs?: number;
|
|
1367
|
+
/**
|
|
1368
|
+
* Deadline, in ms, for the `getToken()` read that precedes a request (default
|
|
1369
|
+
* 10000). A provider that never settles rejects instead of hanging the
|
|
1370
|
+
* embedding — and the recall waiting on it. `0` disables the deadline.
|
|
1371
|
+
*/
|
|
1372
|
+
tokenTimeoutMs?: number;
|
|
1373
|
+
/**
|
|
1374
|
+
* Overall deadline, in ms, for one `generateEmbedding` call — the token read,
|
|
1375
|
+
* every retry attempt and the backoff between them. Unset (the default) means
|
|
1376
|
+
* only the per-attempt deadlines apply, which is right for background/bulk
|
|
1377
|
+
* embeds. The recall query path sets it (see
|
|
1378
|
+
* `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
|
|
1379
|
+
* BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
|
|
1380
|
+
* `generateEmbeddings`.
|
|
1381
|
+
*/
|
|
1382
|
+
totalTimeoutMs?: number;
|
|
1361
1383
|
}
|
|
1362
1384
|
|
|
1363
1385
|
/**
|
|
@@ -5393,6 +5415,12 @@ interface MemoryVaultSearchOptions {
|
|
|
5393
5415
|
rerankTopN?: number;
|
|
5394
5416
|
/** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
|
|
5395
5417
|
ceWeight?: number;
|
|
5418
|
+
/**
|
|
5419
|
+
* Max ms a rerank waits for the cross-encoder's FIRST model load (default
|
|
5420
|
+
* 10000). On expiry the search degrades to the fused ranking and reports
|
|
5421
|
+
* `reranked: false`; the load continues in the background for later calls.
|
|
5422
|
+
*/
|
|
5423
|
+
rerankLoadTimeoutMs?: number;
|
|
5396
5424
|
/** Recency boost slope applied in the fused ranker. Default 1.0. */
|
|
5397
5425
|
recencyAlpha?: number;
|
|
5398
5426
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -5460,6 +5488,23 @@ interface MemoryVaultSearchOptions {
|
|
|
5460
5488
|
* prefix stays byte-identical.
|
|
5461
5489
|
*/
|
|
5462
5490
|
decryptLast?: boolean;
|
|
5491
|
+
/**
|
|
5492
|
+
* A vector the caller already computed for THIS query, with the model named in
|
|
5493
|
+
* `embeddingOptions`. When set, the search uses it instead of embedding the
|
|
5494
|
+
* query a second time — `recall()` embeds once for its chunk lane and passes
|
|
5495
|
+
* the vector here. An EMPTY array means the caller's embed failed: the search
|
|
5496
|
+
* degrades to BM25 (reported as embeddings unavailable) without re-trying a
|
|
5497
|
+
* provider that just failed.
|
|
5498
|
+
*/
|
|
5499
|
+
queryEmbedding?: number[];
|
|
5500
|
+
/**
|
|
5501
|
+
* Overall deadline, in ms, for embedding the QUERY (token read + all attempts
|
|
5502
|
+
* + backoff). On expiry the search degrades to BM25 and reports embeddings
|
|
5503
|
+
* unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
|
|
5504
|
+
* it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
|
|
5505
|
+
* (re)embeds are never subject to it.
|
|
5506
|
+
*/
|
|
5507
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
5463
5508
|
/** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
|
|
5464
5509
|
admitFactor?: number;
|
|
5465
5510
|
/** Admission window floor for decrypt-last. Default 30. */
|
|
@@ -5476,7 +5521,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
|
|
|
5476
5521
|
* Eagerly embed a single piece of content and store it in the cache.
|
|
5477
5522
|
* Call this when a vault memory is created or updated.
|
|
5478
5523
|
*/
|
|
5479
|
-
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string
|
|
5524
|
+
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
|
|
5525
|
+
/**
|
|
5526
|
+
* `updatedAt` of the committed row this content belongs to. When given, the
|
|
5527
|
+
* cache entry is tied to that row version; without it the entry is
|
|
5528
|
+
* unversioned and a search re-resolves it from the stored column instead of
|
|
5529
|
+
* trusting it (see `vectorVersion.ts`).
|
|
5530
|
+
*/
|
|
5531
|
+
updatedAt?: Date): Promise<void>;
|
|
5480
5532
|
/**
|
|
5481
5533
|
* A single vault search result with its similarity score.
|
|
5482
5534
|
*/
|
|
@@ -5517,21 +5569,6 @@ interface VaultSearchResult {
|
|
|
5517
5569
|
* @returns Sorted results (empty array on invalid input or empty vault)
|
|
5518
5570
|
*/
|
|
5519
5571
|
declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
|
|
5520
|
-
/**
|
|
5521
|
-
* Creates a memory vault search tool for use with chat completions.
|
|
5522
|
-
*
|
|
5523
|
-
* The tool allows the LLM to search through vault memories using semantic
|
|
5524
|
-
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
5525
|
-
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
5526
|
-
* embeddings are computed on the fly as a fallback.
|
|
5527
|
-
*
|
|
5528
|
-
* @param vaultCtx - Vault operations context for database access
|
|
5529
|
-
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
5530
|
-
* @param cache - Pre-populated embedding cache
|
|
5531
|
-
* @param searchOptions - Optional search configuration
|
|
5532
|
-
* @returns A ToolConfig that can be passed to chat completion tools
|
|
5533
|
-
*/
|
|
5534
|
-
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
5535
5572
|
|
|
5536
5573
|
/**
|
|
5537
5574
|
* C2 — Observation trend labels.
|
|
@@ -5754,6 +5791,20 @@ interface RecallOptions {
|
|
|
5754
5791
|
rerankTopN?: number;
|
|
5755
5792
|
/** Multiplicative cross-encoder blend weight. Default: 0.1. */
|
|
5756
5793
|
ceWeight?: number;
|
|
5794
|
+
/**
|
|
5795
|
+
* Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
|
|
5796
|
+
* before degrading to the fused ranking (reported as `rerank-unavailable`).
|
|
5797
|
+
* Default: 10000. The load keeps going in the background for later calls.
|
|
5798
|
+
*/
|
|
5799
|
+
rerankLoadTimeoutMs?: number;
|
|
5800
|
+
/**
|
|
5801
|
+
* Overall deadline, in ms, for embedding the query — token read, every retry
|
|
5802
|
+
* attempt and the backoff between them. Default: 8000. On expiry the fact lane
|
|
5803
|
+
* degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
|
|
5804
|
+
* `embeddings-unavailable`, so an embeddings outage costs a turn at most this
|
|
5805
|
+
* long rather than ~4 x the per-attempt timeout. `0` disables it.
|
|
5806
|
+
*/
|
|
5807
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
5757
5808
|
/** Recency boost slope in the fused ranker. Default: 1.0. */
|
|
5758
5809
|
recencyAlpha?: number;
|
|
5759
5810
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -5781,7 +5832,8 @@ interface RecallOptions {
|
|
|
5781
5832
|
maxHops?: number;
|
|
5782
5833
|
/** Max neighbor entities expanded per hop. Default: 8. */
|
|
5783
5834
|
entityFanout?: number;
|
|
5784
|
-
/** Hard cap on
|
|
5835
|
+
/** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
|
|
5836
|
+
* lane `low`/`mid` run. Default: 64. */
|
|
5785
5837
|
nodeBudget?: number;
|
|
5786
5838
|
/**
|
|
5787
5839
|
* PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
|
|
@@ -6016,6 +6068,10 @@ interface RecallDiagnostics {
|
|
|
6016
6068
|
* fast `vault_size = 0` population never established a baseline for this
|
|
6017
6069
|
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
6018
6070
|
* attributable owner.
|
|
6071
|
+
*
|
|
6072
|
+
* EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
|
|
6073
|
+
* {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
|
|
6074
|
+
* that shared embed and sits inside `prep`, not `factLane`.
|
|
6019
6075
|
*/
|
|
6020
6076
|
queryEmbed: number;
|
|
6021
6077
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
@@ -8747,7 +8803,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
|
|
|
8747
8803
|
declare class RerankerUnavailableError extends Error {
|
|
8748
8804
|
/** The underlying import failure, kept for debugging. */
|
|
8749
8805
|
readonly reason: unknown;
|
|
8750
|
-
constructor(reason: unknown);
|
|
8806
|
+
constructor(reason: unknown, message?: string);
|
|
8751
8807
|
}
|
|
8752
8808
|
/**
|
|
8753
8809
|
* Whether the cross-encoder reranker can run in this environment.
|
|
@@ -9888,6 +9944,38 @@ declare function encodeChunkVector(vector: ArrayLike<number>): string;
|
|
|
9888
9944
|
*/
|
|
9889
9945
|
declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
|
|
9890
9946
|
|
|
9947
|
+
/**
|
|
9948
|
+
* `memory_vault_search` chat tool — the executor half of the vault search.
|
|
9949
|
+
*
|
|
9950
|
+
* Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
|
|
9951
|
+
* cycle: `recall()` statically imports the vault search from `searchTool.ts`,
|
|
9952
|
+
* and this executor routes through `recall()`. While both lived in one module
|
|
9953
|
+
* the executor reached recall through a dynamic `import()`, and the cycle it
|
|
9954
|
+
* papered over is what surfaced as the order-dependent
|
|
9955
|
+
* `Cannot access 'nowMs' before initialization` flake. With the executor here,
|
|
9956
|
+
* the graph is a straight line: executor -> recall -> searchTool.
|
|
9957
|
+
*
|
|
9958
|
+
* `searchTool.ts` must NOT import (or re-export) from this module, or the
|
|
9959
|
+
* cycle comes back. The public name is re-exported from the barrel
|
|
9960
|
+
* (`./index.ts`), which is the path every entry point already uses.
|
|
9961
|
+
*/
|
|
9962
|
+
|
|
9963
|
+
/**
|
|
9964
|
+
* Creates a memory vault search tool for use with chat completions.
|
|
9965
|
+
*
|
|
9966
|
+
* The tool allows the LLM to search through vault memories using semantic
|
|
9967
|
+
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
9968
|
+
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
9969
|
+
* embeddings are computed on the fly as a fallback.
|
|
9970
|
+
*
|
|
9971
|
+
* @param vaultCtx - Vault operations context for database access
|
|
9972
|
+
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
9973
|
+
* @param cache - Pre-populated embedding cache
|
|
9974
|
+
* @param searchOptions - Optional search configuration
|
|
9975
|
+
* @returns A ToolConfig that can be passed to chat completion tools
|
|
9976
|
+
*/
|
|
9977
|
+
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
9978
|
+
|
|
9891
9979
|
/**
|
|
9892
9980
|
* Memory Vault Tool
|
|
9893
9981
|
*
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -1358,6 +1358,28 @@ interface EmbeddingOptions {
|
|
|
1358
1358
|
* while real PII never reaches the server. Used when PII redaction is active.
|
|
1359
1359
|
*/
|
|
1360
1360
|
maskInput?: (text: string) => string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
|
|
1363
|
+
* attempt that exceeds it is aborted and counts as a transient failure, so the
|
|
1364
|
+
* bounded retry still applies. `0` disables the deadline.
|
|
1365
|
+
*/
|
|
1366
|
+
timeoutMs?: number;
|
|
1367
|
+
/**
|
|
1368
|
+
* Deadline, in ms, for the `getToken()` read that precedes a request (default
|
|
1369
|
+
* 10000). A provider that never settles rejects instead of hanging the
|
|
1370
|
+
* embedding — and the recall waiting on it. `0` disables the deadline.
|
|
1371
|
+
*/
|
|
1372
|
+
tokenTimeoutMs?: number;
|
|
1373
|
+
/**
|
|
1374
|
+
* Overall deadline, in ms, for one `generateEmbedding` call — the token read,
|
|
1375
|
+
* every retry attempt and the backoff between them. Unset (the default) means
|
|
1376
|
+
* only the per-attempt deadlines apply, which is right for background/bulk
|
|
1377
|
+
* embeds. The recall query path sets it (see
|
|
1378
|
+
* `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
|
|
1379
|
+
* BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
|
|
1380
|
+
* `generateEmbeddings`.
|
|
1381
|
+
*/
|
|
1382
|
+
totalTimeoutMs?: number;
|
|
1361
1383
|
}
|
|
1362
1384
|
|
|
1363
1385
|
/**
|
|
@@ -5393,6 +5415,12 @@ interface MemoryVaultSearchOptions {
|
|
|
5393
5415
|
rerankTopN?: number;
|
|
5394
5416
|
/** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
|
|
5395
5417
|
ceWeight?: number;
|
|
5418
|
+
/**
|
|
5419
|
+
* Max ms a rerank waits for the cross-encoder's FIRST model load (default
|
|
5420
|
+
* 10000). On expiry the search degrades to the fused ranking and reports
|
|
5421
|
+
* `reranked: false`; the load continues in the background for later calls.
|
|
5422
|
+
*/
|
|
5423
|
+
rerankLoadTimeoutMs?: number;
|
|
5396
5424
|
/** Recency boost slope applied in the fused ranker. Default 1.0. */
|
|
5397
5425
|
recencyAlpha?: number;
|
|
5398
5426
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -5460,6 +5488,23 @@ interface MemoryVaultSearchOptions {
|
|
|
5460
5488
|
* prefix stays byte-identical.
|
|
5461
5489
|
*/
|
|
5462
5490
|
decryptLast?: boolean;
|
|
5491
|
+
/**
|
|
5492
|
+
* A vector the caller already computed for THIS query, with the model named in
|
|
5493
|
+
* `embeddingOptions`. When set, the search uses it instead of embedding the
|
|
5494
|
+
* query a second time — `recall()` embeds once for its chunk lane and passes
|
|
5495
|
+
* the vector here. An EMPTY array means the caller's embed failed: the search
|
|
5496
|
+
* degrades to BM25 (reported as embeddings unavailable) without re-trying a
|
|
5497
|
+
* provider that just failed.
|
|
5498
|
+
*/
|
|
5499
|
+
queryEmbedding?: number[];
|
|
5500
|
+
/**
|
|
5501
|
+
* Overall deadline, in ms, for embedding the QUERY (token read + all attempts
|
|
5502
|
+
* + backoff). On expiry the search degrades to BM25 and reports embeddings
|
|
5503
|
+
* unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
|
|
5504
|
+
* it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
|
|
5505
|
+
* (re)embeds are never subject to it.
|
|
5506
|
+
*/
|
|
5507
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
5463
5508
|
/** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
|
|
5464
5509
|
admitFactor?: number;
|
|
5465
5510
|
/** Admission window floor for decrypt-last. Default 30. */
|
|
@@ -5476,7 +5521,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
|
|
|
5476
5521
|
* Eagerly embed a single piece of content and store it in the cache.
|
|
5477
5522
|
* Call this when a vault memory is created or updated.
|
|
5478
5523
|
*/
|
|
5479
|
-
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string
|
|
5524
|
+
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
|
|
5525
|
+
/**
|
|
5526
|
+
* `updatedAt` of the committed row this content belongs to. When given, the
|
|
5527
|
+
* cache entry is tied to that row version; without it the entry is
|
|
5528
|
+
* unversioned and a search re-resolves it from the stored column instead of
|
|
5529
|
+
* trusting it (see `vectorVersion.ts`).
|
|
5530
|
+
*/
|
|
5531
|
+
updatedAt?: Date): Promise<void>;
|
|
5480
5532
|
/**
|
|
5481
5533
|
* A single vault search result with its similarity score.
|
|
5482
5534
|
*/
|
|
@@ -5517,21 +5569,6 @@ interface VaultSearchResult {
|
|
|
5517
5569
|
* @returns Sorted results (empty array on invalid input or empty vault)
|
|
5518
5570
|
*/
|
|
5519
5571
|
declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
|
|
5520
|
-
/**
|
|
5521
|
-
* Creates a memory vault search tool for use with chat completions.
|
|
5522
|
-
*
|
|
5523
|
-
* The tool allows the LLM to search through vault memories using semantic
|
|
5524
|
-
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
5525
|
-
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
5526
|
-
* embeddings are computed on the fly as a fallback.
|
|
5527
|
-
*
|
|
5528
|
-
* @param vaultCtx - Vault operations context for database access
|
|
5529
|
-
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
5530
|
-
* @param cache - Pre-populated embedding cache
|
|
5531
|
-
* @param searchOptions - Optional search configuration
|
|
5532
|
-
* @returns A ToolConfig that can be passed to chat completion tools
|
|
5533
|
-
*/
|
|
5534
|
-
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
5535
5572
|
|
|
5536
5573
|
/**
|
|
5537
5574
|
* C2 — Observation trend labels.
|
|
@@ -5754,6 +5791,20 @@ interface RecallOptions {
|
|
|
5754
5791
|
rerankTopN?: number;
|
|
5755
5792
|
/** Multiplicative cross-encoder blend weight. Default: 0.1. */
|
|
5756
5793
|
ceWeight?: number;
|
|
5794
|
+
/**
|
|
5795
|
+
* Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
|
|
5796
|
+
* before degrading to the fused ranking (reported as `rerank-unavailable`).
|
|
5797
|
+
* Default: 10000. The load keeps going in the background for later calls.
|
|
5798
|
+
*/
|
|
5799
|
+
rerankLoadTimeoutMs?: number;
|
|
5800
|
+
/**
|
|
5801
|
+
* Overall deadline, in ms, for embedding the query — token read, every retry
|
|
5802
|
+
* attempt and the backoff between them. Default: 8000. On expiry the fact lane
|
|
5803
|
+
* degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
|
|
5804
|
+
* `embeddings-unavailable`, so an embeddings outage costs a turn at most this
|
|
5805
|
+
* long rather than ~4 x the per-attempt timeout. `0` disables it.
|
|
5806
|
+
*/
|
|
5807
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
5757
5808
|
/** Recency boost slope in the fused ranker. Default: 1.0. */
|
|
5758
5809
|
recencyAlpha?: number;
|
|
5759
5810
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -5781,7 +5832,8 @@ interface RecallOptions {
|
|
|
5781
5832
|
maxHops?: number;
|
|
5782
5833
|
/** Max neighbor entities expanded per hop. Default: 8. */
|
|
5783
5834
|
entityFanout?: number;
|
|
5784
|
-
/** Hard cap on
|
|
5835
|
+
/** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
|
|
5836
|
+
* lane `low`/`mid` run. Default: 64. */
|
|
5785
5837
|
nodeBudget?: number;
|
|
5786
5838
|
/**
|
|
5787
5839
|
* PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
|
|
@@ -6016,6 +6068,10 @@ interface RecallDiagnostics {
|
|
|
6016
6068
|
* fast `vault_size = 0` population never established a baseline for this
|
|
6017
6069
|
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
6018
6070
|
* attributable owner.
|
|
6071
|
+
*
|
|
6072
|
+
* EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
|
|
6073
|
+
* {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
|
|
6074
|
+
* that shared embed and sits inside `prep`, not `factLane`.
|
|
6019
6075
|
*/
|
|
6020
6076
|
queryEmbed: number;
|
|
6021
6077
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
@@ -8747,7 +8803,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
|
|
|
8747
8803
|
declare class RerankerUnavailableError extends Error {
|
|
8748
8804
|
/** The underlying import failure, kept for debugging. */
|
|
8749
8805
|
readonly reason: unknown;
|
|
8750
|
-
constructor(reason: unknown);
|
|
8806
|
+
constructor(reason: unknown, message?: string);
|
|
8751
8807
|
}
|
|
8752
8808
|
/**
|
|
8753
8809
|
* Whether the cross-encoder reranker can run in this environment.
|
|
@@ -9888,6 +9944,38 @@ declare function encodeChunkVector(vector: ArrayLike<number>): string;
|
|
|
9888
9944
|
*/
|
|
9889
9945
|
declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
|
|
9890
9946
|
|
|
9947
|
+
/**
|
|
9948
|
+
* `memory_vault_search` chat tool — the executor half of the vault search.
|
|
9949
|
+
*
|
|
9950
|
+
* Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
|
|
9951
|
+
* cycle: `recall()` statically imports the vault search from `searchTool.ts`,
|
|
9952
|
+
* and this executor routes through `recall()`. While both lived in one module
|
|
9953
|
+
* the executor reached recall through a dynamic `import()`, and the cycle it
|
|
9954
|
+
* papered over is what surfaced as the order-dependent
|
|
9955
|
+
* `Cannot access 'nowMs' before initialization` flake. With the executor here,
|
|
9956
|
+
* the graph is a straight line: executor -> recall -> searchTool.
|
|
9957
|
+
*
|
|
9958
|
+
* `searchTool.ts` must NOT import (or re-export) from this module, or the
|
|
9959
|
+
* cycle comes back. The public name is re-exported from the barrel
|
|
9960
|
+
* (`./index.ts`), which is the path every entry point already uses.
|
|
9961
|
+
*/
|
|
9962
|
+
|
|
9963
|
+
/**
|
|
9964
|
+
* Creates a memory vault search tool for use with chat completions.
|
|
9965
|
+
*
|
|
9966
|
+
* The tool allows the LLM to search through vault memories using semantic
|
|
9967
|
+
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
9968
|
+
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
9969
|
+
* embeddings are computed on the fly as a fallback.
|
|
9970
|
+
*
|
|
9971
|
+
* @param vaultCtx - Vault operations context for database access
|
|
9972
|
+
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
9973
|
+
* @param cache - Pre-populated embedding cache
|
|
9974
|
+
* @param searchOptions - Optional search configuration
|
|
9975
|
+
* @returns A ToolConfig that can be passed to chat completion tools
|
|
9976
|
+
*/
|
|
9977
|
+
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
9978
|
+
|
|
9891
9979
|
/**
|
|
9892
9980
|
* Memory Vault Tool
|
|
9893
9981
|
*
|