@tangle-network/agent-knowledge 19.1.5 → 20.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/README.md +17 -91
  3. package/dist/benchmarks/index.d.ts +2 -2
  4. package/dist/benchmarks/index.js +2 -2
  5. package/dist/benchmarks-jir3ZP-M.js +162 -0
  6. package/dist/benchmarks-jir3ZP-M.js.map +1 -0
  7. package/dist/cli.js +2 -3
  8. package/dist/cli.js.map +1 -1
  9. package/dist/index-BhvSH4E4.d.ts +512 -0
  10. package/dist/index-BhvSH4E4.d.ts.map +1 -0
  11. package/dist/index-OAxtm6is.d.ts +9 -0
  12. package/dist/index-OAxtm6is.d.ts.map +1 -0
  13. package/dist/index.d.ts +197 -1332
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +561 -3653
  16. package/dist/index.js.map +1 -1
  17. package/dist/{inspect-C6c4zuKp.js → inspect-CMigdsD5.js} +282 -24
  18. package/dist/inspect-CMigdsD5.js.map +1 -0
  19. package/dist/memory/index.d.ts +3 -3
  20. package/dist/memory/index.js +3 -3
  21. package/dist/memory-BH6oT1Qe.js +2728 -0
  22. package/dist/memory-BH6oT1Qe.js.map +1 -0
  23. package/dist/source-record-CdWvzvO6.js +39 -0
  24. package/dist/source-record-CdWvzvO6.js.map +1 -0
  25. package/dist/types-BWV_Fvp7.d.ts +224 -0
  26. package/dist/types-BWV_Fvp7.d.ts.map +1 -0
  27. package/dist/{types-m2QB86fF.d.ts → types-BekdNwGD.d.ts} +4 -19
  28. package/dist/types-BekdNwGD.d.ts.map +1 -0
  29. package/dist/viz/index.d.ts +1 -1
  30. package/docs/architecture.md +2 -30
  31. package/docs/eval/investment-material-facts.md +2 -0
  32. package/docs/results/research-driving.md +8 -8
  33. package/docs/verified-research-ab.md +12 -10
  34. package/package.json +6 -12
  35. package/skills/build-with-agent-knowledge/SKILL.md +2 -15
  36. package/dist/benchmarks-BjXxjAke.js +0 -2824
  37. package/dist/benchmarks-BjXxjAke.js.map +0 -1
  38. package/dist/index-Bh9wLd0_.d.ts +0 -1097
  39. package/dist/index-Bh9wLd0_.d.ts.map +0 -1
  40. package/dist/index-DZeFm-BP.d.ts +0 -680
  41. package/dist/index-DZeFm-BP.d.ts.map +0 -1
  42. package/dist/inspect-C6c4zuKp.js.map +0 -1
  43. package/dist/memory-CUk1mgPY.js +0 -5778
  44. package/dist/memory-CUk1mgPY.js.map +0 -1
  45. package/dist/search-BBr5eUyT.js +0 -275
  46. package/dist/search-BBr5eUyT.js.map +0 -1
  47. package/dist/sources/index.d.ts +0 -376
  48. package/dist/sources/index.d.ts.map +0 -1
  49. package/dist/sources/index.js +0 -615
  50. package/dist/sources/index.js.map +0 -1
  51. package/dist/types-m2QB86fF.d.ts.map +0 -1
  52. package/docs/eval/rag-eval-roadmap.md +0 -123
