@tangle-network/agent-knowledge 3.2.1 → 4.0.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.
@@ -0,0 +1,822 @@
1
+ import { JsonValue, Scenario, DispatchContext, RunImprovementLoopResult, ParameterCandidate, JudgeConfig, Gate, RunImprovementLoopOptions, MutableSurface, SurfaceProposer, CampaignStorage, CostLedgerHandle, CampaignResult } from '@tangle-network/agent-eval/campaign';
2
+ import { c as KnowledgeIndex, S as SourceRecord } from './types-6x0OpfW6.js';
3
+ import { OffPolicyTrajectory } from '@tangle-network/agent-eval/rl';
4
+
5
+ type RetrievalConfig = Record<string, JsonValue>;
6
+ type RetrievalParameterSearchSpace = Record<string, readonly JsonValue[]>;
7
+ type RetrievalGoldTarget = {
8
+ kind: 'page';
9
+ pageId: string;
10
+ } | {
11
+ kind: 'page-path';
12
+ path: string;
13
+ } | {
14
+ kind: 'source';
15
+ sourceId: string;
16
+ } | {
17
+ kind: 'source-anchor';
18
+ sourceId: string;
19
+ anchorId: string;
20
+ } | {
21
+ kind: 'source-span';
22
+ sourceId: string;
23
+ charStart: number;
24
+ charEnd: number;
25
+ };
26
+ interface RetrievalEvalScenario extends Scenario {
27
+ kind: 'retrieval-eval';
28
+ query: string;
29
+ expected: RetrievalGoldTarget | readonly RetrievalGoldTarget[];
30
+ k?: number;
31
+ }
32
+ interface RetrievedSourceSpan {
33
+ sourceId: string;
34
+ anchorId?: string;
35
+ charStart?: number;
36
+ charEnd?: number;
37
+ }
38
+ interface RetrievedKnowledgeHit {
39
+ pageId: string;
40
+ path: string;
41
+ title?: string;
42
+ rank: number;
43
+ score?: number;
44
+ normalizedScore?: number;
45
+ sourceIds?: readonly string[];
46
+ sourceSpans?: readonly RetrievedSourceSpan[];
47
+ snippet?: string;
48
+ metadata?: Record<string, JsonValue>;
49
+ }
50
+ interface RetrievalEvalArtifact {
51
+ config: RetrievalConfig;
52
+ query: string;
53
+ requestedK: number;
54
+ hits: readonly RetrievedKnowledgeHit[];
55
+ durationMs: number;
56
+ /** Informational copy. Billable retrievers account through context.cost.runPaidCall. */
57
+ costUsd?: number;
58
+ metadata?: Record<string, JsonValue>;
59
+ }
60
+ interface RetrievalMetricSummary {
61
+ recall: number;
62
+ mrr: number;
63
+ ndcg: number;
64
+ precisionAtK: number;
65
+ expectedCount: number;
66
+ matchedCount: number;
67
+ relevantHitCount: number;
68
+ firstHitRank: number | null;
69
+ matchedTargetIds: readonly string[];
70
+ }
71
+ interface RetrievalEvalRetrieverInput {
72
+ index?: KnowledgeIndex;
73
+ config: RetrievalConfig;
74
+ scenario: RetrievalEvalScenario;
75
+ k: number;
76
+ signal: AbortSignal;
77
+ context: DispatchContext;
78
+ }
79
+ interface RetrievalEvalRetrieverResult {
80
+ hits: readonly RetrievedKnowledgeHit[];
81
+ /** Informational copy. Billable retrievers account through context.cost.runPaidCall. */
82
+ costUsd?: number;
83
+ metadata?: Record<string, JsonValue>;
84
+ }
85
+ type RetrievalEvalRetriever = (input: RetrievalEvalRetrieverInput) => Promise<readonly RetrievedKnowledgeHit[] | RetrievalEvalRetrieverResult>;
86
+ interface BuildRetrievalEvalDispatchOptions {
87
+ index?: KnowledgeIndex;
88
+ defaultK?: number;
89
+ retrieve?: RetrievalEvalRetriever;
90
+ }
91
+ interface RetrievalMetricWeights {
92
+ recall?: number;
93
+ mrr?: number;
94
+ ndcg?: number;
95
+ precisionAtK?: number;
96
+ }
97
+ interface RetrievalRecallJudgeOptions {
98
+ name?: string;
99
+ weights?: RetrievalMetricWeights;
100
+ }
101
+ interface BuildRetrievalParameterCandidatesOptions {
102
+ baseline?: RetrievalConfig;
103
+ }
104
+ interface RetrievalParameterSweepProposerOptions {
105
+ candidates?: readonly ParameterCandidate[];
106
+ searchSpace?: RetrievalParameterSearchSpace;
107
+ baseline?: RetrievalConfig;
108
+ }
109
+ type RetrievalLoopBaseOptions = RunImprovementLoopOptions<RetrievalEvalScenario, RetrievalEvalArtifact>;
110
+ interface RunRetrievalImprovementLoopOptions {
111
+ baseline: RetrievalConfig;
112
+ scenarios: readonly RetrievalEvalScenario[];
113
+ holdoutScenarios?: readonly RetrievalEvalScenario[];
114
+ index?: KnowledgeIndex;
115
+ defaultK?: number;
116
+ retrieve?: RetrievalEvalRetriever;
117
+ candidates?: readonly ParameterCandidate[];
118
+ searchSpace?: RetrievalParameterSearchSpace;
119
+ judges?: readonly JudgeConfig<RetrievalEvalArtifact, RetrievalEvalScenario>[];
120
+ gate?: Gate<RetrievalEvalArtifact, RetrievalEvalScenario>;
121
+ metricWeights?: RetrievalMetricWeights;
122
+ targetRecall?: number;
123
+ holdoutFraction?: number;
124
+ splitSeed?: number;
125
+ deltaThreshold?: number;
126
+ runDir?: RetrievalLoopBaseOptions['runDir'];
127
+ seed?: RetrievalLoopBaseOptions['seed'];
128
+ reps?: RetrievalLoopBaseOptions['reps'];
129
+ resumable?: RetrievalLoopBaseOptions['resumable'];
130
+ costCeiling?: RetrievalLoopBaseOptions['costCeiling'];
131
+ maxConcurrency?: RetrievalLoopBaseOptions['maxConcurrency'];
132
+ dispatchTimeoutMs?: RetrievalLoopBaseOptions['dispatchTimeoutMs'];
133
+ expectUsage?: RetrievalLoopBaseOptions['expectUsage'];
134
+ tracing?: RetrievalLoopBaseOptions['tracing'];
135
+ storage?: RetrievalLoopBaseOptions['storage'];
136
+ populationSize?: RetrievalLoopBaseOptions['populationSize'];
137
+ maxGenerations?: RetrievalLoopBaseOptions['maxGenerations'];
138
+ promoteTopK?: RetrievalLoopBaseOptions['promoteTopK'];
139
+ maxImprovementShots?: RetrievalLoopBaseOptions['maxImprovementShots'];
140
+ report?: RetrievalLoopBaseOptions['report'];
141
+ findings?: RetrievalLoopBaseOptions['findings'];
142
+ now?: RetrievalLoopBaseOptions['now'];
143
+ }
144
+ interface RunRetrievalImprovementLoopResult extends RunImprovementLoopResult<RetrievalEvalArtifact, RetrievalEvalScenario> {
145
+ baselineConfig: RetrievalConfig;
146
+ winnerConfig: RetrievalConfig;
147
+ trainScenarios: readonly RetrievalEvalScenario[];
148
+ holdoutScenarios: readonly RetrievalEvalScenario[];
149
+ candidates: readonly ParameterCandidate[];
150
+ targetRecall?: number;
151
+ }
152
+ declare function retrievalConfigSurface(config: RetrievalConfig): string;
153
+ declare function retrievalConfigFromSurface(surface: MutableSurface): RetrievalConfig;
154
+ declare function buildRetrievalEvalDispatch(options: BuildRetrievalEvalDispatchOptions): (surface: MutableSurface, scenario: RetrievalEvalScenario, context: DispatchContext) => Promise<RetrievalEvalArtifact>;
155
+ declare function retrievalRecallJudge(options?: RetrievalRecallJudgeOptions): JudgeConfig<RetrievalEvalArtifact, RetrievalEvalScenario>;
156
+ declare function scoreRetrievalArtifact(artifact: RetrievalEvalArtifact, scenario: RetrievalEvalScenario): RetrievalMetricSummary;
157
+ declare function buildRetrievalParameterCandidates(searchSpace: RetrievalParameterSearchSpace, options?: BuildRetrievalParameterCandidatesOptions): ParameterCandidate[];
158
+ declare function retrievalParameterSweepProposer(options: RetrievalParameterSweepProposerOptions): SurfaceProposer;
159
+ declare function runRetrievalImprovementLoop(options: RunRetrievalImprovementLoopOptions): Promise<RunRetrievalImprovementLoopResult>;
160
+
161
+ interface AgentMemoryRunLease {
162
+ assertOwned(): Promise<void> | void;
163
+ release(): Promise<void> | void;
164
+ }
165
+ type AgentMemoryAcquireRunLease = (input: {
166
+ experimentId: string;
167
+ runDir: string;
168
+ }) => AgentMemoryRunLease | Promise<AgentMemoryRunLease>;
169
+ type AgentMemoryControllerMode = 'process-local';
170
+ interface OwnedAgentMemoryRunLease {
171
+ assertOwned(): Promise<void>;
172
+ release(): Promise<void>;
173
+ }
174
+ declare function acquireAgentMemoryRunLease(input: {
175
+ experimentId: string;
176
+ runDir: string;
177
+ storage: CampaignStorage;
178
+ customStorage: boolean;
179
+ lockFileName: string;
180
+ label: string;
181
+ controllerMode?: AgentMemoryControllerMode;
182
+ acquireRunLease?: AgentMemoryAcquireRunLease;
183
+ }): Promise<OwnedAgentMemoryRunLease>;
184
+
185
+ interface RetrievalHoldoutConfig {
186
+ /** Per-session probability that one eligible watchlist item is suppressed. 0 logs the full schema without ever dropping. */
187
+ epsilon: number;
188
+ /** Item ids eligible for suppression. Empty or absent means no item can ever be dropped. */
189
+ watchlist?: string[];
190
+ /** Ties every event to the exact epsilon/watchlist in force, for audit and replay. */
191
+ configVersion?: string;
192
+ /** Copied onto every event so multi-adapter logs stay attributable. */
193
+ adapterId?: string;
194
+ /** Corpus/store version stamp; an edited item under the same id is a different treatment. */
195
+ corpusVersion?: string;
196
+ /**
197
+ * Emit plaintext sessionId and scope on events. Default false: events carry only
198
+ * sessionIdHash/scopeHash, so PII-bearing identifiers (tenantId/userId/tags) never reach a
199
+ * consumer-controlled sink unless the consumer explicitly owns that decision. Note that
200
+ * replaying assignment draws from logs alone needs the plaintext sessionId, so
201
+ * privacy-default logs require the consumer's own sessionId mapping for replay audits.
202
+ */
203
+ includePlaintextIdentifiers?: boolean;
204
+ /**
205
+ * Cap on tracked sessions per experiment config in the sticky wrapper's registry.
206
+ * Exists so tests can exercise eviction; production should keep the default (10,000).
207
+ */
208
+ maxTrackedSessions?: number;
209
+ /**
210
+ * Uniform-[0,1) generator keyed by a string. Defaults to a sha256-derived deterministic
211
+ * generator so every assignment is replayable from the logged keys alone (design rule D5).
212
+ */
213
+ rng?: (key: string) => number;
214
+ /** Receives one event per retrieval call, INCLUDING no-drop calls: control-arm membership is half the data. */
215
+ onEvent: (event: RetrievalHoldoutEvent) => void;
216
+ }
217
+ interface RetrievalHoldoutEligibleItem {
218
+ id: string;
219
+ /** 1-based position in the post-filter hit list. */
220
+ rank: number;
221
+ score?: number;
222
+ kind: string;
223
+ /** sha256(hit.text) prefix; effects are estimated per (id, contentHash) pair. */
224
+ contentHash: string;
225
+ }
226
+ interface RetrievalHoldoutEvent {
227
+ v: 1;
228
+ eventId: string;
229
+ ts: string;
230
+ adapterId?: string;
231
+ /** Plaintext session id — emitted ONLY when config.includePlaintextIdentifiers is true. */
232
+ sessionId?: string;
233
+ /** Consumer-supplied experiment/outcome join id (scope.tags.taskId); deliberately plaintext. */
234
+ taskId?: string;
235
+ /** 1-based call counter within the session; 0 when the call is outside session randomization. */
236
+ callIndex: number;
237
+ /**
238
+ * sha256(sessionId) prefix — the default privacy-preserving session join key AND the seed-key
239
+ * reference for the assignment draws (previously named rngKey; identical derivation, deduped).
240
+ */
241
+ sessionIdHash?: string;
242
+ queryHash?: string;
243
+ /** Verbatim scope — emitted ONLY when config.includePlaintextIdentifiers is true (PII risk). */
244
+ scope?: AgentMemoryScope;
245
+ /** sha256 prefix of the canonical-JSON scope (keys sorted, undefined stripped). */
246
+ scopeHash?: string;
247
+ config: {
248
+ epsilon: number;
249
+ watchlist: string[];
250
+ configVersion?: string;
251
+ };
252
+ /**
253
+ * Value-hash of the experiment-defining knobs, sha256({epsilon, sorted watchlist}) prefix.
254
+ * The estimator groups events by it; the sticky-session registry is keyed by it.
255
+ */
256
+ configHash: string;
257
+ /**
258
+ * False when no sessionId is available or the adapter answered without retrieval
259
+ * (see bypassReason), so the fraction-under-experiment denominator stays honest.
260
+ */
261
+ holdoutEligible: boolean;
262
+ /** Present only on adapter paths that bypassed retrieval, where no suppression could apply. */
263
+ bypassReason?: RetrievalHoldoutBypassReason;
264
+ /** The full post-filter eligibility set E, logged on every call (control arm + interference probes). */
265
+ eligible: RetrievalHoldoutEligibleItem[];
266
+ /** Ids in watchlist ∩ E, in eligibility order. */
267
+ watchlistEligible: string[];
268
+ sessionHoldout: boolean;
269
+ /** The session's sticky drop target once drawn; distinguishes "target absent from E" from "not yet drawn". */
270
+ sessionTargetId: string | null;
271
+ /** The item suppressed in THIS call, or null. */
272
+ droppedId: string | null;
273
+ /** 1/|watchlist ∩ E| recorded at draw time; the exact inverse-propensity weight input. */
274
+ pickPropensity: number | null;
275
+ /** epsilon * pickPropensity, recorded at draw time so analysis never re-derives assignment probabilities. */
276
+ dropPropensity: number | null;
277
+ deliveredIds: string[];
278
+ corpusVersion?: string;
279
+ }
280
+ interface RetrievalHoldoutSessionState {
281
+ sessionId: string;
282
+ /** Calls observed so far in this session. */
283
+ callCount: number;
284
+ sessionHoldout: boolean;
285
+ /** Sticky drop target; drawn once at the first call whose eligibility set intersects the watchlist. */
286
+ targetId: string | null;
287
+ pickPropensity: number | null;
288
+ }
289
+ interface RetrievalHoldoutCallContext {
290
+ sessionId?: string;
291
+ taskId?: string;
292
+ /** Raw query; only its sha256 prefix is logged. */
293
+ query?: string;
294
+ scope?: AgentMemoryScope;
295
+ /** State returned by the previous call of this session; threading it is what makes suppression sticky. */
296
+ session?: RetrievalHoldoutSessionState;
297
+ }
298
+ interface RetrievalHoldoutResult {
299
+ delivered: AgentMemoryHit[];
300
+ event: RetrievalHoldoutEvent;
301
+ session?: RetrievalHoldoutSessionState;
302
+ }
303
+ /** Adapter context paths that answer without retrieval, so no holdout draw can happen. */
304
+ type RetrievalHoldoutBypassReason = 'short-term-context' | 'raw-string-context';
305
+ /**
306
+ * Deterministic uniform [0,1) for assignment draws. The sha256 key derivation is ours — it makes
307
+ * every draw replayable from the logged keys alone (design rule D5) — while the generator core is
308
+ * the substrate's `mulberry32` (@tangle-network/agent-eval statistics vocabulary), seeded with the
309
+ * top 32 bits of the digest, so the statistical machinery is reused rather than forked.
310
+ */
311
+ declare function deterministicRng(key: string): number;
312
+ /**
313
+ * Value-hash of the knobs that DEFINE the experiment (epsilon + watchlist, order-independent).
314
+ * Everything else on the config (callbacks, attribution stamps, privacy flags) does not change
315
+ * which assignments are drawn, so it stays out of the hash.
316
+ */
317
+ declare function retrievalHoldoutConfigHash(config: Pick<RetrievalHoldoutConfig, 'epsilon' | 'watchlist'>): string;
318
+ /**
319
+ * Pure per-call holdout: takes post-filter hits, returns delivered hits plus the log event
320
+ * and the next session state. Suppression only removes items (no backfill), and it happens
321
+ * before rendering so a drop session's context is byte-identical to a natural smaller retrieval.
322
+ */
323
+ declare function applyRetrievalHoldout(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx?: RetrievalHoldoutCallContext): RetrievalHoldoutResult;
324
+ /**
325
+ * Logs a holdout event for adapter context paths that answer WITHOUT going through the
326
+ * search→render seam (Neo4j short-term conversation context, raw-string getContext results),
327
+ * so a consumer with a holdout configured still sees every call and the fraction-under-experiment
328
+ * denominator stays honest instead of silently losing these calls. No suppression is applied:
329
+ * dropping is only meaningful for retrieved memory hits, never for conversation context.
330
+ */
331
+ declare function emitRetrievalHoldoutBypass(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx: Omit<RetrievalHoldoutCallContext, 'session'>, bypassReason: RetrievalHoldoutBypassReason): RetrievalHoldoutEvent;
332
+ /**
333
+ * Clears all sticky-session state. For test isolation and experiment-epoch boundaries;
334
+ * sessions in flight afterwards re-draw deterministically (same rng keys), so with the default
335
+ * rng a reset is invisible in the logs unless eligibility sets changed in between.
336
+ */
337
+ declare function resetRetrievalHoldoutRegistry(): void;
338
+ /**
339
+ * Convenience wrapper that threads session state internally, keyed by the VALUE of the
340
+ * experiment-defining knobs (configHash = epsilon + sorted watchlist) plus sessionId, so a fresh
341
+ * config object per call — the natural pattern when options are built inline — keeps full
342
+ * stickiness. Distinct experiments never share session state; two config objects with the same
343
+ * epsilon/watchlist are the same experiment by definition.
344
+ */
345
+ declare function applySessionStickyRetrievalHoldout(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx?: Omit<RetrievalHoldoutCallContext, 'session'>): RetrievalHoldoutResult;
346
+ /** Aggregated view of one session's holdout exposure — the randomization unit of this design. */
347
+ interface RetrievalHoldoutSessionSummary {
348
+ /** `${configHash}:${sessionIdHash}` — the trajectory's runId. */
349
+ runId: string;
350
+ configHash: string;
351
+ sessionIdHash: string;
352
+ sessionHoldout: boolean;
353
+ sessionTargetId: string | null;
354
+ /** Item actually suppressed in this session (equals sessionTargetId when a drop occurred). */
355
+ droppedId: string | null;
356
+ /** |watchlist ∩ E| at the session's first intersecting randomized call; 0 when never intersecting. */
357
+ firstCandidateCount: number;
358
+ /** Randomized retrieval calls observed for this session. */
359
+ callCount: number;
360
+ /** Adapter bypass calls observed for this session (logged, never randomized). */
361
+ bypassCallCount: number;
362
+ /** Session-level probability of the OBSERVED assignment under the behavior policy. */
363
+ behaviorProb: number;
364
+ /** True when the session's events disagree on arm or target (e.g. registry eviction re-draw). */
365
+ mixedExposure: boolean;
366
+ /** Present only on sessions surfaced in `excluded` rather than converted. */
367
+ exclusionReason?: 'mixed-exposure' | 'no-randomized-calls';
368
+ }
369
+ interface RetrievalHoldoutOffPolicyOptions {
370
+ /**
371
+ * Realized outcome PER SESSION, keyed by sessionIdHash — the session is the randomization
372
+ * unit, so rewards are per session, never per call. A missing entry for an included session
373
+ * throws: silently dropping unscored sessions would corrupt the estimator's denominator, so
374
+ * filter events to scored sessions upstream instead.
375
+ */
376
+ rewards: Record<string, number>;
377
+ /**
378
+ * Target-policy probability of the session's observed assignment. Default models the
379
+ * always-deliver-in-full policy: 1 for full-delivery sessions, 0 for drop sessions.
380
+ */
381
+ targetProb?: (session: RetrievalHoldoutSessionSummary) => number;
382
+ /** Per-session reward-model prediction enabling `doublyRobust`; when absent, qHat is null. */
383
+ qHat?: (session: RetrievalHoldoutSessionSummary) => number | null;
384
+ }
385
+ interface RetrievalHoldoutOffPolicyResult {
386
+ /** One trajectory per (configHash, sessionIdHash) — never per call. */
387
+ trajectories: OffPolicyTrajectory[];
388
+ /** 1:1 with `trajectories` (same order): the diagnostic view of each converted session. */
389
+ sessions: RetrievalHoldoutSessionSummary[];
390
+ /** Sessions surfaced but NOT converted (mixed exposure, bypass-only) — counted, never hidden. */
391
+ excluded: RetrievalHoldoutSessionSummary[];
392
+ /** Events with no sessionIdHash: outside session randomization, cannot join a reward. */
393
+ unattributableEvents: number;
394
+ }
395
+ /**
396
+ * Maps holdout logs onto agent-eval's `OffPolicyTrajectory`, ONE TRAJECTORY PER SESSION, so
397
+ * EXP-007's analysis consumes the substrate's `inverseProbabilityWeighting` /
398
+ * `selfNormalizedImportanceWeighting` / `doublyRobust` estimators directly. This matches the
399
+ * PREREG estimator (session-sticky self-normalized IPW): the design randomizes per SESSION —
400
+ * the arm coin is flipped once (P(holdout) = epsilon) and the sticky target is drawn once,
401
+ * uniformly over watchlist ∩ E at the session's first intersecting call.
402
+ *
403
+ * Session-level action space and behavior probabilities (they sum to 1 by construction):
404
+ * - full delivery (control arm observed): `1 − epsilon`;
405
+ * - drop candidate i of k = |watchlist ∩ E_first|: `epsilon / k` each (the draw event's logged
406
+ * `dropPropensity`);
407
+ * - sessions whose eligibility sets never intersect the watchlist: probability 1 — full
408
+ * delivery was certain in either arm.
409
+ *
410
+ * Per-call events are repeated observations WITHIN one session-level randomization; per-call
411
+ * IPW is statistically invalid for this design (per-call "propensities" imply an action
412
+ * distribution summing to more than 1 and bias IPS downward). Calls where the sticky target is
413
+ * absent from E, and adapter bypass calls, fold into the session summary (callCount /
414
+ * bypassCallCount) instead of generating independent propensities.
415
+ *
416
+ * Join contract: `rewards` is keyed by `sessionIdHash` (sha256(sessionId) first 16 hex — compute
417
+ * the same prefix over the outcome table's session ids, or log with
418
+ * `includePlaintextIdentifiers: true` and join on raw ids upstream). Events are grouped per
419
+ * (configHash, sessionIdHash) so different experiment configs are never pooled. Mixed-exposure
420
+ * sessions (arm or target disagreement, e.g. after registry eviction) are excluded from the
421
+ * trajectories and surfaced in `excluded` for the analysis to count.
422
+ * Pre-registration for EXP-007 stays in the research repo by design; the manifest vocabulary for
423
+ * it is agent-eval's `HypothesisManifest` / `signManifest` / `evaluateHypothesis` exports.
424
+ */
425
+ declare function toOffPolicyTrajectory(events: RetrievalHoldoutEvent[], options: RetrievalHoldoutOffPolicyOptions): RetrievalHoldoutOffPolicyResult;
426
+
427
+ type AgentMemoryKind = 'message' | 'entity' | 'fact' | 'preference' | 'observation' | 'reasoning-trace';
428
+ interface AgentMemoryScope {
429
+ tenantId?: string;
430
+ userId?: string;
431
+ agentId?: string;
432
+ teamId?: string;
433
+ runId?: string;
434
+ sessionId?: string;
435
+ namespace?: string;
436
+ tags?: Record<string, string>;
437
+ }
438
+ interface AgentMemoryHit {
439
+ id: string;
440
+ uri: string;
441
+ kind: AgentMemoryKind;
442
+ text: string;
443
+ title?: string;
444
+ score?: number;
445
+ normalizedScore?: number;
446
+ confidence?: number;
447
+ createdAt?: string;
448
+ validUntil?: string;
449
+ lastVerifiedAt?: string;
450
+ metadata?: Record<string, unknown>;
451
+ }
452
+ interface AgentMemoryContext {
453
+ query: string;
454
+ text: string;
455
+ hits: AgentMemoryHit[];
456
+ sourceRecords: SourceRecord[];
457
+ metadata?: Record<string, unknown>;
458
+ }
459
+ interface AgentMemorySearchOptions {
460
+ scope?: AgentMemoryScope;
461
+ limit?: number;
462
+ minScore?: number;
463
+ kinds?: AgentMemoryKind[];
464
+ metadata?: Record<string, unknown>;
465
+ /**
466
+ * Opt-in randomized retrieval holdout (epsilon-dropout) for treatment-effect logging.
467
+ * Absent by default; when absent, retrieval behavior is unchanged. See ./holdout.
468
+ */
469
+ holdout?: RetrievalHoldoutConfig;
470
+ }
471
+ interface AgentMemoryWriteInput {
472
+ kind: AgentMemoryKind;
473
+ text: string;
474
+ id?: string;
475
+ title?: string;
476
+ role?: 'system' | 'user' | 'assistant' | 'tool';
477
+ entityName?: string;
478
+ entityType?: string;
479
+ category?: string;
480
+ predicate?: string;
481
+ subject?: string;
482
+ object?: string;
483
+ confidence?: number;
484
+ scope?: AgentMemoryScope;
485
+ metadata?: Record<string, unknown>;
486
+ }
487
+ interface AgentMemoryWriteResult {
488
+ accepted: boolean;
489
+ id: string;
490
+ uri: string;
491
+ kind: AgentMemoryKind;
492
+ sourceRecord?: SourceRecord;
493
+ metadata?: Record<string, unknown>;
494
+ }
495
+ type AgentMemoryBranchIsolation = {
496
+ mode: 'scoped';
497
+ /** False when writes may outlive the worker process that issued them. */
498
+ processExitSafe?: boolean;
499
+ /** Wait before clearing an abandoned branch so accepted asynchronous writes become visible. */
500
+ recoveryDelayMs?: number;
501
+ } | {
502
+ mode: 'instance';
503
+ branchId: string;
504
+ /** True only when the dedicated instance also enforces every logical scope. */
505
+ supportsLogicalScopes?: boolean;
506
+ } | {
507
+ mode: 'unsupported';
508
+ reason: string;
509
+ };
510
+ interface AgentMemoryAdapter {
511
+ readonly id: string;
512
+ /** How this adapter prevents candidate branches from reading each other's state. */
513
+ readonly branchIsolation?: AgentMemoryBranchIsolation;
514
+ search(query: string, options?: AgentMemorySearchOptions): Promise<AgentMemoryHit[]>;
515
+ getContext(query: string, options?: AgentMemorySearchOptions): Promise<AgentMemoryContext>;
516
+ write(input: AgentMemoryWriteInput): Promise<AgentMemoryWriteResult>;
517
+ /** Delete exactly this scope. Repeated and concurrent calls for the same scope must be safe. */
518
+ clear?(scope?: AgentMemoryScope): Promise<void>;
519
+ flush?(): Promise<void>;
520
+ close?(): Promise<void>;
521
+ }
522
+
523
+ type KnowledgeBenchmarkTaskKind = 'retrieval' | 'rag-answer' | 'hallucination' | 'kb-improvement' | 'memory-ingest' | 'memory-recall' | 'memory-temporal' | 'memory-update' | 'memory-forgetting' | 'memory-reasoning' | 'memory-summarization' | 'memory-recommendation' | 'memory-multiparty';
524
+ type KnowledgeAnswerBenchmarkTaskKind = 'rag-answer' | 'hallucination' | 'kb-improvement';
525
+ type KnowledgeMemoryBenchmarkTaskKind = Exclude<KnowledgeBenchmarkTaskKind, 'retrieval' | KnowledgeAnswerBenchmarkTaskKind>;
526
+ type KnowledgeBenchmarkFamily = 'beir' | 'mteb-retrieval' | 'msmarco' | 'trec-dl' | 'miracl' | 'lotte' | 'bright' | 'crag' | 'hotpotqa' | 'kilt' | 'ragtruth' | 'faithbench' | 'locomo' | 'longmemeval' | 'longmemeval-v2' | 'memora' | 'memoryagentbench' | 'memorybank' | 'groupmembench' | 'first-party' | 'custom';
527
+ type KnowledgeBenchmarkSplit = 'search' | 'dev' | 'holdout' | string;
528
+ interface KnowledgeBenchmarkSource {
529
+ name?: string;
530
+ url?: string;
531
+ version?: string;
532
+ license?: string;
533
+ citation?: string;
534
+ }
535
+ interface KnowledgeBenchmarkSpec {
536
+ id: string;
537
+ family: KnowledgeBenchmarkFamily;
538
+ taskKind: KnowledgeBenchmarkTaskKind;
539
+ primaryMetrics: readonly string[];
540
+ adapter: string;
541
+ notes: string;
542
+ }
543
+ interface KnowledgeBenchmarkCaseBase {
544
+ id: string;
545
+ family: KnowledgeBenchmarkFamily | string;
546
+ taskKind: KnowledgeBenchmarkTaskKind;
547
+ split?: KnowledgeBenchmarkSplit;
548
+ tags?: readonly string[];
549
+ source?: KnowledgeBenchmarkSource;
550
+ metadata?: Record<string, unknown>;
551
+ }
552
+ interface KnowledgeRetrievalBenchmarkCase extends KnowledgeBenchmarkCaseBase {
553
+ taskKind: 'retrieval';
554
+ query: string;
555
+ expected: RetrievalGoldTarget | readonly RetrievalGoldTarget[];
556
+ k?: number;
557
+ }
558
+ interface KnowledgeClaimMatcher {
559
+ id: string;
560
+ anyOf: readonly string[];
561
+ weight?: number;
562
+ }
563
+ interface KnowledgeMemoryEvent {
564
+ id: string;
565
+ text: string;
566
+ actorId?: string;
567
+ sessionId?: string;
568
+ timestamp?: string;
569
+ metadata?: Record<string, unknown>;
570
+ }
571
+ interface KnowledgeMemoryFactMatcher extends KnowledgeClaimMatcher {
572
+ sourceEventIds?: readonly string[];
573
+ validAt?: string;
574
+ obsolete?: boolean;
575
+ }
576
+ interface KnowledgeAnswerBenchmarkCase extends KnowledgeBenchmarkCaseBase {
577
+ taskKind: KnowledgeAnswerBenchmarkTaskKind;
578
+ prompt: string;
579
+ requiredClaims?: readonly KnowledgeClaimMatcher[];
580
+ forbiddenClaims?: readonly KnowledgeClaimMatcher[];
581
+ expectedSourceIds?: readonly string[];
582
+ referenceAnswer?: string;
583
+ }
584
+ interface KnowledgeMemoryBenchmarkCase extends KnowledgeBenchmarkCaseBase {
585
+ taskKind: KnowledgeMemoryBenchmarkTaskKind;
586
+ events: readonly KnowledgeMemoryEvent[];
587
+ prompt: string;
588
+ requiredFacts?: readonly KnowledgeMemoryFactMatcher[];
589
+ forbiddenFacts?: readonly KnowledgeMemoryFactMatcher[];
590
+ expectedEventIds?: readonly string[];
591
+ expectedActorIds?: readonly string[];
592
+ referenceAnswer?: string;
593
+ }
594
+ type KnowledgeBenchmarkCase = KnowledgeRetrievalBenchmarkCase | KnowledgeAnswerBenchmarkCase | KnowledgeMemoryBenchmarkCase;
595
+ interface KnowledgeBenchmarkArtifact {
596
+ answer?: string;
597
+ text?: string;
598
+ hits?: readonly RetrievedKnowledgeHit[];
599
+ citedSourceIds?: readonly string[];
600
+ rememberedFacts?: readonly string[];
601
+ citedEventIds?: readonly string[];
602
+ usedMemoryIds?: readonly string[];
603
+ actorIds?: readonly string[];
604
+ /** Informational copy. Billable responders account through context.cost.runPaidCall. */
605
+ costUsd?: number;
606
+ durationMs?: number;
607
+ metadata?: Record<string, unknown>;
608
+ }
609
+ interface KnowledgeBenchmarkEvaluation {
610
+ score: number;
611
+ passed: boolean;
612
+ dimensions: Record<string, number>;
613
+ /** Dimensions for which this case declared an actual target. */
614
+ applicableDimensions?: readonly string[];
615
+ notes: string;
616
+ raw: Record<string, unknown>;
617
+ }
618
+ interface KnowledgeBenchmarkScenario extends Scenario {
619
+ kind: 'knowledge-benchmark';
620
+ family: KnowledgeBenchmarkFamily | string;
621
+ taskKind: KnowledgeBenchmarkTaskKind;
622
+ splitTag: KnowledgeBenchmarkSplit;
623
+ case: KnowledgeBenchmarkCase;
624
+ }
625
+ type KnowledgeBenchmarkResponder<TArtifact = KnowledgeBenchmarkArtifact> = (input: {
626
+ case: KnowledgeBenchmarkCase;
627
+ scenario: KnowledgeBenchmarkScenario;
628
+ context: DispatchContext;
629
+ }) => Promise<TArtifact> | TArtifact;
630
+ interface RunKnowledgeBenchmarkSuiteOptions<TArtifact = KnowledgeBenchmarkArtifact> {
631
+ cases: readonly KnowledgeBenchmarkCase[];
632
+ respond: KnowledgeBenchmarkResponder<TArtifact>;
633
+ /** Versioned identity for the model, prompt, retrieval, and runtime behavior. */
634
+ respondRef?: string;
635
+ runDir: string;
636
+ splits?: readonly KnowledgeBenchmarkSplit[];
637
+ repo?: string;
638
+ seed?: number;
639
+ reps?: number;
640
+ resumable?: boolean;
641
+ costCeiling?: number;
642
+ /** Shared across nested benchmark suites when an outer run owns spend. */
643
+ costLedger?: CostLedgerHandle;
644
+ costPhase?: string;
645
+ maxConcurrency?: number;
646
+ dispatchTimeoutMs?: number;
647
+ expectUsage?: 'assert' | 'warn' | 'off';
648
+ storage?: CampaignStorage;
649
+ now?: () => Date;
650
+ }
651
+ interface KnowledgeBenchmarkDistribution {
652
+ n: number;
653
+ min: number;
654
+ mean: number;
655
+ median: number;
656
+ p90: number;
657
+ max: number;
658
+ }
659
+ interface KnowledgeBenchmarkSliceSummary {
660
+ n: number;
661
+ meanScore: number;
662
+ passRate: number;
663
+ score: KnowledgeBenchmarkDistribution;
664
+ }
665
+ interface KnowledgeBenchmarkReport {
666
+ totalCases: number;
667
+ totalCells: number;
668
+ cellsFailed: number;
669
+ cellsCached: number;
670
+ totalCostUsd: number;
671
+ bySplit: Record<string, KnowledgeBenchmarkSliceSummary>;
672
+ byFamily: Record<string, KnowledgeBenchmarkSliceSummary>;
673
+ byTaskKind: Record<string, KnowledgeBenchmarkSliceSummary>;
674
+ dimensions: Record<string, KnowledgeBenchmarkDistribution>;
675
+ score: KnowledgeBenchmarkDistribution;
676
+ }
677
+ interface RunKnowledgeBenchmarkSuiteResult<TArtifact = KnowledgeBenchmarkArtifact> {
678
+ scenarios: readonly KnowledgeBenchmarkScenario[];
679
+ campaign: CampaignResult<TArtifact, KnowledgeBenchmarkScenario>;
680
+ report: KnowledgeBenchmarkReport;
681
+ reportJsonPath: string;
682
+ reportMarkdownPath: string;
683
+ }
684
+ interface MemoryAdapterBenchmarkCandidate {
685
+ id: string;
686
+ /** Versioned adapter and configuration identity used by resumable caches. */
687
+ ref: string;
688
+ /** Expected adapter.id. Defaults to candidate id and permits lazy no-work resume. */
689
+ adapterId?: string;
690
+ label?: string;
691
+ /** Local construction is free; call markExternalCall before billable provisioning or reconnects. */
692
+ createAdapter: (input: {
693
+ purpose: 'execute' | 'recovery';
694
+ signal: AbortSignal;
695
+ markExternalCall(): void;
696
+ }) => AgentMemoryAdapter | Promise<AgentMemoryAdapter>;
697
+ /** Conservative charge for one billable adapter provisioning or reconnect call. */
698
+ adapterCreationCostUsd?: number;
699
+ searchLimit?: number;
700
+ costUsdPerCase?: number;
701
+ /** Conservative extra provider charge for recovering one interrupted case. */
702
+ recoveryCostUsdPerAttempt?: number;
703
+ scope?: AgentMemoryScope;
704
+ }
705
+ interface RunMemoryAdapterBenchmarkOptions {
706
+ cases: readonly KnowledgeMemoryBenchmarkCase[];
707
+ candidates: readonly MemoryAdapterBenchmarkCandidate[];
708
+ /** Retired candidates retained only so interrupted scopes can be cleaned on resume. */
709
+ recoveryCandidates?: readonly MemoryAdapterBenchmarkCandidate[];
710
+ runDir: string;
711
+ storage?: CampaignStorage;
712
+ repo?: string;
713
+ seed?: number;
714
+ reps?: number;
715
+ resumable?: boolean;
716
+ costCeiling?: number;
717
+ /** Shared with nested benchmark suites so the dollar limit applies to the whole comparison. */
718
+ costLedger?: CostLedgerHandle;
719
+ costPhase?: string;
720
+ maxConcurrency?: number;
721
+ dispatchTimeoutMs?: number;
722
+ cleanupTimeoutMs?: number;
723
+ /** Refuse a damaged run with more unfinished attempts than this. Default 1000. */
724
+ maxRecoveryAttempts?: number;
725
+ /** Bound repeated provider cleanup after process crashes. Default 3 per attempt. */
726
+ maxRecoveryRetriesPerAttempt?: number;
727
+ expectUsage?: 'assert' | 'warn' | 'off';
728
+ now?: () => Date;
729
+ /** Required with custom storage when all controllers are confined to one process. */
730
+ controllerMode?: AgentMemoryControllerMode;
731
+ /** Required for distributed controllers that share custom storage. */
732
+ acquireRunLease?: AgentMemoryAcquireRunLease;
733
+ }
734
+ interface MemoryAdapterBenchmarkRankingRow {
735
+ rank: number;
736
+ candidateId: string;
737
+ label: string;
738
+ adapterId: string;
739
+ scoreMean: number;
740
+ passRate: number;
741
+ totalCases: number;
742
+ totalCells: number;
743
+ cellsFailed: number;
744
+ totalCostUsd: number;
745
+ reportJsonPath: string;
746
+ reportMarkdownPath: string;
747
+ report: KnowledgeBenchmarkReport;
748
+ }
749
+ interface RunMemoryAdapterBenchmarkResult {
750
+ rows: readonly MemoryAdapterBenchmarkRankingRow[];
751
+ totalCostUsd: number;
752
+ /** Recovery spend for retired candidates, excluded from ranking rows but included in totalCostUsd. */
753
+ unrankedRecoveryCostUsd: number;
754
+ rankingJsonPath: string;
755
+ rankingMarkdownPath: string;
756
+ attemptLogPath: string;
757
+ recoveryLogPath: string;
758
+ }
759
+ interface KnowledgeRetrievalBenchmarkQuery {
760
+ id: string;
761
+ text: string;
762
+ split?: KnowledgeBenchmarkSplit;
763
+ tags?: readonly string[];
764
+ metadata?: Record<string, unknown>;
765
+ }
766
+ interface KnowledgeRetrievalBenchmarkQrel {
767
+ queryId: string;
768
+ documentId: string;
769
+ score: number;
770
+ }
771
+ interface BuildRetrievalBenchmarkCasesFromQrelsOptions {
772
+ benchmarkId: string;
773
+ family: KnowledgeBenchmarkFamily | string;
774
+ queries: readonly KnowledgeRetrievalBenchmarkQuery[];
775
+ qrels: readonly KnowledgeRetrievalBenchmarkQrel[];
776
+ source?: KnowledgeBenchmarkSource;
777
+ tags?: readonly string[];
778
+ k?: number;
779
+ targetKind?: 'page' | 'page-path' | 'source';
780
+ documentTarget?: (documentId: string, qrel: KnowledgeRetrievalBenchmarkQrel) => RetrievalGoldTarget;
781
+ splitOf?: (queryId: string) => KnowledgeBenchmarkSplit;
782
+ }
783
+ declare const INDUSTRY_RAG_BENCHMARKS: readonly (KnowledgeBenchmarkSpec & {
784
+ taskKind: 'retrieval' | KnowledgeAnswerBenchmarkTaskKind;
785
+ })[];
786
+ declare const INDUSTRY_MEMORY_BENCHMARKS: readonly (KnowledgeBenchmarkSpec & {
787
+ taskKind: KnowledgeMemoryBenchmarkTaskKind;
788
+ })[];
789
+ declare function buildIndustryRagBenchmarkSmokeCases(specs?: readonly (KnowledgeBenchmarkSpec & {
790
+ taskKind: 'retrieval' | KnowledgeAnswerBenchmarkTaskKind;
791
+ })[]): KnowledgeBenchmarkCase[];
792
+ declare function respondToIndustryRagBenchmarkSmokeCase(input: {
793
+ case: KnowledgeBenchmarkCase;
794
+ }): KnowledgeBenchmarkArtifact;
795
+ declare function buildIndustryMemoryBenchmarkSmokeCases(specs?: readonly (KnowledgeBenchmarkSpec & {
796
+ taskKind: KnowledgeMemoryBenchmarkTaskKind;
797
+ })[]): KnowledgeMemoryBenchmarkCase[];
798
+ declare function respondToIndustryMemoryBenchmarkSmokeCase(input: {
799
+ case: KnowledgeMemoryBenchmarkCase;
800
+ }): KnowledgeBenchmarkArtifact;
801
+ declare function buildFirstPartyMemoryLifecycleBenchmarkCases(): KnowledgeMemoryBenchmarkCase[];
802
+ declare function runMemoryAdapterBenchmark(options: RunMemoryAdapterBenchmarkOptions): Promise<RunMemoryAdapterBenchmarkResult>;
803
+ declare function createNoopMemoryBenchmarkAdapter(id?: string): AgentMemoryAdapter;
804
+ declare function createInMemoryBenchmarkAdapter(options?: {
805
+ id?: string;
806
+ }): AgentMemoryAdapter;
807
+ declare function parseKnowledgeBenchmarkJsonl<T = unknown>(text: string): T[];
808
+ declare function parseKnowledgeBenchmarkQrels(text: string): KnowledgeRetrievalBenchmarkQrel[];
809
+ declare function buildRetrievalBenchmarkCasesFromQrels(options: BuildRetrievalBenchmarkCasesFromQrelsOptions): KnowledgeRetrievalBenchmarkCase[];
810
+ declare function runKnowledgeBenchmarkSuite<TArtifact = KnowledgeBenchmarkArtifact>(options: RunKnowledgeBenchmarkSuiteOptions<TArtifact>): Promise<RunKnowledgeBenchmarkSuiteResult<TArtifact>>;
811
+ declare function renderKnowledgeBenchmarkReportMarkdown(report: KnowledgeBenchmarkReport): string;
812
+ declare function buildKnowledgeBenchmarkScenarios(cases: readonly KnowledgeBenchmarkCase[], splits?: readonly KnowledgeBenchmarkSplit[]): KnowledgeBenchmarkScenario[];
813
+ declare function knowledgeBenchmarkJudge<TArtifact = KnowledgeBenchmarkArtifact>(): JudgeConfig<TArtifact, KnowledgeBenchmarkScenario>;
814
+ declare function scoreKnowledgeBenchmarkArtifact<TArtifact>(testCase: KnowledgeBenchmarkCase, artifact: TArtifact): KnowledgeBenchmarkEvaluation;
815
+ declare function summarizeKnowledgeBenchmarkCampaign<TArtifact>(input: {
816
+ scenarios: readonly KnowledgeBenchmarkScenario[];
817
+ campaign: CampaignResult<TArtifact, KnowledgeBenchmarkScenario>;
818
+ }): KnowledgeBenchmarkReport;
819
+ declare function scoreMemoryBenchmarkArtifact<TArtifact>(testCase: KnowledgeMemoryBenchmarkCase, artifact: TArtifact): KnowledgeBenchmarkEvaluation;
820
+ declare function isKnowledgeMemoryBenchmarkCase(testCase: KnowledgeBenchmarkCase): testCase is KnowledgeMemoryBenchmarkCase;
821
+
822
+ export { type RetrievalHoldoutBypassReason as $, type AgentMemoryAcquireRunLease as A, type BuildRetrievalBenchmarkCasesFromQrelsOptions as B, type KnowledgeBenchmarkSource as C, type KnowledgeBenchmarkSpec as D, type KnowledgeBenchmarkSplit as E, type KnowledgeBenchmarkTaskKind as F, type KnowledgeClaimMatcher as G, type KnowledgeMemoryBenchmarkCase as H, INDUSTRY_MEMORY_BENCHMARKS as I, type KnowledgeMemoryBenchmarkTaskKind as J, type KnowledgeAnswerBenchmarkCase as K, type KnowledgeMemoryEvent as L, type KnowledgeMemoryFactMatcher as M, type KnowledgeRetrievalBenchmarkCase as N, type KnowledgeRetrievalBenchmarkQrel as O, type KnowledgeRetrievalBenchmarkQuery as P, type MemoryAdapterBenchmarkCandidate as Q, type RunRetrievalImprovementLoopResult as R, type MemoryAdapterBenchmarkRankingRow as S, type OwnedAgentMemoryRunLease as T, type RetrievalConfig as U, type RetrievalEvalArtifact as V, type RetrievalEvalRetriever as W, type RetrievalEvalRetrieverInput as X, type RetrievalEvalRetrieverResult as Y, type RetrievalEvalScenario as Z, type RetrievalGoldTarget as _, type RunRetrievalImprovementLoopOptions as a, type RetrievalHoldoutCallContext as a0, type RetrievalHoldoutConfig as a1, type RetrievalHoldoutEligibleItem as a2, type RetrievalHoldoutEvent as a3, type RetrievalHoldoutOffPolicyOptions as a4, type RetrievalHoldoutOffPolicyResult as a5, type RetrievalHoldoutResult as a6, type RetrievalHoldoutSessionState as a7, type RetrievalHoldoutSessionSummary as a8, type RetrievalMetricSummary as a9, parseKnowledgeBenchmarkJsonl as aA, parseKnowledgeBenchmarkQrels as aB, renderKnowledgeBenchmarkReportMarkdown as aC, resetRetrievalHoldoutRegistry as aD, respondToIndustryMemoryBenchmarkSmokeCase as aE, respondToIndustryRagBenchmarkSmokeCase as aF, retrievalConfigFromSurface as aG, retrievalConfigSurface as aH, retrievalHoldoutConfigHash as aI, retrievalParameterSweepProposer as aJ, retrievalRecallJudge as aK, runKnowledgeBenchmarkSuite as aL, runMemoryAdapterBenchmark as aM, runRetrievalImprovementLoop as aN, scoreKnowledgeBenchmarkArtifact as aO, scoreMemoryBenchmarkArtifact as aP, scoreRetrievalArtifact as aQ, summarizeKnowledgeBenchmarkCampaign as aR, toOffPolicyTrajectory as aS, type RetrievalMetricWeights as aa, type RetrievalParameterSearchSpace as ab, type RetrievalParameterSweepProposerOptions as ac, type RetrievalRecallJudgeOptions as ad, type RetrievedKnowledgeHit as ae, type RetrievedSourceSpan as af, type RunKnowledgeBenchmarkSuiteOptions as ag, type RunKnowledgeBenchmarkSuiteResult as ah, type RunMemoryAdapterBenchmarkOptions as ai, type RunMemoryAdapterBenchmarkResult as aj, acquireAgentMemoryRunLease as ak, applyRetrievalHoldout as al, applySessionStickyRetrievalHoldout as am, buildFirstPartyMemoryLifecycleBenchmarkCases as an, buildIndustryMemoryBenchmarkSmokeCases as ao, buildIndustryRagBenchmarkSmokeCases as ap, buildKnowledgeBenchmarkScenarios as aq, buildRetrievalBenchmarkCasesFromQrels as ar, buildRetrievalEvalDispatch as as, buildRetrievalParameterCandidates as at, createInMemoryBenchmarkAdapter as au, createNoopMemoryBenchmarkAdapter as av, deterministicRng as aw, emitRetrievalHoldoutBypass as ax, isKnowledgeMemoryBenchmarkCase as ay, knowledgeBenchmarkJudge as az, type AgentMemoryAdapter as b, type AgentMemoryBranchIsolation as c, type AgentMemoryContext as d, type AgentMemoryControllerMode as e, type AgentMemoryHit as f, type AgentMemoryKind as g, type AgentMemoryRunLease as h, type AgentMemoryScope as i, type AgentMemorySearchOptions as j, type AgentMemoryWriteInput as k, type AgentMemoryWriteResult as l, type BuildRetrievalEvalDispatchOptions as m, type BuildRetrievalParameterCandidatesOptions as n, INDUSTRY_RAG_BENCHMARKS as o, type KnowledgeAnswerBenchmarkTaskKind as p, type KnowledgeBenchmarkArtifact as q, type KnowledgeBenchmarkCase as r, type KnowledgeBenchmarkCaseBase as s, type KnowledgeBenchmarkDistribution as t, type KnowledgeBenchmarkEvaluation as u, type KnowledgeBenchmarkFamily as v, type KnowledgeBenchmarkReport as w, type KnowledgeBenchmarkResponder as x, type KnowledgeBenchmarkScenario as y, type KnowledgeBenchmarkSliceSummary as z };