@crewai-ts/core 0.1.13 → 0.2.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.
Files changed (55) hide show
  1. package/dist/agent.d.ts +16 -18
  2. package/dist/auth.cjs +598 -0
  3. package/dist/auth.js +40 -0
  4. package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
  5. package/dist/chunk-CCOE6MLE.js +896 -0
  6. package/dist/chunk-HFQTF332.js +4455 -0
  7. package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
  8. package/dist/chunk-RH43TNKN.js +238 -0
  9. package/dist/chunk-S477WFUT.js +565 -0
  10. package/dist/chunk-SB7ADUQA.js +110 -0
  11. package/dist/chunk-T32G6KDW.js +40 -0
  12. package/dist/crew.d.ts +24 -26
  13. package/dist/events.cjs +7513 -0
  14. package/dist/events.js +406 -0
  15. package/dist/experimental-conversational.cjs +272 -0
  16. package/dist/experimental-conversational.js +26 -0
  17. package/dist/feature-hooks.cjs +149 -0
  18. package/dist/feature-hooks.d.ts +94 -0
  19. package/dist/feature-hooks.js +36 -0
  20. package/dist/index.cjs +33923 -64381
  21. package/dist/index.d.ts +2 -15
  22. package/dist/index.js +16720 -49562
  23. package/dist/input-provider.d.ts +3 -4
  24. package/dist/lite-agent.d.ts +4 -4
  25. package/dist/llm.cjs +7467 -0
  26. package/dist/llm.d.ts +0 -4
  27. package/dist/llm.js +225 -0
  28. package/dist/optional-yaml.d.ts +8 -0
  29. package/dist/project.d.ts +1 -1
  30. package/dist/schema-utils.cjs +968 -0
  31. package/dist/schema-utils.d.ts +1 -1
  32. package/dist/schema-utils.js +102 -0
  33. package/dist/state-provider-core.js +3 -2
  34. package/dist/task.d.ts +3 -4
  35. package/dist/tools.cjs +6872 -0
  36. package/dist/tools.d.ts +0 -60
  37. package/dist/tools.js +114 -0
  38. package/dist/types.cjs +68 -0
  39. package/dist/types.js +14 -0
  40. package/package.json +52 -111
  41. package/dist/a2a.d.ts +0 -1684
  42. package/dist/a2ui-schemas.d.ts +0 -3312
  43. package/dist/a2ui.d.ts +0 -379
  44. package/dist/flow-conversation.d.ts +0 -90
  45. package/dist/flow-definition.d.ts +0 -195
  46. package/dist/flow-persistence.d.ts +0 -107
  47. package/dist/flow-visualization.d.ts +0 -77
  48. package/dist/flow.d.ts +0 -927
  49. package/dist/knowledge.d.ts +0 -353
  50. package/dist/mcp-DS7UMYAM.js +0 -62
  51. package/dist/mcp.d.ts +0 -315
  52. package/dist/memory.d.ts +0 -915
  53. package/dist/openai-completion.d.ts +0 -327
  54. package/dist/provider-completions.d.ts +0 -596
  55. package/dist/rag.d.ts +0 -1074