@@ -0,0 +1,512 @@
1
+ import { k as SourceRecord } from "./types-BekdNwGD.js";
2
+ import { c as AgentMemoryWriteInput, d as RetrievalHoldoutCallContext, f as RetrievalHoldoutConfig, h as RetrievalHoldoutResult, i as AgentMemoryHit, l as AgentMemoryWriteResult, m as RetrievalHoldoutEvent, o as AgentMemoryScope, r as AgentMemoryContext, s as AgentMemorySearchOptions, t as AgentMemoryAdapter, u as RetrievalHoldoutBypassReason } from "./types-BWV_Fvp7.js";
3
+ import { ToolDefinition } from "@tangle-network/agent-interface";
4
+ import { z } from "zod";
5
+ import { OffPolicyTrajectory } from "@tangle-network/agent-eval/rl";
6
+ //#region src/memory/adapter.d.ts
7
+ declare function defaultGetMemoryContext(adapter: Pick<AgentMemoryAdapter, 'search'>, query: string, options?: AgentMemorySearchOptions): Promise<AgentMemoryContext>;
8
+ declare function renderMemoryContext(hits: AgentMemoryHit[]): string;
9
+ //#endregion
10
+ //#region src/memory/branch.d.ts
11
+ type AgentMemoryVisibility = 'private' | 'team' | 'shared';
12
+ type AgentMemoryBranchLifetime = 'resumable' | 'attempt';
13
+ interface AgentMemorySharingPolicy {
14
+ read: readonly AgentMemoryVisibility[];
15
+ write: AgentMemoryVisibility;
16
+ }
17
+ interface AgentMemoryJournalEntry {
18
+ sequence: number;
19
+ input: AgentMemoryWriteInput;
20
+ result: AgentMemoryWriteResult;
21
+ }
22
+ interface AgentMemoryBranchSnapshot {
23
+ branchId: string;
24
+ lifetime: AgentMemoryBranchLifetime;
25
+ parentBranchId?: string;
26
+ adapterId: string;
27
+ policy: AgentMemorySharingPolicy;
28
+ baseScope: AgentMemoryScope;
29
+ journal: readonly AgentMemoryJournalEntry[];
30
+ digest: `sha256:${string}`;
31
+ }
32
+ interface AgentMemoryBranch extends AgentMemoryAdapter {
33
+ readonly branchId: string;
34
+ readonly lifetime: AgentMemoryBranchLifetime;
35
+ readonly parentBranchId?: string;
36
+ readonly policy: AgentMemorySharingPolicy;
37
+ snapshot(): Promise<AgentMemoryBranchSnapshot>;
38
+ fork(options: {
39
+ branchId: string;
40
+ adapter?: AgentMemoryAdapter;
41
+ policy?: AgentMemorySharingPolicy;
42
+ baseScope?: AgentMemoryScope;
43
+ lifetime?: AgentMemoryBranchLifetime;
44
+ }): Promise<AgentMemoryBranch>;
45
+ }
46
+ interface CreateAgentMemoryBranchOptions {
47
+ adapter: AgentMemoryAdapter;
48
+ branchId: string;
49
+ parentBranchId?: string;
50
+ policy?: AgentMemorySharingPolicy;
51
+ baseScope?: AgentMemoryScope;
52
+ /** Attempt branches use a new ID after a process restart and cannot bind persisted state. */
53
+ lifetime?: AgentMemoryBranchLifetime;
54
+ /** Rebind a persisted branch whose external memory is still present. */
55
+ snapshot?: AgentMemoryBranchSnapshot;
56
+ /** Optional exact logical scopes allowed to write, used by crash-safe experiments. */
57
+ allowedWriteScopes?: readonly AgentMemoryScope[];
58
+ }
59
+ interface ForkAgentMemoryBranchSnapshotOptions {
60
+ snapshot: AgentMemoryBranchSnapshot;
61
+ adapter: AgentMemoryAdapter;
62
+ branchId: string;
63
+ policy?: AgentMemorySharingPolicy;
64
+ baseScope?: AgentMemoryScope;
65
+ lifetime?: AgentMemoryBranchLifetime;
66
+ }
67
+ /**
68
+ * Isolates one candidate branch and records accepted writes for durable resume
69
+ * or replay into a child branch, including a child backed by another provider.
70
+ */
71
+ declare function createAgentMemoryBranch(options: CreateAgentMemoryBranchOptions): AgentMemoryBranch;
72
+ /** Replays a durable journal into a fresh provider branch. */
73
+ declare function forkAgentMemoryBranchSnapshot(options: ForkAgentMemoryBranchSnapshotOptions): Promise<AgentMemoryBranch>;
74
+ //#endregion
75
+ //#region src/memory/graphiti.d.ts
76
+ interface GraphitiMcpClientLike {
77
+ callTool(request: {
78
+ name: string;
79
+ arguments?: Record<string, unknown>;
80
+ }): Promise<unknown>;
81
+ }
82
+ interface GraphitiMemoryAdapterOptions {
83
+ client: GraphitiMcpClientLike;
84
+ id?: string;
85
+ /** Stable server/deployment identity for cache-key helpers. Never put credentials here. */
86
+ backendRef?: string;
87
+ defaultScope?: AgentMemoryScope;
88
+ consistency?: 'queued' | 'visible';
89
+ ingestionTimeoutMs?: number;
90
+ pollIntervalMs?: number;
91
+ /** Maximum episodes inspected to prove a queued write became visible. */
92
+ episodeScanLimit?: number;
93
+ provenanceEpisodeLimit?: number;
94
+ search?: readonly ('facts' | 'nodes')[];
95
+ toolNames?: Partial<GraphitiToolNames>;
96
+ }
97
+ interface GraphitiToolNames {
98
+ addMemory: string;
99
+ searchFacts: string;
100
+ searchNodes: string;
101
+ getEpisodes: string;
102
+ clearGraph: string;
103
+ }
104
+ /** Connects the official Graphiti MCP server without coupling to its Python internals. */
105
+ declare function createGraphitiMemoryAdapter(options: GraphitiMemoryAdapterOptions): AgentMemoryAdapter;
106
+ declare function graphitiMemoryAdapterIdentity(options: Pick<GraphitiMemoryAdapterOptions, 'id' | 'consistency' | 'ingestionTimeoutMs' | 'pollIntervalMs' | 'episodeScanLimit' | 'provenanceEpisodeLimit' | 'search' | 'toolNames' | 'defaultScope'> & {
107
+ backendRef: string;
108
+ }): string;
109
+ //#endregion
110
+ //#region src/memory/hindsight.d.ts
111
+ /** Transport owns endpoint selection and authentication; paths are always bank-bound here. */
112
+ interface HindsightClientLike {
113
+ request(input: {
114
+ method: 'GET' | 'POST';
115
+ path: string;
116
+ body?: unknown;
117
+ signal: AbortSignal;
118
+ }): Promise<{
119
+ status: number;
120
+ body: unknown;
121
+ }>;
122
+ }
123
+ interface HindsightMemoryAdapterOptions {
124
+ client: HindsightClientLike;
125
+ /** Stable deployment identity, never a credential. Changing it changes every bank identity. */
126
+ backendRef: string;
127
+ branchId: string;
128
+ requestTimeoutMs?: number;
129
+ ingestionTimeoutMs?: number;
130
+ pollIntervalMs?: number;
131
+ maxTextChars?: number;
132
+ recallMaxTokens?: number;
133
+ }
134
+ declare class HindsightOperationUnknownError extends Error {
135
+ readonly bankId: string;
136
+ readonly operationId: string;
137
+ readonly documentId: string;
138
+ constructor(bankId: string, operationId: string, documentId: string, options?: ErrorOptions);
139
+ }
140
+ /** Dedicated bank identity includes the entire logical scope, including the existing branch partition. */
141
+ declare function hindsightMemoryBankId(input: {
142
+ backendRef: string;
143
+ branchId: string;
144
+ scope: AgentMemoryScope;
145
+ }): string;
146
+ /** Hindsight 0.10.2 adapter. Snapshots remain accepted-input journals, never provider database snapshots. */
147
+ declare function createHindsightMemoryAdapter(options: HindsightMemoryAdapterOptions): AgentMemoryAdapter;
148
+ //#endregion
149
+ //#region src/memory/holdout.d.ts
150
+ /**
151
+ * Deterministic uniform [0,1) for assignment draws. The sha256 key derivation is ours — it makes
152
+ * every draw replayable from the logged keys alone (design rule D5) — while the generator core is
153
+ * the substrate's `mulberry32` (@tangle-network/agent-eval statistics vocabulary), seeded with the
154
+ * top 32 bits of the digest, so the statistical machinery is reused rather than forked.
155
+ */
156
+ declare function deterministicRng(key: string): number;
157
+ /**
158
+ * Value-hash of the knobs that DEFINE the experiment (epsilon + watchlist, order-independent).
159
+ * Everything else on the config (callbacks, attribution stamps, privacy flags) does not change
160
+ * which assignments are drawn, so it stays out of the hash.
161
+ */
162
+ declare function retrievalHoldoutConfigHash(config: Pick<RetrievalHoldoutConfig, 'epsilon' | 'watchlist'>): string;
163
+ /**
164
+ * Pure per-call holdout: takes post-filter hits, returns delivered hits plus the log event
165
+ * and the next session state. Suppression only removes items (no backfill), and it happens
166
+ * before rendering so a drop session's context is byte-identical to a natural smaller retrieval.
167
+ */
168
+ declare function applyRetrievalHoldout(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx?: RetrievalHoldoutCallContext): RetrievalHoldoutResult;
169
+ /**
170
+ * Logs a holdout event for adapter context paths that answer WITHOUT going through the
171
+ * search→render seam (Neo4j short-term conversation context, raw-string getContext results),
172
+ * so a consumer with a holdout configured still sees every call and the fraction-under-experiment
173
+ * denominator stays honest instead of silently losing these calls. No suppression is applied:
174
+ * dropping is only meaningful for retrieved memory hits, never for conversation context.
175
+ */
176
+ declare function emitRetrievalHoldoutBypass(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx: Omit<RetrievalHoldoutCallContext, 'session'>, bypassReason: RetrievalHoldoutBypassReason): RetrievalHoldoutEvent;
177
+ /**
178
+ * Clears all sticky-session state. For test isolation and experiment-epoch boundaries;
179
+ * sessions in flight afterwards re-draw deterministically (same rng keys), so with the default
180
+ * rng a reset is invisible in the logs unless eligibility sets changed in between.
181
+ */
182
+ declare function resetRetrievalHoldoutRegistry(): void;
183
+ /**
184
+ * Convenience wrapper that threads session state internally, keyed by the VALUE of the
185
+ * experiment-defining knobs (configHash = epsilon + sorted watchlist) plus sessionId, so a fresh
186
+ * config object per call — the natural pattern when options are built inline — keeps full
187
+ * stickiness. Distinct experiments never share session state; two config objects with the same
188
+ * epsilon/watchlist are the same experiment by definition.
189
+ */
190
+ declare function applySessionStickyRetrievalHoldout(hits: AgentMemoryHit[], config: RetrievalHoldoutConfig, ctx?: Omit<RetrievalHoldoutCallContext, 'session'>): RetrievalHoldoutResult;
191
+ /** Aggregated view of one session's holdout exposure — the randomization unit of this design. */
192
+ interface RetrievalHoldoutSessionSummary {
193
+ /** `${configHash}:${sessionIdHash}` — the trajectory's runId. */
194
+ runId: string;
195
+ configHash: string;
196
+ sessionIdHash: string;
197
+ sessionHoldout: boolean;
198
+ sessionTargetId: string | null;
199
+ /** Item actually suppressed in this session (equals sessionTargetId when a drop occurred). */
200
+ droppedId: string | null;
201
+ /** |watchlist ∩ E| at the session's first intersecting randomized call; 0 when never intersecting. */
202
+ firstCandidateCount: number;
203
+ /** Randomized retrieval calls observed for this session. */
204
+ callCount: number;
205
+ /** Adapter bypass calls observed for this session (logged, never randomized). */
206
+ bypassCallCount: number;
207
+ /** Session-level probability of the OBSERVED assignment under the behavior policy. */
208
+ behaviorProb: number;
209
+ /** True when the session's events disagree on arm or target (e.g. registry eviction re-draw). */
210
+ mixedExposure: boolean;
211
+ /** Present only on sessions surfaced in `excluded` rather than converted. */
212
+ exclusionReason?: 'mixed-exposure' | 'no-randomized-calls';
213
+ }
214
+ interface RetrievalHoldoutOffPolicyOptions {
215
+ /**
216
+ * Realized outcome PER SESSION, keyed by sessionIdHash — the session is the randomization
217
+ * unit, so rewards are per session, never per call. A missing entry for an included session
218
+ * throws: silently dropping unscored sessions would corrupt the estimator's denominator, so
219
+ * filter events to scored sessions upstream instead.
220
+ */
221
+ rewards: Record<string, number>;
222
+ /**
223
+ * Target-policy probability of the session's observed assignment. Default models the
224
+ * always-deliver-in-full policy: 1 for full-delivery sessions, 0 for drop sessions.
225
+ */
226
+ targetProb?: (session: RetrievalHoldoutSessionSummary) => number;
227
+ /**
228
+ * Reward-model prediction for the observed assignment. Supply this together
229
+ * with `vHatTarget`; both estimates must come from evaluation data outside
230
+ * this session.
231
+ */
232
+ qHatChosen?: (session: RetrievalHoldoutSessionSummary) => number | null;
233
+ /** Expected reward-model value under the target policy. */
234
+ vHatTarget?: (session: RetrievalHoldoutSessionSummary) => number | null;
235
+ }
236
+ interface RetrievalHoldoutOffPolicyResult {
237
+ /** One trajectory per (configHash, sessionIdHash), never per call. */
238
+ trajectories: OffPolicyTrajectory[];
239
+ /** 1:1 with `trajectories` (same order): the diagnostic view of each converted session. */
240
+ sessions: RetrievalHoldoutSessionSummary[];
241
+ /** Sessions not converted because exposure was mixed or retrieval was bypassed. */
242
+ excluded: RetrievalHoldoutSessionSummary[];
243
+ /** Events with no sessionIdHash: outside session randomization, cannot join a reward. */
244
+ unattributableEvents: number;
245
+ }
246
+ /**
247
+ * Maps retrieval-dropout events onto one `OffPolicyTrajectory` per session for use with
248
+ * `inverseProbabilityWeighting`, `selfNormalizedImportanceWeighting`, or `doublyRobust`.
249
+ * Randomization occurs once per session: the arm is selected with P(dropout) = epsilon and
250
+ * the sticky target is drawn once,
251
+ * uniformly over watchlist ∩ E at the session's first intersecting call.
252
+ *
253
+ * Session-level action space and behavior probabilities (they sum to 1 by construction):
254
+ * - full delivery: `1 - epsilon`;
255
+ * - drop candidate i of k = |watchlist ∩ E_first|: `epsilon / k` each (the draw event's logged
256
+ * `dropPropensity`);
257
+ * - sessions whose eligibility sets never intersect the watchlist: probability 1, because full
258
+ * delivery was certain in either arm.
259
+ *
260
+ * Per-call events are repeated observations WITHIN one session-level randomization; per-call
261
+ * IPW is statistically invalid for this design (per-call "propensities" imply an action
262
+ * distribution summing to more than 1 and bias IPS downward). Calls where the sticky target is
263
+ * absent from E, and adapter bypass calls, fold into the session summary (callCount /
264
+ * bypassCallCount) instead of generating independent propensities.
265
+ *
266
+ * Join contract: `rewards` is keyed by `sessionIdHash` (sha256(sessionId) first 16 hex; compute
267
+ * the same prefix over the outcome table's session ids, or log with
268
+ * `includePlaintextIdentifiers: true` and join on raw ids upstream). Events are grouped per
269
+ * (configHash, sessionIdHash) so different experiment configs are never pooled. Mixed-exposure
270
+ * sessions (arm or target disagreement, e.g. after registry eviction) are excluded from the
271
+ * trajectories and surfaced in `excluded` for analysis.
272
+ */
273
+ declare function toOffPolicyTrajectory(events: RetrievalHoldoutEvent[], options: RetrievalHoldoutOffPolicyOptions): RetrievalHoldoutOffPolicyResult;
274
+ //#endregion
275
+ //#region src/memory/lifecycle.d.ts
276
+ declare const DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS = 180000;
277
+ declare class AgentMemoryLifecycleTimeoutError extends Error {
278
+ readonly operation: string;
279
+ readonly timeoutMs: number;
280
+ constructor(operation: string, timeoutMs: number);
281
+ }
282
+ declare class AgentMemoryLifecycleUnsafeError extends Error {
283
+ readonly operation: string;
284
+ readonly priorTimeout: AgentMemoryLifecycleTimeoutError;
285
+ constructor(operation: string, priorTimeout: AgentMemoryLifecycleTimeoutError);
286
+ }
287
+ declare function resolveMemoryCleanupTimeoutMs(value: number | undefined, label: string): number;
288
+ declare function runBoundedMemoryLifecycle<T>(input: {
289
+ operation: string;
290
+ timeoutMs: number;
291
+ /** Prevent later operations from using the same client while timed-out work may still be running. */
292
+ resource?: object;
293
+ /** Cooperatively cancel provider work before reporting a timeout. */
294
+ abortController?: AbortController;
295
+ /** Stop waiting when the owning operation is cancelled. */
296
+ signal?: AbortSignal;
297
+ /** Let active work settle after cancellation before marking its resource unsafe. */
298
+ cancellationTimeoutMs?: number;
299
+ run(): Promise<T> | T;
300
+ }): Promise<T>;
301
+ declare function memoryRecoveryDelayMs(adapter: AgentMemoryAdapter): number;
302
+ declare function sleepForMemoryRecovery(delayMs: number, assertOwned: () => Promise<void>, timeoutMs?: number, operation?: string, signal?: AbortSignal): Promise<void>;
303
+ declare function createMemoryExecutionPool(limit: number): {
304
+ run<T>(operation: () => Promise<T>): Promise<T>;
305
+ };
306
+ //#endregion
307
+ //#region src/memory/mem0.d.ts
308
+ type Mem0ClientMode = 'hosted' | 'oss';
309
+ interface Mem0Message {
310
+ role: 'user' | 'assistant';
311
+ content: string;
312
+ }
313
+ interface Mem0EntityOptions {
314
+ userId?: string;
315
+ agentId?: string;
316
+ runId?: string;
317
+ }
318
+ interface Mem0SearchOptions {
319
+ filters?: Record<string, unknown>;
320
+ topK?: number;
321
+ threshold?: number;
322
+ rerank?: boolean;
323
+ showExpired?: boolean;
324
+ }
325
+ interface Mem0HostedClient {
326
+ add: (messages: Mem0Message[], options: Mem0EntityOptions & {
327
+ appId?: string;
328
+ metadata?: Record<string, unknown>;
329
+ infer?: boolean;
330
+ }) => Promise<unknown>;
331
+ search: (query: string, options: Mem0SearchOptions & {
332
+ latestOnly?: boolean;
333
+ }) => Promise<unknown>;
334
+ getAll?: (options: {
335
+ filters?: Record<string, unknown>;
336
+ page?: number;
337
+ pageSize?: number;
338
+ latestOnly?: boolean;
339
+ showExpired?: boolean;
340
+ }) => Promise<unknown>;
341
+ delete?: (memoryId: string) => Promise<unknown>;
342
+ }
343
+ interface Mem0OssClient {
344
+ add: (messages: Mem0Message[], options: Mem0EntityOptions & {
345
+ metadata?: Record<string, unknown>;
346
+ filters?: Record<string, unknown>;
347
+ infer?: boolean;
348
+ }) => Promise<unknown>;
349
+ search: (query: string, options: Mem0SearchOptions) => Promise<unknown>;
350
+ getAll?: (options: {
351
+ filters?: Record<string, unknown>;
352
+ topK?: number;
353
+ showExpired?: boolean;
354
+ }) => Promise<unknown>;
355
+ delete?: (memoryId: string) => Promise<unknown>;
356
+ }
357
+ interface Mem0MemoryAdapterBaseOptions {
358
+ id?: string;
359
+ infer?: boolean;
360
+ rerank?: boolean;
361
+ /** Bounds delayed-delete visibility checks and abandoned hosted-write recovery waits. */
362
+ ingestionTimeoutMs?: number;
363
+ pollIntervalMs?: number;
364
+ /** Stable deployment/account identity for cache-key helpers. Never put credentials here. */
365
+ backendRef?: string;
366
+ defaultScope?: AgentMemoryScope;
367
+ }
368
+ interface Mem0HostedMemoryAdapterOptions extends Mem0MemoryAdapterBaseOptions {
369
+ client: Mem0HostedClient;
370
+ mode: 'hosted';
371
+ appId?: string;
372
+ latestOnly?: boolean;
373
+ }
374
+ interface Mem0OssMemoryAdapterOptions extends Mem0MemoryAdapterBaseOptions {
375
+ client: Mem0OssClient;
376
+ mode: 'oss';
377
+ appId?: never;
378
+ latestOnly?: never;
379
+ }
380
+ type Mem0MemoryAdapterOptions = Mem0HostedMemoryAdapterOptions | Mem0OssMemoryAdapterOptions;
381
+ /** Connects both the hosted Mem0 client and the open-source `Memory` class. */
382
+ declare function createMem0MemoryAdapter(options: Mem0MemoryAdapterOptions): AgentMemoryAdapter;
383
+ /** Stable identity useful for dispatch/cache keys without exposing client credentials. */
384
+ declare function mem0MemoryAdapterIdentity(options: Pick<Mem0MemoryAdapterOptions, 'mode' | 'id' | 'appId' | 'infer' | 'rerank' | 'latestOnly' | 'ingestionTimeoutMs' | 'pollIntervalMs' | 'defaultScope'> & {
385
+ backendRef: string;
386
+ }): string;
387
+ //#endregion
388
+ //#region src/memory/neo4j.d.ts
389
+ interface Neo4jAgentMemoryAdapterOptions {
390
+ client: object;
391
+ /** Match the transport passed to the official MemoryClient. */
392
+ transport: 'rest' | 'bridge';
393
+ /** Use Neo4j's whole-conversation context instead of query-based search. */
394
+ contextMode?: 'search' | 'native';
395
+ id?: string;
396
+ /** Assert that the client owns disposable external state for this exact branch. */
397
+ branchId?: string;
398
+ }
399
+ declare function createNeo4jAgentMemoryAdapter(options: Neo4jAgentMemoryAdapterOptions): AgentMemoryAdapter;
400
+ //#endregion
401
+ //#region src/memory/schemas.d.ts
402
+ declare const AgentMemoryKindSchema: z.ZodEnum<{
403
+ entity: "entity";
404
+ fact: "fact";
405
+ message: "message";
406
+ observation: "observation";
407
+ preference: "preference";
408
+ "reasoning-trace": "reasoning-trace";
409
+ }>;
410
+ declare const AgentMemoryScopeSchema: z.ZodObject<{
411
+ tenantId: z.ZodOptional<z.ZodString>;
412
+ userId: z.ZodOptional<z.ZodString>;
413
+ agentId: z.ZodOptional<z.ZodString>;
414
+ teamId: z.ZodOptional<z.ZodString>;
415
+ runId: z.ZodOptional<z.ZodString>;
416
+ sessionId: z.ZodOptional<z.ZodString>;
417
+ namespace: z.ZodOptional<z.ZodString>;
418
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
419
+ }, z.core.$strip>;
420
+ declare const AgentMemoryHitSchema: z.ZodObject<{
421
+ id: z.ZodString;
422
+ uri: z.ZodString;
423
+ kind: z.ZodEnum<{
424
+ entity: "entity";
425
+ fact: "fact";
426
+ message: "message";
427
+ observation: "observation";
428
+ preference: "preference";
429
+ "reasoning-trace": "reasoning-trace";
430
+ }>;
431
+ text: z.ZodString;
432
+ title: z.ZodOptional<z.ZodString>;
433
+ score: z.ZodOptional<z.ZodNumber>;
434
+ normalizedScore: z.ZodOptional<z.ZodNumber>;
435
+ confidence: z.ZodOptional<z.ZodNumber>;
436
+ createdAt: z.ZodOptional<z.ZodString>;
437
+ validUntil: z.ZodOptional<z.ZodString>;
438
+ lastVerifiedAt: z.ZodOptional<z.ZodString>;
439
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
440
+ }, z.core.$strip>;
441
+ declare const AgentMemoryWriteInputSchema: z.ZodObject<{
442
+ kind: z.ZodEnum<{
443
+ entity: "entity";
444
+ fact: "fact";
445
+ message: "message";
446
+ observation: "observation";
447
+ preference: "preference";
448
+ "reasoning-trace": "reasoning-trace";
449
+ }>;
450
+ text: z.ZodString;
451
+ id: z.ZodOptional<z.ZodString>;
452
+ title: z.ZodOptional<z.ZodString>;
453
+ role: z.ZodOptional<z.ZodEnum<{
454
+ assistant: "assistant";
455
+ system: "system";
456
+ tool: "tool";
457
+ user: "user";
458
+ }>>;
459
+ entityName: z.ZodOptional<z.ZodString>;
460
+ entityType: z.ZodOptional<z.ZodString>;
461
+ category: z.ZodOptional<z.ZodString>;
462
+ predicate: z.ZodOptional<z.ZodString>;
463
+ subject: z.ZodOptional<z.ZodString>;
464
+ object: z.ZodOptional<z.ZodString>;
465
+ confidence: z.ZodOptional<z.ZodNumber>;
466
+ scope: z.ZodOptional<z.ZodObject<{
467
+ tenantId: z.ZodOptional<z.ZodString>;
468
+ userId: z.ZodOptional<z.ZodString>;
469
+ agentId: z.ZodOptional<z.ZodString>;
470
+ teamId: z.ZodOptional<z.ZodString>;
471
+ runId: z.ZodOptional<z.ZodString>;
472
+ sessionId: z.ZodOptional<z.ZodString>;
473
+ namespace: z.ZodOptional<z.ZodString>;
474
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
475
+ }, z.core.$strip>>;
476
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
477
+ }, z.core.$strip>;
478
+ //#endregion
479
+ //#region src/memory/source-record.d.ts
480
+ declare function memoryHitToSourceRecord(hit: AgentMemoryHit, options?: {
481
+ now?: () => Date;
482
+ scope?: AgentMemoryScope;
483
+ }): SourceRecord;
484
+ declare function memoryWriteResultToSourceRecord(result: AgentMemoryWriteResult, text: string, options?: {
485
+ now?: () => Date;
486
+ scope?: AgentMemoryScope;
487
+ }): SourceRecord;
488
+ //#endregion
489
+ //#region src/memory/tools.d.ts
490
+ interface PlayMemoryRetrievalReceipt {
491
+ branchId: string;
492
+ adapterId: string;
493
+ actorId: string;
494
+ query: string;
495
+ context: AgentMemoryContext;
496
+ receiptDigest: `sha256:${string}`;
497
+ }
498
+ interface CreatePlayMemoryToolsOptions {
499
+ branch: AgentMemoryBranch;
500
+ actorId: string;
501
+ /** Persist through the host's existing record owner before acknowledging a write. */
502
+ onCheckpoint(snapshot: AgentMemoryBranchSnapshot): Promise<void> | void;
503
+ recordRetrieval?(receipt: PlayMemoryRetrievalReceipt): Promise<void> | void;
504
+ /** Optional transport prefix; tool suffixes remain memory_recall and memory_record. */
505
+ namePrefix?: string;
506
+ maxTextChars?: number;
507
+ maxResults?: number;
508
+ }
509
+ declare function createPlayMemoryTools(options: CreatePlayMemoryToolsOptions): ToolDefinition[];
510
+ //#endregion
511
+ export { AgentMemoryVisibility as $, RetrievalHoldoutSessionSummary as A, HindsightOperationUnknownError as B, createMemoryExecutionPool as C, sleepForMemoryRecovery as D, runBoundedMemoryLifecycle as E, resetRetrievalHoldoutRegistry as F, GraphitiToolNames as G, hindsightMemoryBankId as H, retrievalHoldoutConfigHash as I, AgentMemoryBranch as J, createGraphitiMemoryAdapter as K, toOffPolicyTrajectory as L, applySessionStickyRetrievalHoldout as M, deterministicRng as N, RetrievalHoldoutOffPolicyOptions as O, emitRetrievalHoldoutBypass as P, AgentMemorySharingPolicy as Q, HindsightClientLike as R, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS as S, resolveMemoryCleanupTimeoutMs as T, GraphitiMcpClientLike as U, createHindsightMemoryAdapter as V, GraphitiMemoryAdapterOptions as W, AgentMemoryBranchSnapshot as X, AgentMemoryBranchLifetime as Y, AgentMemoryJournalEntry as Z, Mem0OssMemoryAdapterOptions as _, memoryWriteResultToSourceRecord as a, renderMemoryContext as at, AgentMemoryLifecycleTimeoutError as b, AgentMemoryScopeSchema as c, createNeo4jAgentMemoryAdapter as d, CreateAgentMemoryBranchOptions as et, Mem0ClientMode as f, Mem0OssClient as g, Mem0MemoryAdapterOptions as h, memoryHitToSourceRecord as i, defaultGetMemoryContext as it, applyRetrievalHoldout as j, RetrievalHoldoutOffPolicyResult as k, AgentMemoryWriteInputSchema as l, Mem0HostedMemoryAdapterOptions as m, PlayMemoryRetrievalReceipt as n, createAgentMemoryBranch as nt, AgentMemoryHitSchema as o, Mem0HostedClient as p, graphitiMemoryAdapterIdentity as q, createPlayMemoryTools as r, forkAgentMemoryBranchSnapshot as rt, AgentMemoryKindSchema as s, CreatePlayMemoryToolsOptions as t, ForkAgentMemoryBranchSnapshotOptions as tt, Neo4jAgentMemoryAdapterOptions as u, createMem0MemoryAdapter as v, memoryRecoveryDelayMs as w, AgentMemoryLifecycleUnsafeError as x, mem0MemoryAdapterIdentity as y, HindsightMemoryAdapterOptions as z };
512
+ //# sourceMappingURL=index-BhvSH4E4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BhvSH4E4.d.ts","names":[],"sources":["../src/memory/adapter.ts","../src/memory/branch.ts","../src/memory/graphiti.ts","../src/memory/hindsight.ts","../src/memory/holdout.ts","../src/memory/lifecycle.ts","../src/memory/mem0.ts","../src/memory/neo4j.ts","../src/memory/schemas.ts","../src/memory/source-record.ts","../src/memory/tools.ts"],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ import { t as AgentMemoryAdapter } from "./types-BWV_Fvp7.js";
2
+ //#region src/benchmarks/adapters.d.ts
3
+ declare function createNoopMemoryBenchmarkAdapter(id?: string): AgentMemoryAdapter;
4
+ declare function createInMemoryBenchmarkAdapter(options?: {
5
+ id?: string;
6
+ }): AgentMemoryAdapter;
7
+ //#endregion
8
+ export { createNoopMemoryBenchmarkAdapter as n, createInMemoryBenchmarkAdapter as t };
9
+ //# sourceMappingURL=index-OAxtm6is.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-OAxtm6is.d.ts","names":[],"sources":["../src/benchmarks/adapters.ts"],"mappings":";;iBASgB,iCAAiC,cAAmB;iBAuBpD,+BAA+B;EAAW;IAAqB"}