@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/react/index.d.mts
CHANGED
|
@@ -2860,6 +2860,28 @@ interface EmbeddingOptions {
|
|
|
2860
2860
|
* while real PII never reaches the server. Used when PII redaction is active.
|
|
2861
2861
|
*/
|
|
2862
2862
|
maskInput?: (text: string) => string;
|
|
2863
|
+
/**
|
|
2864
|
+
* Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
|
|
2865
|
+
* attempt that exceeds it is aborted and counts as a transient failure, so the
|
|
2866
|
+
* bounded retry still applies. `0` disables the deadline.
|
|
2867
|
+
*/
|
|
2868
|
+
timeoutMs?: number;
|
|
2869
|
+
/**
|
|
2870
|
+
* Deadline, in ms, for the `getToken()` read that precedes a request (default
|
|
2871
|
+
* 10000). A provider that never settles rejects instead of hanging the
|
|
2872
|
+
* embedding — and the recall waiting on it. `0` disables the deadline.
|
|
2873
|
+
*/
|
|
2874
|
+
tokenTimeoutMs?: number;
|
|
2875
|
+
/**
|
|
2876
|
+
* Overall deadline, in ms, for one `generateEmbedding` call — the token read,
|
|
2877
|
+
* every retry attempt and the backoff between them. Unset (the default) means
|
|
2878
|
+
* only the per-attempt deadlines apply, which is right for background/bulk
|
|
2879
|
+
* embeds. The recall query path sets it (see
|
|
2880
|
+
* `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
|
|
2881
|
+
* BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
|
|
2882
|
+
* `generateEmbeddings`.
|
|
2883
|
+
*/
|
|
2884
|
+
totalTimeoutMs?: number;
|
|
2863
2885
|
}
|
|
2864
2886
|
|
|
2865
2887
|
/**
|
|
@@ -5891,6 +5913,13 @@ declare function searchChunksOp(ctx: StorageOperationsContext, queryVector: numb
|
|
|
5891
5913
|
limit?: number;
|
|
5892
5914
|
minSimilarity?: number;
|
|
5893
5915
|
conversationId?: string;
|
|
5916
|
+
/**
|
|
5917
|
+
* Skip every message in this conversation BEFORE scoring, so it can't take
|
|
5918
|
+
* top-K slots. Filtering after the cut (what recall() used to do) lets a
|
|
5919
|
+
* long current conversation fill all `limit` slots and leaves
|
|
5920
|
+
* past-conversation recall with nothing.
|
|
5921
|
+
*/
|
|
5922
|
+
excludeConversationId?: string;
|
|
5894
5923
|
/**
|
|
5895
5924
|
* Current embedding model. When set, messages whose stored
|
|
5896
5925
|
* `embedding_model` is non-null and differs are skipped — their vectors
|
|
@@ -6662,6 +6691,12 @@ interface MemoryVaultSearchOptions {
|
|
|
6662
6691
|
rerankTopN?: number;
|
|
6663
6692
|
/** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
|
|
6664
6693
|
ceWeight?: number;
|
|
6694
|
+
/**
|
|
6695
|
+
* Max ms a rerank waits for the cross-encoder's FIRST model load (default
|
|
6696
|
+
* 10000). On expiry the search degrades to the fused ranking and reports
|
|
6697
|
+
* `reranked: false`; the load continues in the background for later calls.
|
|
6698
|
+
*/
|
|
6699
|
+
rerankLoadTimeoutMs?: number;
|
|
6665
6700
|
/** Recency boost slope applied in the fused ranker. Default 1.0. */
|
|
6666
6701
|
recencyAlpha?: number;
|
|
6667
6702
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -6729,6 +6764,23 @@ interface MemoryVaultSearchOptions {
|
|
|
6729
6764
|
* prefix stays byte-identical.
|
|
6730
6765
|
*/
|
|
6731
6766
|
decryptLast?: boolean;
|
|
6767
|
+
/**
|
|
6768
|
+
* A vector the caller already computed for THIS query, with the model named in
|
|
6769
|
+
* `embeddingOptions`. When set, the search uses it instead of embedding the
|
|
6770
|
+
* query a second time — `recall()` embeds once for its chunk lane and passes
|
|
6771
|
+
* the vector here. An EMPTY array means the caller's embed failed: the search
|
|
6772
|
+
* degrades to BM25 (reported as embeddings unavailable) without re-trying a
|
|
6773
|
+
* provider that just failed.
|
|
6774
|
+
*/
|
|
6775
|
+
queryEmbedding?: number[];
|
|
6776
|
+
/**
|
|
6777
|
+
* Overall deadline, in ms, for embedding the QUERY (token read + all attempts
|
|
6778
|
+
* + backoff). On expiry the search degrades to BM25 and reports embeddings
|
|
6779
|
+
* unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
|
|
6780
|
+
* it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
|
|
6781
|
+
* (re)embeds are never subject to it.
|
|
6782
|
+
*/
|
|
6783
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
6732
6784
|
/** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
|
|
6733
6785
|
admitFactor?: number;
|
|
6734
6786
|
/** Admission window floor for decrypt-last. Default 30. */
|
|
@@ -6745,7 +6797,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
|
|
|
6745
6797
|
* Eagerly embed a single piece of content and store it in the cache.
|
|
6746
6798
|
* Call this when a vault memory is created or updated.
|
|
6747
6799
|
*/
|
|
6748
|
-
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string
|
|
6800
|
+
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
|
|
6801
|
+
/**
|
|
6802
|
+
* `updatedAt` of the committed row this content belongs to. When given, the
|
|
6803
|
+
* cache entry is tied to that row version; without it the entry is
|
|
6804
|
+
* unversioned and a search re-resolves it from the stored column instead of
|
|
6805
|
+
* trusting it (see `vectorVersion.ts`).
|
|
6806
|
+
*/
|
|
6807
|
+
updatedAt?: Date): Promise<void>;
|
|
6749
6808
|
/**
|
|
6750
6809
|
* A single vault search result with its similarity score.
|
|
6751
6810
|
*/
|
|
@@ -6786,21 +6845,6 @@ interface VaultSearchResult {
|
|
|
6786
6845
|
* @returns Sorted results (empty array on invalid input or empty vault)
|
|
6787
6846
|
*/
|
|
6788
6847
|
declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
|
|
6789
|
-
/**
|
|
6790
|
-
* Creates a memory vault search tool for use with chat completions.
|
|
6791
|
-
*
|
|
6792
|
-
* The tool allows the LLM to search through vault memories using semantic
|
|
6793
|
-
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
6794
|
-
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
6795
|
-
* embeddings are computed on the fly as a fallback.
|
|
6796
|
-
*
|
|
6797
|
-
* @param vaultCtx - Vault operations context for database access
|
|
6798
|
-
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
6799
|
-
* @param cache - Pre-populated embedding cache
|
|
6800
|
-
* @param searchOptions - Optional search configuration
|
|
6801
|
-
* @returns A ToolConfig that can be passed to chat completion tools
|
|
6802
|
-
*/
|
|
6803
|
-
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
6804
6848
|
|
|
6805
6849
|
/**
|
|
6806
6850
|
* C2 — Observation trend labels.
|
|
@@ -7023,6 +7067,20 @@ interface RecallOptions {
|
|
|
7023
7067
|
rerankTopN?: number;
|
|
7024
7068
|
/** Multiplicative cross-encoder blend weight. Default: 0.1. */
|
|
7025
7069
|
ceWeight?: number;
|
|
7070
|
+
/**
|
|
7071
|
+
* Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
|
|
7072
|
+
* before degrading to the fused ranking (reported as `rerank-unavailable`).
|
|
7073
|
+
* Default: 10000. The load keeps going in the background for later calls.
|
|
7074
|
+
*/
|
|
7075
|
+
rerankLoadTimeoutMs?: number;
|
|
7076
|
+
/**
|
|
7077
|
+
* Overall deadline, in ms, for embedding the query — token read, every retry
|
|
7078
|
+
* attempt and the backoff between them. Default: 8000. On expiry the fact lane
|
|
7079
|
+
* degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
|
|
7080
|
+
* `embeddings-unavailable`, so an embeddings outage costs a turn at most this
|
|
7081
|
+
* long rather than ~4 x the per-attempt timeout. `0` disables it.
|
|
7082
|
+
*/
|
|
7083
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
7026
7084
|
/** Recency boost slope in the fused ranker. Default: 1.0. */
|
|
7027
7085
|
recencyAlpha?: number;
|
|
7028
7086
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -7050,7 +7108,8 @@ interface RecallOptions {
|
|
|
7050
7108
|
maxHops?: number;
|
|
7051
7109
|
/** Max neighbor entities expanded per hop. Default: 8. */
|
|
7052
7110
|
entityFanout?: number;
|
|
7053
|
-
/** Hard cap on
|
|
7111
|
+
/** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
|
|
7112
|
+
* lane `low`/`mid` run. Default: 64. */
|
|
7054
7113
|
nodeBudget?: number;
|
|
7055
7114
|
/**
|
|
7056
7115
|
* PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
|
|
@@ -7285,6 +7344,10 @@ interface RecallDiagnostics {
|
|
|
7285
7344
|
* fast `vault_size = 0` population never established a baseline for this
|
|
7286
7345
|
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
7287
7346
|
* attributable owner.
|
|
7347
|
+
*
|
|
7348
|
+
* EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
|
|
7349
|
+
* {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
|
|
7350
|
+
* that shared embed and sits inside `prep`, not `factLane`.
|
|
7288
7351
|
*/
|
|
7289
7352
|
queryEmbed: number;
|
|
7290
7353
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
@@ -9982,7 +10045,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
|
|
|
9982
10045
|
declare class RerankerUnavailableError extends Error {
|
|
9983
10046
|
/** The underlying import failure, kept for debugging. */
|
|
9984
10047
|
readonly reason: unknown;
|
|
9985
|
-
constructor(reason: unknown);
|
|
10048
|
+
constructor(reason: unknown, message?: string);
|
|
9986
10049
|
}
|
|
9987
10050
|
/**
|
|
9988
10051
|
* Whether the cross-encoder reranker can run in this environment.
|
|
@@ -11123,6 +11186,38 @@ declare function encodeChunkVector(vector: ArrayLike<number>): string;
|
|
|
11123
11186
|
*/
|
|
11124
11187
|
declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
|
|
11125
11188
|
|
|
11189
|
+
/**
|
|
11190
|
+
* `memory_vault_search` chat tool — the executor half of the vault search.
|
|
11191
|
+
*
|
|
11192
|
+
* Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
|
|
11193
|
+
* cycle: `recall()` statically imports the vault search from `searchTool.ts`,
|
|
11194
|
+
* and this executor routes through `recall()`. While both lived in one module
|
|
11195
|
+
* the executor reached recall through a dynamic `import()`, and the cycle it
|
|
11196
|
+
* papered over is what surfaced as the order-dependent
|
|
11197
|
+
* `Cannot access 'nowMs' before initialization` flake. With the executor here,
|
|
11198
|
+
* the graph is a straight line: executor -> recall -> searchTool.
|
|
11199
|
+
*
|
|
11200
|
+
* `searchTool.ts` must NOT import (or re-export) from this module, or the
|
|
11201
|
+
* cycle comes back. The public name is re-exported from the barrel
|
|
11202
|
+
* (`./index.ts`), which is the path every entry point already uses.
|
|
11203
|
+
*/
|
|
11204
|
+
|
|
11205
|
+
/**
|
|
11206
|
+
* Creates a memory vault search tool for use with chat completions.
|
|
11207
|
+
*
|
|
11208
|
+
* The tool allows the LLM to search through vault memories using semantic
|
|
11209
|
+
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
11210
|
+
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
11211
|
+
* embeddings are computed on the fly as a fallback.
|
|
11212
|
+
*
|
|
11213
|
+
* @param vaultCtx - Vault operations context for database access
|
|
11214
|
+
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
11215
|
+
* @param cache - Pre-populated embedding cache
|
|
11216
|
+
* @param searchOptions - Optional search configuration
|
|
11217
|
+
* @returns A ToolConfig that can be passed to chat completion tools
|
|
11218
|
+
*/
|
|
11219
|
+
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
11220
|
+
|
|
11126
11221
|
/**
|
|
11127
11222
|
* Memory Vault Tool
|
|
11128
11223
|
*
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2860,6 +2860,28 @@ interface EmbeddingOptions {
|
|
|
2860
2860
|
* while real PII never reaches the server. Used when PII redaction is active.
|
|
2861
2861
|
*/
|
|
2862
2862
|
maskInput?: (text: string) => string;
|
|
2863
|
+
/**
|
|
2864
|
+
* Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
|
|
2865
|
+
* attempt that exceeds it is aborted and counts as a transient failure, so the
|
|
2866
|
+
* bounded retry still applies. `0` disables the deadline.
|
|
2867
|
+
*/
|
|
2868
|
+
timeoutMs?: number;
|
|
2869
|
+
/**
|
|
2870
|
+
* Deadline, in ms, for the `getToken()` read that precedes a request (default
|
|
2871
|
+
* 10000). A provider that never settles rejects instead of hanging the
|
|
2872
|
+
* embedding — and the recall waiting on it. `0` disables the deadline.
|
|
2873
|
+
*/
|
|
2874
|
+
tokenTimeoutMs?: number;
|
|
2875
|
+
/**
|
|
2876
|
+
* Overall deadline, in ms, for one `generateEmbedding` call — the token read,
|
|
2877
|
+
* every retry attempt and the backoff between them. Unset (the default) means
|
|
2878
|
+
* only the per-attempt deadlines apply, which is right for background/bulk
|
|
2879
|
+
* embeds. The recall query path sets it (see
|
|
2880
|
+
* `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
|
|
2881
|
+
* BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
|
|
2882
|
+
* `generateEmbeddings`.
|
|
2883
|
+
*/
|
|
2884
|
+
totalTimeoutMs?: number;
|
|
2863
2885
|
}
|
|
2864
2886
|
|
|
2865
2887
|
/**
|
|
@@ -5891,6 +5913,13 @@ declare function searchChunksOp(ctx: StorageOperationsContext, queryVector: numb
|
|
|
5891
5913
|
limit?: number;
|
|
5892
5914
|
minSimilarity?: number;
|
|
5893
5915
|
conversationId?: string;
|
|
5916
|
+
/**
|
|
5917
|
+
* Skip every message in this conversation BEFORE scoring, so it can't take
|
|
5918
|
+
* top-K slots. Filtering after the cut (what recall() used to do) lets a
|
|
5919
|
+
* long current conversation fill all `limit` slots and leaves
|
|
5920
|
+
* past-conversation recall with nothing.
|
|
5921
|
+
*/
|
|
5922
|
+
excludeConversationId?: string;
|
|
5894
5923
|
/**
|
|
5895
5924
|
* Current embedding model. When set, messages whose stored
|
|
5896
5925
|
* `embedding_model` is non-null and differs are skipped — their vectors
|
|
@@ -6662,6 +6691,12 @@ interface MemoryVaultSearchOptions {
|
|
|
6662
6691
|
rerankTopN?: number;
|
|
6663
6692
|
/** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
|
|
6664
6693
|
ceWeight?: number;
|
|
6694
|
+
/**
|
|
6695
|
+
* Max ms a rerank waits for the cross-encoder's FIRST model load (default
|
|
6696
|
+
* 10000). On expiry the search degrades to the fused ranking and reports
|
|
6697
|
+
* `reranked: false`; the load continues in the background for later calls.
|
|
6698
|
+
*/
|
|
6699
|
+
rerankLoadTimeoutMs?: number;
|
|
6665
6700
|
/** Recency boost slope applied in the fused ranker. Default 1.0. */
|
|
6666
6701
|
recencyAlpha?: number;
|
|
6667
6702
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -6729,6 +6764,23 @@ interface MemoryVaultSearchOptions {
|
|
|
6729
6764
|
* prefix stays byte-identical.
|
|
6730
6765
|
*/
|
|
6731
6766
|
decryptLast?: boolean;
|
|
6767
|
+
/**
|
|
6768
|
+
* A vector the caller already computed for THIS query, with the model named in
|
|
6769
|
+
* `embeddingOptions`. When set, the search uses it instead of embedding the
|
|
6770
|
+
* query a second time — `recall()` embeds once for its chunk lane and passes
|
|
6771
|
+
* the vector here. An EMPTY array means the caller's embed failed: the search
|
|
6772
|
+
* degrades to BM25 (reported as embeddings unavailable) without re-trying a
|
|
6773
|
+
* provider that just failed.
|
|
6774
|
+
*/
|
|
6775
|
+
queryEmbedding?: number[];
|
|
6776
|
+
/**
|
|
6777
|
+
* Overall deadline, in ms, for embedding the QUERY (token read + all attempts
|
|
6778
|
+
* + backoff). On expiry the search degrades to BM25 and reports embeddings
|
|
6779
|
+
* unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
|
|
6780
|
+
* it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
|
|
6781
|
+
* (re)embeds are never subject to it.
|
|
6782
|
+
*/
|
|
6783
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
6732
6784
|
/** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
|
|
6733
6785
|
admitFactor?: number;
|
|
6734
6786
|
/** Admission window floor for decrypt-last. Default 30. */
|
|
@@ -6745,7 +6797,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
|
|
|
6745
6797
|
* Eagerly embed a single piece of content and store it in the cache.
|
|
6746
6798
|
* Call this when a vault memory is created or updated.
|
|
6747
6799
|
*/
|
|
6748
|
-
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string
|
|
6800
|
+
declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
|
|
6801
|
+
/**
|
|
6802
|
+
* `updatedAt` of the committed row this content belongs to. When given, the
|
|
6803
|
+
* cache entry is tied to that row version; without it the entry is
|
|
6804
|
+
* unversioned and a search re-resolves it from the stored column instead of
|
|
6805
|
+
* trusting it (see `vectorVersion.ts`).
|
|
6806
|
+
*/
|
|
6807
|
+
updatedAt?: Date): Promise<void>;
|
|
6749
6808
|
/**
|
|
6750
6809
|
* A single vault search result with its similarity score.
|
|
6751
6810
|
*/
|
|
@@ -6786,21 +6845,6 @@ interface VaultSearchResult {
|
|
|
6786
6845
|
* @returns Sorted results (empty array on invalid input or empty vault)
|
|
6787
6846
|
*/
|
|
6788
6847
|
declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
|
|
6789
|
-
/**
|
|
6790
|
-
* Creates a memory vault search tool for use with chat completions.
|
|
6791
|
-
*
|
|
6792
|
-
* The tool allows the LLM to search through vault memories using semantic
|
|
6793
|
-
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
6794
|
-
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
6795
|
-
* embeddings are computed on the fly as a fallback.
|
|
6796
|
-
*
|
|
6797
|
-
* @param vaultCtx - Vault operations context for database access
|
|
6798
|
-
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
6799
|
-
* @param cache - Pre-populated embedding cache
|
|
6800
|
-
* @param searchOptions - Optional search configuration
|
|
6801
|
-
* @returns A ToolConfig that can be passed to chat completion tools
|
|
6802
|
-
*/
|
|
6803
|
-
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
6804
6848
|
|
|
6805
6849
|
/**
|
|
6806
6850
|
* C2 — Observation trend labels.
|
|
@@ -7023,6 +7067,20 @@ interface RecallOptions {
|
|
|
7023
7067
|
rerankTopN?: number;
|
|
7024
7068
|
/** Multiplicative cross-encoder blend weight. Default: 0.1. */
|
|
7025
7069
|
ceWeight?: number;
|
|
7070
|
+
/**
|
|
7071
|
+
* Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
|
|
7072
|
+
* before degrading to the fused ranking (reported as `rerank-unavailable`).
|
|
7073
|
+
* Default: 10000. The load keeps going in the background for later calls.
|
|
7074
|
+
*/
|
|
7075
|
+
rerankLoadTimeoutMs?: number;
|
|
7076
|
+
/**
|
|
7077
|
+
* Overall deadline, in ms, for embedding the query — token read, every retry
|
|
7078
|
+
* attempt and the backoff between them. Default: 8000. On expiry the fact lane
|
|
7079
|
+
* degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
|
|
7080
|
+
* `embeddings-unavailable`, so an embeddings outage costs a turn at most this
|
|
7081
|
+
* long rather than ~4 x the per-attempt timeout. `0` disables it.
|
|
7082
|
+
*/
|
|
7083
|
+
queryEmbedTotalTimeoutMs?: number;
|
|
7026
7084
|
/** Recency boost slope in the fused ranker. Default: 1.0. */
|
|
7027
7085
|
recencyAlpha?: number;
|
|
7028
7086
|
/** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
|
|
@@ -7050,7 +7108,8 @@ interface RecallOptions {
|
|
|
7050
7108
|
maxHops?: number;
|
|
7051
7109
|
/** Max neighbor entities expanded per hop. Default: 8. */
|
|
7052
7110
|
entityFanout?: number;
|
|
7053
|
-
/** Hard cap on
|
|
7111
|
+
/** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
|
|
7112
|
+
* lane `low`/`mid` run. Default: 64. */
|
|
7054
7113
|
nodeBudget?: number;
|
|
7055
7114
|
/**
|
|
7056
7115
|
* PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
|
|
@@ -7285,6 +7344,10 @@ interface RecallDiagnostics {
|
|
|
7285
7344
|
* fast `vault_size = 0` population never established a baseline for this
|
|
7286
7345
|
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
7287
7346
|
* attributable owner.
|
|
7347
|
+
*
|
|
7348
|
+
* EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
|
|
7349
|
+
* {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
|
|
7350
|
+
* that shared embed and sits inside `prep`, not `factLane`.
|
|
7288
7351
|
*/
|
|
7289
7352
|
queryEmbed: number;
|
|
7290
7353
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
@@ -9982,7 +10045,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
|
|
|
9982
10045
|
declare class RerankerUnavailableError extends Error {
|
|
9983
10046
|
/** The underlying import failure, kept for debugging. */
|
|
9984
10047
|
readonly reason: unknown;
|
|
9985
|
-
constructor(reason: unknown);
|
|
10048
|
+
constructor(reason: unknown, message?: string);
|
|
9986
10049
|
}
|
|
9987
10050
|
/**
|
|
9988
10051
|
* Whether the cross-encoder reranker can run in this environment.
|
|
@@ -11123,6 +11186,38 @@ declare function encodeChunkVector(vector: ArrayLike<number>): string;
|
|
|
11123
11186
|
*/
|
|
11124
11187
|
declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
|
|
11125
11188
|
|
|
11189
|
+
/**
|
|
11190
|
+
* `memory_vault_search` chat tool — the executor half of the vault search.
|
|
11191
|
+
*
|
|
11192
|
+
* Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
|
|
11193
|
+
* cycle: `recall()` statically imports the vault search from `searchTool.ts`,
|
|
11194
|
+
* and this executor routes through `recall()`. While both lived in one module
|
|
11195
|
+
* the executor reached recall through a dynamic `import()`, and the cycle it
|
|
11196
|
+
* papered over is what surfaced as the order-dependent
|
|
11197
|
+
* `Cannot access 'nowMs' before initialization` flake. With the executor here,
|
|
11198
|
+
* the graph is a straight line: executor -> recall -> searchTool.
|
|
11199
|
+
*
|
|
11200
|
+
* `searchTool.ts` must NOT import (or re-export) from this module, or the
|
|
11201
|
+
* cycle comes back. The public name is re-exported from the barrel
|
|
11202
|
+
* (`./index.ts`), which is the path every entry point already uses.
|
|
11203
|
+
*/
|
|
11204
|
+
|
|
11205
|
+
/**
|
|
11206
|
+
* Creates a memory vault search tool for use with chat completions.
|
|
11207
|
+
*
|
|
11208
|
+
* The tool allows the LLM to search through vault memories using semantic
|
|
11209
|
+
* similarity. Vault entries should have their embeddings pre-computed in the
|
|
11210
|
+
* cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
|
|
11211
|
+
* embeddings are computed on the fly as a fallback.
|
|
11212
|
+
*
|
|
11213
|
+
* @param vaultCtx - Vault operations context for database access
|
|
11214
|
+
* @param embeddingOptions - Options for embedding generation (auth, base URL)
|
|
11215
|
+
* @param cache - Pre-populated embedding cache
|
|
11216
|
+
* @param searchOptions - Optional search configuration
|
|
11217
|
+
* @returns A ToolConfig that can be passed to chat completion tools
|
|
11218
|
+
*/
|
|
11219
|
+
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
11220
|
+
|
|
11126
11221
|
/**
|
|
11127
11222
|
* Memory Vault Tool
|
|
11128
11223
|
*
|