package/dist/memory.d.ts DELETED
@@ -1,915 +0,0 @@
1
- import { type LLM } from "./llm.js";
2
- import { BaseTool, type BaseToolOptions } from "./tools.js";
3
- import type { Tool } from "./types.js";
4
- export declare function _passthrough<T>(value: T): T;
5
- export declare function _default_embedder(): unknown;
6
- export type MemoryRecordOptions = {
7
- id?: string;
8
- content: string;
9
- scope?: string;
10
- categories?: readonly string[];
11
- metadata?: Record<string, unknown>;
12
- importance?: number;
13
- source?: string | null;
14
- private?: boolean;
15
- createdAt?: Date | string;
16
- created_at?: Date | string;
17
- lastAccessed?: Date | string;
18
- last_accessed?: Date | string;
19
- embedding?: readonly number[] | null;
20
- };
21
- export type MemoryRecordJSON = Omit<MemoryRecordOptions, "embedding" | "lastAccessed" | "last_accessed"> & {
22
- lastAccessed?: Date;
23
- last_accessed?: Date;
24
- };
25
- export declare class MemoryRecord {
26
- readonly id: string;
27
- readonly content: string;
28
- readonly scope: string;
29
- readonly categories: readonly string[];
30
- readonly metadata: Record<string, unknown>;
31
- readonly importance: number;
32
- readonly source: string | null;
33
- readonly private: boolean;
34
- readonly createdAt: Date;
35
- readonly created_at?: Date;
36
- readonly lastAccessed?: Date;
37
- readonly last_accessed?: Date;
38
- readonly embedding?: readonly number[] | null;
39
- constructor(options: MemoryRecordOptions);
40
- toJSON(): MemoryRecordJSON;
41
- }
42
- export type MemoryMatchOptions = {
43
- record: MemoryRecord | MemoryRecordOptions;
44
- score: number;
45
- matchReasons?: readonly string[];
46
- match_reasons?: readonly string[];
47
- evidenceGaps?: readonly string[];
48
- evidence_gaps?: readonly string[];
49
- };
50
- export declare class MemoryMatch {
51
- readonly record: MemoryRecord;
52
- readonly score: number;
53
- readonly matchReasons: readonly string[];
54
- readonly match_reasons: readonly string[];
55
- readonly evidenceGaps: readonly string[];
56
- readonly evidence_gaps: readonly string[];
57
- constructor(options: MemoryMatchOptions);
58
- format(): string;
59
- toJSON(): {
60
- record: ReturnType<MemoryRecord["toJSON"]>;
61
- score: number;
62
- matchReasons: readonly string[];
63
- match_reasons: readonly string[];
64
- evidenceGaps: readonly string[];
65
- evidence_gaps: readonly string[];
66
- };
67
- }
68
- export type MemoryOptions = {
69
- readOnly?: boolean;
70
- read_only?: boolean;
71
- rootScope?: string | null;
72
- root_scope?: string | null;
73
- llm?: LLM | null;
74
- embedder?: unknown;
75
- } & ConstructorParameters<typeof MemoryConfig>[0];
76
- export type MemoryUpdateOptions = {
77
- content?: string | null;
78
- scope?: string | null;
79
- categories?: readonly string[] | null;
80
- metadata?: Record<string, unknown> | null;
81
- importance?: number | null;
82
- };
83
- export declare class ExtractedMetadata {
84
- readonly entities: readonly string[];
85
- readonly dates: readonly string[];
86
- readonly topics: readonly string[];
87
- constructor(options?: {
88
- entities?: readonly string[];
89
- dates?: readonly string[];
90
- topics?: readonly string[];
91
- });
92
- }
93
- export declare class MemoryAnalysis {
94
- readonly suggestedScope: string;
95
- readonly suggested_scope: string;
96
- readonly categories: readonly string[];
97
- readonly importance: number;
98
- readonly extractedMetadata: ExtractedMetadata;
99
- readonly extracted_metadata: ExtractedMetadata;
100
- constructor(options?: {
101
- suggestedScope?: string;
102
- suggested_scope?: string;
103
- categories?: readonly string[];
104
- importance?: number;
105
- extractedMetadata?: ExtractedMetadata | Record<string, unknown>;
106
- extracted_metadata?: ExtractedMetadata | Record<string, unknown>;
107
- });
108
- }
109
- export declare class QueryAnalysis {
110
- readonly keywords: readonly string[];
111
- readonly suggestedScopes: readonly string[];
112
- readonly suggested_scopes: readonly string[];
113
- readonly complexity: string;
114
- readonly recallQueries: readonly string[];
115
- readonly recall_queries: readonly string[];
116
- readonly timeFilter: string | null;
117
- readonly time_filter: string | null;
118
- constructor(options?: {
119
- keywords?: readonly string[];
120
- suggestedScopes?: readonly string[];
121
- suggested_scopes?: readonly string[];
122
- complexity?: string;
123
- recallQueries?: readonly string[];
124
- recall_queries?: readonly string[];
125
- timeFilter?: string | null;
126
- time_filter?: string | null;
127
- });
128
- }
129
- export declare class ExtractedMemories {
130
- readonly memories: readonly string[];
131
- constructor(options?: {
132
- memories?: readonly string[];
133
- });
134
- }
135
- export declare class ConsolidationAction {
136
- readonly action: string;
137
- readonly recordId: string;
138
- readonly record_id: string;
139
- readonly newContent: string | null;
140
- readonly new_content: string | null;
141
- readonly reason: string;
142
- constructor(options: {
143
- action: string;
144
- recordId?: string;
145
- record_id?: string;
146
- newContent?: string | null;
147
- new_content?: string | null;
148
- reason?: string;
149
- });
150
- }
151
- export declare class ConsolidationPlan {
152
- readonly actions: readonly ConsolidationAction[];
153
- readonly insertNew: boolean;
154
- readonly insert_new: boolean;
155
- readonly insertReason: string;
156
- readonly insert_reason: string;
157
- constructor(options?: {
158
- actions?: readonly (ConsolidationAction | Record<string, unknown>)[];
159
- insertNew?: boolean;
160
- insert_new?: boolean;
161
- insertReason?: string;
162
- insert_reason?: string;
163
- });
164
- }
165
- export type ScopeInfoOptions = {
166
- path: string;
167
- count?: number;
168
- recordCount?: number;
169
- record_count?: number;
170
- categories?: readonly string[];
171
- lastUpdated?: Date | string | null;
172
- last_updated?: Date | string | null;
173
- oldestRecord?: Date | string | null;
174
- oldest_record?: Date | string | null;
175
- newestRecord?: Date | string | null;
176
- newest_record?: Date | string | null;
177
- childScopes?: readonly string[];
178
- child_scopes?: readonly string[];
179
- };
180
- export declare class ScopeInfo {
181
- readonly path: string;
182
- readonly count: number;
183
- readonly recordCount: number;
184
- readonly record_count: number;
185
- readonly categories: readonly string[];
186
- readonly lastUpdated: Date | null;
187
- readonly last_updated: Date | null;
188
- readonly oldestRecord: Date | null;
189
- readonly oldest_record: Date | null;
190
- readonly newestRecord: Date | null;
191
- readonly newest_record: Date | null;
192
- readonly childScopes: readonly string[];
193
- readonly child_scopes: readonly string[];
194
- constructor(options: ScopeInfoOptions);
195
- }
196
- export declare class MemoryConfig {
197
- readonly recencyWeight: number;
198
- readonly recency_weight: number;
199
- readonly semanticWeight: number;
200
- readonly semantic_weight: number;
201
- readonly importanceWeight: number;
202
- readonly importance_weight: number;
203
- readonly recencyHalfLifeDays: number;
204
- readonly recency_half_life_days: number;
205
- readonly consolidationThreshold: number;
206
- readonly consolidation_threshold: number;
207
- readonly consolidationLimit: number;
208
- readonly consolidation_limit: number;
209
- readonly batchDedupThreshold: number;
210
- readonly batch_dedup_threshold: number;
211
- readonly defaultImportance: number;
212
- readonly default_importance: number;
213
- readonly confidenceThresholdHigh: number;
214
- readonly confidence_threshold_high: number;
215
- readonly confidenceThresholdLow: number;
216
- readonly confidence_threshold_low: number;
217
- readonly complexQueryThreshold: number;
218
- readonly complex_query_threshold: number;
219
- readonly explorationBudget: number;
220
- readonly exploration_budget: number;
221
- readonly recallOversampleFactor: number;
222
- readonly recall_oversample_factor: number;
223
- readonly queryAnalysisThreshold: number;
224
- readonly query_analysis_threshold: number;
225
- constructor(options?: {
226
- recencyWeight?: number;
227
- recency_weight?: number;
228
- semanticWeight?: number;
229
- semantic_weight?: number;
230
- importanceWeight?: number;
231
- importance_weight?: number;
232
- recencyHalfLifeDays?: number;
233
- recency_half_life_days?: number;
234
- consolidationThreshold?: number;
235
- consolidation_threshold?: number;
236
- consolidationLimit?: number;
237
- consolidation_limit?: number;
238
- batchDedupThreshold?: number;
239
- batch_dedup_threshold?: number;
240
- defaultImportance?: number;
241
- default_importance?: number;
242
- confidenceThresholdHigh?: number;
243
- confidence_threshold_high?: number;
244
- confidenceThresholdLow?: number;
245
- confidence_threshold_low?: number;
246
- complexQueryThreshold?: number;
247
- complex_query_threshold?: number;
248
- explorationBudget?: number;
249
- exploration_budget?: number;
250
- recallOversampleFactor?: number;
251
- recall_oversample_factor?: number;
252
- queryAnalysisThreshold?: number;
253
- query_analysis_threshold?: number;
254
- });
255
- }
256
- export declare class ItemState {
257
- readonly content: string;
258
- scope: string | null;
259
- categories: readonly string[] | null;
260
- metadata: Record<string, unknown> | null;
261
- importance: number | null;
262
- source: string | null;
263
- private: boolean;
264
- rootScope: string | null;
265
- root_scope: string | null;
266
- resolvedScope: string;
267
- resolved_scope: string;
268
- resolvedCategories: readonly string[];
269
- resolved_categories: readonly string[];
270
- resolvedMetadata: Record<string, unknown>;
271
- resolved_metadata: Record<string, unknown>;
272
- resolvedImportance: number;
273
- resolved_importance: number;
274
- resolvedSource: string | null;
275
- resolved_source: string | null;
276
- resolvedPrivate: boolean;
277
- resolved_private: boolean;
278
- embedding: number[];
279
- dropped: boolean;
280
- similarRecords: MemoryRecord[];
281
- similar_records: MemoryRecord[];
282
- topSimilarity: number;
283
- top_similarity: number;
284
- plan: ConsolidationPlan | null;
285
- resultRecord: MemoryRecord | null;
286
- result_record: MemoryRecord | null;
287
- constructor(content?: string, options?: {
288
- scope?: string | null;
289
- categories?: readonly string[] | null;
290
- metadata?: Record<string, unknown> | null;
291
- importance?: number | null;
292
- source?: string | null;
293
- private?: boolean;
294
- rootScope?: string | null;
295
- root_scope?: string | null;
296
- resolvedScope?: string;
297
- resolved_scope?: string;
298
- resolvedCategories?: readonly string[];
299
- resolved_categories?: readonly string[];
300
- resolvedMetadata?: Record<string, unknown>;
301
- resolved_metadata?: Record<string, unknown>;
302
- resolvedImportance?: number;
303
- resolved_importance?: number;
304
- resolvedSource?: string | null;
305
- resolved_source?: string | null;
306
- resolvedPrivate?: boolean;
307
- resolved_private?: boolean;
308
- embedding?: readonly number[];
309
- dropped?: boolean;
310
- similarRecords?: readonly MemoryRecord[];
311
- similar_records?: readonly MemoryRecord[];
312
- topSimilarity?: number;
313
- top_similarity?: number;
314
- plan?: ConsolidationPlan | null;
315
- resultRecord?: MemoryRecord | null;
316
- result_record?: MemoryRecord | null;
317
- });
318
- }
319
- export declare class EncodingState {
320
- readonly id: `${string}-${string}-${string}-${string}-${string}`;
321
- readonly items: ItemState[];
322
- records_inserted: number;
323
- records_updated: number;
324
- records_deleted: number;
325
- items_dropped_dedup: number;
326
- constructor(options?: {
327
- items?: readonly (ItemState | string)[];
328
- });
329
- }
330
- export declare class EncodingFlow {
331
- readonly storage: unknown;
332
- readonly llm: unknown;
333
- readonly embedder: unknown;
334
- readonly config: MemoryConfig;
335
- readonly state: EncodingState;
336
- constructor(storage?: unknown, llm?: unknown, embedder?: unknown, config?: MemoryConfig);
337
- batch_embed(): void;
338
- batchEmbed(): void;
339
- intra_batch_dedup(): void;
340
- intraBatchDedup(): void;
341
- parallel_find_similar(): void;
342
- parallelFindSimilar(): void;
343
- _search_one(item: ItemState): Array<readonly [MemoryRecord, number]>;
344
- parallel_analyze(): Promise<void>;
345
- parallelAnalyze(): Promise<void>;
346
- static _cosine_similarity(a: readonly number[], b: readonly number[]): number;
347
- _apply_defaults(item: ItemState): void;
348
- private applyEncodingAnalysis;
349
- private listStorageScopes;
350
- private listStorageCategories;
351
- execute_plans(): void;
352
- executePlans(): void;
353
- }
354
- export declare class RecallState {
355
- id: string;
356
- query: string;
357
- scope: string | null;
358
- categories: readonly string[] | null;
359
- timeCutoff: Date | null;
360
- time_cutoff: Date | null;
361
- source: string | null;
362
- includePrivate: boolean;
363
- include_private: boolean;
364
- limit: number;
365
- queryEmbeddings: Array<readonly [string, readonly number[]]>;
366
- query_embeddings: Array<readonly [string, readonly number[]]>;
367
- queryAnalysis: QueryAnalysis | null;
368
- query_analysis: QueryAnalysis | null;
369
- candidateScopes: string[];
370
- candidate_scopes: string[];
371
- chunkFindings: unknown[];
372
- chunk_findings: unknown[];
373
- evidenceGaps: string[];
374
- evidence_gaps: string[];
375
- confidence: number;
376
- finalResults: MemoryMatch[];
377
- final_results: MemoryMatch[];
378
- explorationBudget: number;
379
- exploration_budget: number;
380
- constructor(options?: {
381
- id?: string;
382
- query?: string;
383
- scope?: string | null;
384
- categories?: readonly string[] | null;
385
- timeCutoff?: Date | string | null;
386
- time_cutoff?: Date | string | null;
387
- source?: string | null;
388
- includePrivate?: boolean;
389
- include_private?: boolean;
390
- limit?: number;
391
- queryEmbeddings?: Array<readonly [string, readonly number[]]>;
392
- query_embeddings?: Array<readonly [string, readonly number[]]>;
393
- queryAnalysis?: QueryAnalysis | null;
394
- query_analysis?: QueryAnalysis | null;
395
- candidateScopes?: readonly string[];
396
- candidate_scopes?: readonly string[];
397
- chunkFindings?: readonly unknown[];
398
- chunk_findings?: readonly unknown[];
399
- evidenceGaps?: readonly string[];
400
- evidence_gaps?: readonly string[];
401
- confidence?: number;
402
- finalResults?: readonly MemoryMatch[];
403
- final_results?: readonly MemoryMatch[];
404
- explorationBudget?: number;
405
- exploration_budget?: number;
406
- });
407
- }
408
- export declare const VECTOR_NAME = "memory";
409
- export declare const DEFAULT_VECTOR_DIM = 1536;
410
- export type MemoryVectorSearchOptions = {
411
- scope_prefix?: string | null;
412
- scopePrefix?: string | null;
413
- categories?: readonly string[] | null;
414
- metadata_filter?: Record<string, unknown> | null;
415
- metadataFilter?: Record<string, unknown> | null;
416
- limit?: number;
417
- min_score?: number;
418
- minScore?: number;
419
- };
420
- export type MemoryVectorStorageLike = {
421
- search(embedding: readonly number[], options?: MemoryVectorSearchOptions): Array<readonly [MemoryRecord, number]>;
422
- };
423
- export type QdrantEdgeConfig = {
424
- vectors: Record<string, {
425
- size: number;
426
- distance: "Cosine";
427
- }>;
428
- };
429
- export type QdrantScopeFilter = {
430
- must: readonly [{
431
- key: "scope_ancestors";
432
- match: {
433
- value: string;
434
- };
435
- }];
436
- };
437
- export type QdrantPoint = {
438
- id: number;
439
- vector: Record<typeof VECTOR_NAME, readonly number[]>;
440
- payload: {
441
- record_id: string;
442
- content: string;
443
- scope: string;
444
- scope_ancestors: readonly string[];
445
- categories: readonly string[];
446
- metadata: Record<string, unknown>;
447
- importance: number;
448
- created_at: string;
449
- last_accessed: string;
450
- source: string;
451
- private: boolean;
452
- };
453
- };
454
- export type QdrantShardHandle = {
455
- path: string;
456
- points: QdrantPoint[];
457
- closed: boolean;
458
- close: () => void;
459
- flush: () => void;
460
- };
461
- export declare class QdrantEdgeStorage implements MemoryVectorStorageLike {
462
- private readonly records;
463
- readonly path: string | null;
464
- readonly vectorDim: number;
465
- readonly vector_dim: number;
466
- readonly _base_path: string | null;
467
- readonly _central_path: string | null;
468
- readonly _local_path: string | null;
469
- _local_has_data: boolean;
470
- _closed: boolean;
471
- _indexes_created: boolean;
472
- constructor(options?: string | {
473
- path?: string | null;
474
- vectorDim?: number | null;
475
- vector_dim?: number | null;
476
- } | null);
477
- save(records: MemoryRecord | MemoryRecordOptions | readonly (MemoryRecord | MemoryRecordOptions)[]): void;
478
- search(embedding: readonly number[], optionsOrScopePrefix?: MemoryVectorSearchOptions | string | null, categoriesArg?: readonly string[] | null, metadataFilterArg?: Record<string, unknown> | null, limitArg?: number, minScoreArg?: number): Array<readonly [MemoryRecord, number]>;
479
- get_record(record_id: string): MemoryRecord | null;
480
- getRecord(recordId: string): MemoryRecord | null;
481
- update(record: MemoryRecord | MemoryRecordOptions): void;
482
- touch_records(record_ids: readonly string[]): void;
483
- touchRecords(recordIds: readonly string[]): void;
484
- list_records(scope_prefix?: string | null, limit?: number, offset?: number): MemoryRecord[];
485
- listRecords(scopePrefix?: string | null, limit?: number, offset?: number): MemoryRecord[];
486
- delete(scope_prefix?: string | null, categories?: readonly string[] | null, record_ids?: readonly string[] | null, older_than?: Date | string | null, metadata_filter?: Record<string, unknown> | null): number;
487
- reset(scope_prefix?: string | null): void;
488
- get_scope_info(scope: string): ScopeInfo;
489
- getScopeInfo(scope: string): ScopeInfo;
490
- list_scopes(parent?: string): string[];
491
- listScopes(parent?: string): string[];
492
- list_categories(scope_prefix?: string | null): Record<string, number>;
493
- listCategories(scopePrefix?: string | null): Record<string, number>;
494
- count(scope_prefix?: string | null): number;
495
- asave(records: MemoryRecord | MemoryRecordOptions | readonly (MemoryRecord | MemoryRecordOptions)[]): Promise<void>;
496
- asearch(embedding: readonly number[], scope_prefix?: string | null, categories?: readonly string[] | null, metadata_filter?: Record<string, unknown> | null, limit?: number, min_score?: number): Promise<Array<readonly [MemoryRecord, number]>>;
497
- adelete(scope_prefix?: string | null, categories?: readonly string[] | null, record_ids?: readonly string[] | null, older_than?: Date | string | null, metadata_filter?: Record<string, unknown> | null): Promise<number>;
498
- optimize(): void;
499
- flush_to_central(): void;
500
- flushToCentral(): void;
501
- close(): void;
502
- aclose(): Promise<void>;
503
- _build_config(dim: number): QdrantEdgeConfig;
504
- _open_shard(path: string): QdrantShardHandle;
505
- _ensure_indexes(_shard: QdrantShardHandle): void;
506
- _record_to_point(record: MemoryRecord): QdrantPoint;
507
- _payload_to_record(payload: QdrantPoint["payload"] | Record<string, unknown>, vector?: Record<typeof VECTOR_NAME, readonly number[]> | null): MemoryRecord;
508
- _build_scope_filter(scope_prefix: string | null): QdrantScopeFilter | null;
509
- _scroll_all(shard: QdrantShardHandle, _filter?: QdrantScopeFilter | null, _with_vector?: boolean): QdrantPoint[];
510
- _delete_from_shard(shard: QdrantShardHandle, scope_prefix: string | null, categories: readonly string[] | null, record_ids: readonly string[] | null, older_than: Date | string | null, metadata_filter: Record<string, unknown> | null): number;
511
- _delete_from_shard_path(shard_path: string, scope_prefix: string | null, categories: readonly string[] | null, record_ids: readonly string[] | null, older_than: Date | string | null, metadata_filter: Record<string, unknown> | null): number;
512
- _upsert_to_central(points: readonly QdrantPoint[]): void;
513
- _cleanup_orphaned_shards(): void;
514
- }
515
- export type LanceDBStorageOptions = {
516
- path?: string | null;
517
- tableName?: string;
518
- table_name?: string;
519
- vectorDim?: number | null;
520
- vector_dim?: number | null;
521
- compactEvery?: number;
522
- compact_every?: number;
523
- };
524
- export type LanceDBRow = {
525
- id: string;
526
- content: string;
527
- scope: string;
528
- categories_str: string;
529
- metadata_str: string;
530
- importance: number;
531
- created_at: string;
532
- last_accessed: string;
533
- source: string;
534
- private: boolean;
535
- vector: readonly number[];
536
- };
537
- export declare class LanceDBStorage extends QdrantEdgeStorage {
538
- readonly tableName: string;
539
- readonly table_name: string;
540
- readonly compactEvery: number;
541
- readonly compact_every: number;
542
- _save_count: number;
543
- constructor(options?: string | LanceDBStorageOptions | null);
544
- save(records: MemoryRecord | MemoryRecordOptions | readonly (MemoryRecord | MemoryRecordOptions)[]): void;
545
- _infer_dim_from_table(table: {
546
- schema?: Iterable<{
547
- name?: string;
548
- type?: {
549
- list_size?: unknown;
550
- listSize?: unknown;
551
- };
552
- }>;
553
- }): number;
554
- _ensure_table(_vector_dim?: number | null): this;
555
- _create_table(vector_dim: number): this;
556
- _do_write(op: string, ...args: unknown[]): unknown;
557
- _ensure_scope_index(): void;
558
- _compact_if_needed(): void;
559
- _compact_async(): void;
560
- _compact_safe(): void;
561
- _record_to_row(record: MemoryRecord): LanceDBRow;
562
- _row_to_record(row: LanceDBRow | Record<string, unknown>): MemoryRecord;
563
- _scan_rows(scope_prefix?: string | null, limit?: number, columns?: readonly string[] | null): Record<string, unknown>[];
564
- }
565
- export declare class StorageBackend extends QdrantEdgeStorage {
566
- }
567
- export declare class RecallFlow {
568
- private readonly storage;
569
- private readonly llm;
570
- private readonly embedder;
571
- private readonly config;
572
- readonly _skip_auto_memory = true;
573
- readonly state: RecallState;
574
- constructor(storage: MemoryVectorStorageLike, llm?: unknown, embedder?: unknown, config?: MemoryConfig);
575
- analyze_query_step(): QueryAnalysis;
576
- analyzeQueryStep(): QueryAnalysis;
577
- private recallStorageListScopes;
578
- private recallStorageScopeInfo;
579
- private analyzeRecallQuerySync;
580
- private callRecallLLMSync;
581
- filter_and_chunk(): string[];
582
- filterAndChunk(): string[];
583
- _merged_categories(): readonly string[] | null;
584
- private mergedCategories;
585
- _search_one(embedding: readonly number[], scope: string): [string, Array<readonly [MemoryRecord, number]>];
586
- _do_search(): Array<{
587
- scope: string;
588
- results: Array<readonly [MemoryRecord, number]>;
589
- top_score: number;
590
- }>;
591
- private doSearch;
592
- search_chunks(): Array<{
593
- scope: string;
594
- results: Array<readonly [MemoryRecord, number]>;
595
- top_score: number;
596
- }>;
597
- searchChunks(): Array<{
598
- scope: string;
599
- results: Array<readonly [MemoryRecord, number]>;
600
- top_score: number;
601
- }>;
602
- decide_depth(): "explore_deeper" | "synthesize";
603
- decideDepth(): "explore_deeper" | "synthesize";
604
- recursive_exploration(): Array<{
605
- scope: string;
606
- extraction: unknown;
607
- results: unknown;
608
- }>;
609
- recursiveExploration(): Array<{
610
- scope: string;
611
- extraction: unknown;
612
- results: unknown;
613
- }>;
614
- re_search(): Array<{
615
- scope: string;
616
- results: Array<readonly [MemoryRecord, number]>;
617
- top_score: number;
618
- }>;
619
- reSearch(): Array<{
620
- scope: string;
621
- results: Array<readonly [MemoryRecord, number]>;
622
- top_score: number;
623
- }>;
624
- re_decide_depth(): "explore_deeper" | "synthesize";
625
- reDecideDepth(): "explore_deeper" | "synthesize";
626
- synthesize_results(): MemoryMatch[];
627
- synthesizeResults(): MemoryMatch[];
628
- kickoff(options?: {
629
- inputs?: Partial<RecallState>;
630
- }): MemoryMatch[];
631
- }
632
- export type MemoryInfo = {
633
- totalRecords: number;
634
- total_records: number;
635
- scopes: readonly string[] | readonly ScopeInfo[];
636
- categories: Record<string, number> | Record<string, {
637
- count: number;
638
- scopes: readonly string[];
639
- }>;
640
- readOnly: boolean;
641
- read_only: boolean;
642
- };
643
- export type MemoryTreeNode = {
644
- path: string;
645
- count: number;
646
- children: Record<string, MemoryTreeNode>;
647
- categories?: readonly string[];
648
- };
649
- export declare class Memory {
650
- readonly memoryKind = "memory";
651
- readonly memory_kind = "memory";
652
- readonly readOnly: boolean;
653
- readonly read_only: boolean;
654
- readonly rootScope: string | null;
655
- readonly root_scope: string | null;
656
- readonly llm: LLM | null;
657
- readonly embedder: unknown;
658
- private embedderInstance;
659
- private config;
660
- private readonly configOptions;
661
- private readonly records;
662
- private readonly pendingWrites;
663
- constructor(options?: MemoryOptions);
664
- modelPostInit(_context?: unknown): void;
665
- model_post_init(_context?: unknown): void;
666
- __deepcopy__(_memo?: Record<PropertyKey, unknown> | null): Memory;
667
- get _llm(): LLM | null;
668
- get _embedder(): unknown;
669
- _submit_save(fn: (...args: readonly unknown[]) => MemoryRecord[], ...args: readonly unknown[]): {
670
- result: () => MemoryRecord[];
671
- };
672
- _on_save_done(future: {
673
- exception?: () => unknown;
674
- } | null): void;
675
- _encode_batch(contents: readonly string[], scope?: string | null, categories?: readonly string[] | null, metadata?: Record<string, unknown> | null, importance?: number | null, source?: string | null, privateMemory?: boolean, rootScope?: string | null): MemoryRecord[];
676
- _background_encode_batch(contents: readonly string[], scope?: string | null, categories?: readonly string[] | null, metadata?: Record<string, unknown> | null, importance?: number | null, source?: string | null, privateMemory?: boolean, agentRole?: string | null, rootScope?: string | null): MemoryRecord[];
677
- remember(content: string, options?: {
678
- scope?: string | null;
679
- categories?: readonly string[] | null;
680
- metadata?: Record<string, unknown> | null;
681
- importance?: number | null;
682
- source?: string | null;
683
- private?: boolean;
684
- agentRole?: string | null;
685
- rootScope?: string | null;
686
- root_scope?: string | null;
687
- }): MemoryRecord | null;
688
- rememberMany(contents: readonly string[], options?: Parameters<Memory["remember"]>[1]): MemoryRecord[];
689
- remember_many(contents: readonly string[], options?: Parameters<Memory["remember"]>[1]): MemoryRecord[];
690
- aremember(content: string, options?: Parameters<Memory["remember"]>[1]): Promise<MemoryRecord | null>;
691
- private resolveSaveOptions;
692
- private resolveSaveOptionsSync;
693
- private findSimilarRecords;
694
- private applyConsolidationPlan;
695
- aremember_many(contents: readonly string[], options?: Parameters<Memory["remember"]>[1]): Promise<MemoryRecord[]>;
696
- extractMemories(content: string): readonly string[];
697
- extract_memories(content: string): readonly string[];
698
- aextract_memories(content: string): Promise<readonly string[]>;
699
- recall(query: string, options?: {
700
- scope?: string | null;
701
- categories?: readonly string[] | null;
702
- limit?: number;
703
- scoreThreshold?: number | null;
704
- source?: string | null;
705
- includePrivate?: boolean;
706
- depth?: "shallow" | "deep";
707
- }): MemoryMatch[];
708
- arecall(query: string, options?: Parameters<Memory["recall"]>[1]): Promise<MemoryMatch[]>;
709
- private touchRecords;
710
- private shallowRecall;
711
- private deepRecall;
712
- forget(options?: {
713
- scope?: string | null;
714
- categories?: readonly string[] | null;
715
- recordIds?: readonly string[] | null;
716
- record_ids?: readonly string[] | null;
717
- olderThan?: Date | string | null;
718
- older_than?: Date | string | null;
719
- metadataFilter?: Record<string, unknown> | null;
720
- metadata_filter?: Record<string, unknown> | null;
721
- }): number;
722
- get_record(recordId: string): MemoryRecord | null;
723
- getRecord(recordId: string): MemoryRecord | null;
724
- update(record: MemoryRecord | MemoryRecordOptions): MemoryRecord | null;
725
- update(recordId: string, updates: MemoryUpdateOptions): MemoryRecord | null;
726
- drainWrites(): void;
727
- drain_writes(): void;
728
- close(): void;
729
- reset(scope?: string | null | {
730
- scope_prefix?: string | null;
731
- scopePrefix?: string | null;
732
- }): void;
733
- scope(path: string): MemoryScope;
734
- slice(scopes: readonly string[] | string, options?: {
735
- categories?: readonly string[] | null;
736
- readOnly?: boolean;
737
- }): MemorySlice;
738
- listScopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
739
- listScopes(path: string | null): readonly string[];
740
- list_scopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
741
- list_scopes(path: string | null): readonly string[];
742
- listCategories(full?: boolean): Record<string, number> | Record<string, {
743
- count: number;
744
- scopes: readonly string[];
745
- }>;
746
- listCategories(path: string | null): Record<string, number>;
747
- list_categories(full?: boolean): Record<string, number> | Record<string, {
748
- count: number;
749
- scopes: readonly string[];
750
- }>;
751
- list_categories(path: string | null): Record<string, number>;
752
- listRecords(scope?: string | null, limit?: number, offset?: number): MemoryRecord[];
753
- list_records(scope?: string | null, limit?: number, offset?: number): MemoryRecord[];
754
- info(full?: boolean): MemoryInfo;
755
- info(path: string | null): ScopeInfo;
756
- tree(full?: boolean, maxDepth?: number): MemoryTreeNode;
757
- tree(path: string | null, maxDepth?: number): string;
758
- allRecords(): readonly MemoryRecord[];
759
- private runBackgroundSave;
760
- private runResolvedBackgroundSave;
761
- private applyBatchSavePlans;
762
- private createMemoryRecordFromResolvedItem;
763
- private embeddingForText;
764
- private attachBatchEmbeddings;
765
- private memoryVectorStorage;
766
- private scopePath;
767
- private effectivePath;
768
- private recordsForScope;
769
- private immediateChildScopes;
770
- private scopeInfoForPath;
771
- private formatTree;
772
- private scopeInfos;
773
- }
774
- export declare function embed_text(embedder: unknown, text: string): number[];
775
- export declare function embed_texts(embedder: unknown, texts: readonly string[]): number[][];
776
- export declare function compute_composite_score(record: MemoryRecord, semantic_score: number, config?: MemoryConfig): [number, string[]];
777
- export declare function sanitize_scope_name(name: unknown): string;
778
- export declare function normalize_scope_path(path: string): string;
779
- declare function buildScopeAncestors(scope: string): string[];
780
- export declare const _build_scope_ancestors: typeof buildScopeAncestors;
781
- export declare function _uuid_to_point_id(value: string): number;
782
- export declare function _parse_dt(value: unknown): Date;
783
- export declare const join_scope_paths: typeof joinScopePaths;
784
- type MemoryRememberOptions = NonNullable<Parameters<Memory["remember"]>[1]>;
785
- type MemoryRecallOptions = NonNullable<Parameters<Memory["recall"]>[1]>;
786
- type MemoryForgetOptions = NonNullable<Parameters<Memory["forget"]>[0]>;
787
- export declare function _ensure_memory_kind<T>(value: T): T;
788
- export declare function _walk(memory: Memory, lines: string[], path: string, depth: number, prefix: string, maxDepth: number): void;
789
- export declare class MemoryScope {
790
- readonly memoryKind = "scope";
791
- readonly memory_kind = "scope";
792
- memory: Memory | null;
793
- readonly rootPath: string;
794
- readonly root_path: string;
795
- constructor(memory: Memory | null, rootPath?: string);
796
- static _accept_memory(data: unknown): MemoryScope;
797
- get readOnly(): boolean;
798
- get read_only(): boolean;
799
- _requireMemory(): Memory;
800
- _require_memory(): Memory;
801
- _scopePath(scope?: string | null): string;
802
- _scope_path(scope?: string | null): string;
803
- remember(content: string, options?: MemoryRememberOptions): MemoryRecord | null;
804
- recall(query: string, options?: MemoryRecallOptions): MemoryMatch[];
805
- rememberMany(contents: readonly string[], options?: MemoryRememberOptions): MemoryRecord[];
806
- remember_many(contents: readonly string[], options?: MemoryRememberOptions): MemoryRecord[];
807
- extractMemories(content: string): readonly string[];
808
- extract_memories(content: string): readonly string[];
809
- forget(options?: MemoryForgetOptions): number;
810
- reset(scope?: string | null): void;
811
- listScopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
812
- listScopes(path: string | null): readonly string[];
813
- list_scopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
814
- list_scopes(path: string | null): readonly string[];
815
- info(full?: boolean): MemoryInfo;
816
- info(path: string | null): ScopeInfo;
817
- listCategories(full?: boolean): Record<string, number> | Record<string, {
818
- count: number;
819
- scopes: readonly string[];
820
- }>;
821
- listCategories(path: string | null): Record<string, number>;
822
- list_categories(full?: boolean): Record<string, number> | Record<string, {
823
- count: number;
824
- scopes: readonly string[];
825
- }>;
826
- list_categories(path: string | null): Record<string, number>;
827
- tree(full?: boolean, maxDepth?: number): MemoryTreeNode;
828
- tree(path: string | null, maxDepth?: number): string;
829
- subscope(path: string): MemoryScope;
830
- bind(memory: Memory): this;
831
- }
832
- export declare class MemorySlice {
833
- readonly memoryKind = "slice";
834
- readonly memory_kind = "slice";
835
- memory: Memory | null;
836
- readonly scopes: readonly string[];
837
- readonly categories: readonly string[] | null;
838
- private readonly readOnlyValue;
839
- constructor(memory: Memory | null, scopes: readonly string[], options?: {
840
- categories?: readonly string[] | null;
841
- readOnly?: boolean;
842
- });
843
- static _accept_memory(data: unknown): MemorySlice;
844
- get readOnly(): boolean;
845
- get read_only(): boolean;
846
- _requireMemory(): Memory;
847
- _require_memory(): Memory;
848
- remember(content: string, options?: MemoryRememberOptions): MemoryRecord | null;
849
- rememberMany(contents: readonly string[], options?: MemoryRememberOptions): MemoryRecord[];
850
- remember_many(contents: readonly string[], options?: MemoryRememberOptions): MemoryRecord[];
851
- recall(query: string, options?: Omit<MemoryRecallOptions, "scope">): MemoryMatch[];
852
- extractMemories(content: string): readonly string[];
853
- extract_memories(content: string): readonly string[];
854
- subscope(path: string): MemorySlice;
855
- listScopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
856
- listScopes(path: string | null): readonly string[];
857
- list_scopes(full?: boolean): readonly string[] | readonly ScopeInfo[];
858
- list_scopes(path: string | null): readonly string[];
859
- info(full?: boolean): MemoryInfo;
860
- info(path: string | null): ScopeInfo;
861
- listCategories(full?: boolean): Record<string, number> | Record<string, {
862
- count: number;
863
- scopes: readonly string[];
864
- }>;
865
- listCategories(path: string | null): Record<string, number>;
866
- list_categories(full?: boolean): Record<string, number> | Record<string, {
867
- count: number;
868
- scopes: readonly string[];
869
- }>;
870
- list_categories(path: string | null): Record<string, number>;
871
- tree(full?: boolean, maxDepth?: number): MemoryTreeNode;
872
- bind(memory: Memory): this;
873
- private recordsInSlice;
874
- private slicePath;
875
- }
876
- export declare const RecallMemorySchema: {
877
- queries: {
878
- type: "array";
879
- required: true;
880
- description: string;
881
- };
882
- };
883
- export declare class RecallMemoryTool extends BaseTool {
884
- readonly memory: Memory | MemoryScope | MemorySlice;
885
- constructor(options: Partial<BaseToolOptions> & {
886
- memory: Memory | MemoryScope | MemorySlice;
887
- });
888
- protected _run(args: Record<string, unknown>): string;
889
- }
890
- export declare const RememberSchema: {
891
- contents: {
892
- type: "array";
893
- required: true;
894
- description: string;
895
- };
896
- };
897
- export declare class RememberTool extends BaseTool {
898
- readonly memory: Memory | MemoryScope | MemorySlice;
899
- constructor(options: Partial<BaseToolOptions> & {
900
- memory: Memory | MemoryScope | MemorySlice;
901
- });
902
- protected _run(args: Record<string, unknown>): string;
903
- }
904
- export declare function createMemoryTools(memory: Memory | MemoryScope | MemorySlice): Tool[];
905
- export declare const create_memory_tools: typeof createMemoryTools;
906
- export declare function extractMemoriesFromContent(content: string, llm: LLM): Promise<readonly string[]>;
907
- export declare const extract_memories_from_content: typeof extractMemoriesFromContent;
908
- export declare function analyzeQuery(query: string, availableScopes: readonly string[], scopeInfo: ScopeInfo | null, llm: LLM): Promise<QueryAnalysis>;
909
- export declare const analyze_query: typeof analyzeQuery;
910
- export declare function analyzeForSave(content: string, existingScopes: readonly string[], existingCategories: readonly string[], llm: LLM): Promise<MemoryAnalysis>;
911
- export declare const analyze_for_save: typeof analyzeForSave;
912
- export declare function analyzeForConsolidation(newContent: string, existingRecords: readonly MemoryRecord[], llm: LLM): Promise<ConsolidationPlan>;
913
- export declare const analyze_for_consolidation: typeof analyzeForConsolidation;
914
- export declare function joinScopePaths(root: string | null | undefined, child: string | null | undefined): string;
915
- export {};