@poprobertdaniel/openclaw-memory 0.1.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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +410 -0
  3. package/dist/chunk-CRPEAZ44.cjs +1881 -0
  4. package/dist/chunk-CRPEAZ44.cjs.map +1 -0
  5. package/dist/chunk-JNWCMHOB.js +309 -0
  6. package/dist/chunk-JNWCMHOB.js.map +1 -0
  7. package/dist/chunk-JSQBXYDM.js +1881 -0
  8. package/dist/chunk-JSQBXYDM.js.map +1 -0
  9. package/dist/chunk-NHFPLDZK.js +236 -0
  10. package/dist/chunk-NHFPLDZK.js.map +1 -0
  11. package/dist/chunk-NMUPGLJW.cjs +752 -0
  12. package/dist/chunk-NMUPGLJW.cjs.map +1 -0
  13. package/dist/chunk-RFLG2CCR.js +752 -0
  14. package/dist/chunk-RFLG2CCR.js.map +1 -0
  15. package/dist/chunk-VXULEX3A.cjs +236 -0
  16. package/dist/chunk-VXULEX3A.cjs.map +1 -0
  17. package/dist/chunk-ZY2C2CJQ.cjs +309 -0
  18. package/dist/chunk-ZY2C2CJQ.cjs.map +1 -0
  19. package/dist/cli/index.cjs +764 -0
  20. package/dist/cli/index.cjs.map +1 -0
  21. package/dist/cli/index.d.cts +1 -0
  22. package/dist/cli/index.d.ts +1 -0
  23. package/dist/cli/index.js +764 -0
  24. package/dist/cli/index.js.map +1 -0
  25. package/dist/index.cjs +48 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.cts +790 -0
  28. package/dist/index.d.ts +790 -0
  29. package/dist/index.js +48 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/memory-service-6WDMF6KX.cjs +9 -0
  32. package/dist/memory-service-6WDMF6KX.cjs.map +1 -0
  33. package/dist/memory-service-GKEG6J2D.js +9 -0
  34. package/dist/memory-service-GKEG6J2D.js.map +1 -0
  35. package/dist/server-BTbRv-yX.d.cts +1199 -0
  36. package/dist/server-BTbRv-yX.d.ts +1199 -0
  37. package/dist/server.cjs +9 -0
  38. package/dist/server.cjs.map +1 -0
  39. package/dist/server.d.cts +2 -0
  40. package/dist/server.d.ts +2 -0
  41. package/dist/server.js +9 -0
  42. package/dist/server.js.map +1 -0
  43. package/docker/full.yml +45 -0
  44. package/docker/standard.yml +26 -0
  45. package/package.json +109 -0
  46. package/skill/SKILL.md +139 -0
  47. package/templates/.env.example +42 -0
  48. package/templates/docker-compose.full.yml +45 -0
  49. package/templates/docker-compose.standard.yml +26 -0
  50. package/templates/openclaw-memory.config.ts +49 -0
@@ -0,0 +1,1199 @@
1
+ import * as elysia from 'elysia';
2
+
3
+ type MemoryScope = "user" | "agent" | "global" | "project" | "session";
4
+ type MemorySource = "explicit" | "derived" | "observation" | "conversation_summary" | "entity_extraction" | "daily_digest" | "migration";
5
+ type EntityType = "Person" | "Project" | "Organization" | "Decision" | "Preference" | "Event" | "Tool" | "Location" | "Concept";
6
+ type RelationshipType = "WORKS_ON" | "DECIDED" | "PREFERS" | "KNOWS" | "USES" | "LOCATED_AT" | "BELONGS_TO" | "MENTIONED_IN" | "RELATED_TO" | "CREATED_BY" | "DEPENDS_ON";
7
+ type Tier = "lite" | "standard" | "full";
8
+ interface ExtractedEntity {
9
+ name: string;
10
+ type: EntityType;
11
+ properties: Record<string, string>;
12
+ }
13
+ interface ExtractedRelationship {
14
+ from_entity: string;
15
+ to_entity: string;
16
+ relationship: RelationshipType;
17
+ properties: Record<string, string>;
18
+ }
19
+ interface ExtractionResult {
20
+ entities: ExtractedEntity[];
21
+ relationships: ExtractedRelationship[];
22
+ }
23
+ interface Memory {
24
+ id: string;
25
+ agent_id: string;
26
+ scope: MemoryScope;
27
+ subject_id: string | null;
28
+ content: string;
29
+ tags: string[];
30
+ entities: ExtractedEntity[];
31
+ source: MemorySource;
32
+ created_by: string | null;
33
+ created_at: string;
34
+ updated_at: string;
35
+ expires_at: string | null;
36
+ embedding_hash: string | null;
37
+ }
38
+ interface CreateMemoryRequest {
39
+ agent_id: string;
40
+ scope: MemoryScope;
41
+ subject_id?: string | null;
42
+ content: string;
43
+ tags?: string[];
44
+ source?: MemorySource;
45
+ created_by?: string | null;
46
+ extract_entities?: boolean;
47
+ expires_at?: string | null;
48
+ }
49
+ interface UpdateMemoryRequest {
50
+ content?: string;
51
+ tags?: string[];
52
+ scope?: MemoryScope;
53
+ subject_id?: string | null;
54
+ expires_at?: string | null;
55
+ extract_entities?: boolean;
56
+ }
57
+ interface SearchRequest {
58
+ agent_id: string;
59
+ query: string;
60
+ scopes?: MemoryScope[];
61
+ subject_id?: string | null;
62
+ limit?: number;
63
+ include_graph?: boolean;
64
+ cross_agent?: boolean;
65
+ strategy?: "auto" | "semantic" | "fulltext" | "graph" | "all";
66
+ }
67
+ interface ScoredMemory {
68
+ memory: Memory;
69
+ score: number;
70
+ source_layer: "sqlite" | "qdrant" | "age";
71
+ graph_context?: {
72
+ related_entities: Array<{
73
+ type: EntityType;
74
+ name: string;
75
+ relationship: string;
76
+ }>;
77
+ };
78
+ }
79
+ interface SearchResponse {
80
+ results: ScoredMemory[];
81
+ strategy_used: string;
82
+ layer_stats: {
83
+ sqlite: {
84
+ count: number;
85
+ ms: number;
86
+ };
87
+ qdrant: {
88
+ count: number;
89
+ ms: number;
90
+ };
91
+ age: {
92
+ count: number;
93
+ ms: number;
94
+ };
95
+ };
96
+ }
97
+ interface SyncStatus {
98
+ sqlite: "ok";
99
+ qdrant: "ok" | "queued" | "failed" | "disabled";
100
+ age: "ok" | "queued" | "failed" | "disabled";
101
+ }
102
+ interface CreateMemoryResponse {
103
+ id: string;
104
+ agent_id: string;
105
+ scope: MemoryScope;
106
+ content: string;
107
+ tags?: string[];
108
+ entities: ExtractedEntity[];
109
+ created_at: string;
110
+ updated_at?: string;
111
+ sync_status: SyncStatus;
112
+ }
113
+ interface ConversationLogEntry {
114
+ agent_id: string;
115
+ session_id: string;
116
+ user_id: string;
117
+ channel: string;
118
+ role: string;
119
+ content: string;
120
+ timestamp: string;
121
+ }
122
+ interface SummarizeRequest {
123
+ agent_id: string;
124
+ session_id: string;
125
+ user_id: string;
126
+ channel: string;
127
+ messages: Array<{
128
+ role: "user" | "assistant" | "system";
129
+ content: string;
130
+ timestamp: string;
131
+ }>;
132
+ reason?: string;
133
+ }
134
+ interface SummarizeResponse {
135
+ memory_id: string;
136
+ summary: string;
137
+ entities_extracted: ExtractedEntity[];
138
+ relationships_created: number;
139
+ }
140
+ interface HealthResponse {
141
+ sqlite: "ok" | "error" | "disabled";
142
+ qdrant: "ok" | "error" | "disabled";
143
+ age: "ok" | "error" | "disabled";
144
+ tier: Tier;
145
+ uptime: number;
146
+ details?: Record<string, string>;
147
+ }
148
+ interface SyncQueueItem {
149
+ id: number;
150
+ memory_id: string;
151
+ layer: "qdrant" | "age";
152
+ operation: "upsert" | "delete";
153
+ attempts: number;
154
+ last_error: string | null;
155
+ created_at: string;
156
+ }
157
+ interface ListMemoriesQuery {
158
+ agent_id?: string;
159
+ scope?: MemoryScope;
160
+ subject_id?: string;
161
+ source?: MemorySource;
162
+ tags?: string;
163
+ limit?: number;
164
+ offset?: number;
165
+ order?: "asc" | "desc";
166
+ }
167
+ interface MigrateMarkdownRequest {
168
+ markdown_paths: string[];
169
+ agent_id: string;
170
+ dry_run?: boolean;
171
+ }
172
+ interface StoreParams {
173
+ agentId: string;
174
+ scope: MemoryScope;
175
+ subjectId?: string | null;
176
+ content: string;
177
+ tags?: string[];
178
+ source?: MemorySource;
179
+ createdBy?: string | null;
180
+ extractEntities?: boolean;
181
+ expiresAt?: string | null;
182
+ }
183
+ interface StoreResult {
184
+ id: string;
185
+ agentId: string;
186
+ scope: MemoryScope;
187
+ content: string;
188
+ entities: ExtractedEntity[];
189
+ createdAt: string;
190
+ syncStatus: {
191
+ sqlite: "ok";
192
+ qdrant: "ok" | "queued" | "failed" | "disabled";
193
+ age: "ok" | "queued" | "failed" | "disabled";
194
+ };
195
+ }
196
+ interface SearchParams {
197
+ agentId: string;
198
+ query: string;
199
+ scopes?: MemoryScope[];
200
+ subjectId?: string | null;
201
+ limit?: number;
202
+ includeGraph?: boolean;
203
+ crossAgent?: boolean;
204
+ strategy?: "auto" | "semantic" | "fulltext" | "graph" | "all";
205
+ }
206
+ interface UpdateParams {
207
+ content?: string;
208
+ tags?: string[];
209
+ scope?: MemoryScope;
210
+ subjectId?: string | null;
211
+ expiresAt?: string | null;
212
+ extractEntities?: boolean;
213
+ }
214
+ interface ListParams {
215
+ agentId?: string;
216
+ scope?: MemoryScope;
217
+ subjectId?: string;
218
+ source?: MemorySource;
219
+ tags?: string;
220
+ limit?: number;
221
+ offset?: number;
222
+ order?: "asc" | "desc";
223
+ }
224
+ interface TierCapabilities {
225
+ sqlite: true;
226
+ qdrant: boolean;
227
+ age: boolean;
228
+ embeddings: boolean;
229
+ extraction: boolean;
230
+ }
231
+ declare const TIER_CAPABILITIES: Record<Tier, TierCapabilities>;
232
+
233
+ interface SqliteConfig {
234
+ path: string;
235
+ }
236
+ interface QdrantConfig {
237
+ url: string;
238
+ collection: string;
239
+ apiKey?: string;
240
+ }
241
+ interface AgeConfig {
242
+ host: string;
243
+ port: number;
244
+ user: string;
245
+ password: string;
246
+ database: string;
247
+ graph: string;
248
+ }
249
+ interface EmbeddingConfig$1 {
250
+ apiKey: string;
251
+ baseUrl?: string;
252
+ model: string;
253
+ dimensions: number;
254
+ }
255
+ interface ExtractionConfig$1 {
256
+ apiKey: string;
257
+ baseUrl?: string;
258
+ model: string;
259
+ enabled: boolean;
260
+ }
261
+ interface AuthConfig {
262
+ token?: string;
263
+ enabled: boolean;
264
+ }
265
+ interface AgentConfig {
266
+ id: string;
267
+ name: string;
268
+ role?: string;
269
+ crossAgentRead?: boolean;
270
+ }
271
+ interface Config {
272
+ tier?: Tier;
273
+ port?: number;
274
+ host?: string;
275
+ auth?: Partial<AuthConfig>;
276
+ sqlite?: Partial<SqliteConfig>;
277
+ qdrant?: Partial<QdrantConfig> & {
278
+ url: string;
279
+ };
280
+ age?: Partial<AgeConfig> & {
281
+ host: string;
282
+ user: string;
283
+ password: string;
284
+ database: string;
285
+ };
286
+ embedding?: Partial<EmbeddingConfig$1> & {
287
+ apiKey: string;
288
+ };
289
+ extraction?: Partial<ExtractionConfig$1> & {
290
+ apiKey: string;
291
+ };
292
+ agents?: AgentConfig[];
293
+ }
294
+ interface ResolvedConfig {
295
+ tier: Tier;
296
+ port: number;
297
+ host: string;
298
+ auth: AuthConfig;
299
+ sqlite: SqliteConfig;
300
+ qdrant: QdrantConfig | null;
301
+ age: AgeConfig | null;
302
+ embedding: EmbeddingConfig$1 | null;
303
+ extraction: ExtractionConfig$1 | null;
304
+ agents: AgentConfig[];
305
+ }
306
+
307
+ declare class SqliteStorage {
308
+ private db;
309
+ constructor(dbPath: string);
310
+ private initSchema;
311
+ createMemory(memory: Memory): Memory;
312
+ getMemory(id: string): Memory | null;
313
+ updateMemory(id: string, updates: Partial<Memory>): Memory | null;
314
+ deleteMemory(id: string): boolean;
315
+ listMemories(query: ListMemoriesQuery): Memory[];
316
+ searchFullText(query: string, agentId?: string, scopes?: MemoryScope[], subjectId?: string | null, limit?: number): Array<Memory & {
317
+ fts_rank: number;
318
+ }>;
319
+ appendConversationLog(entry: ConversationLogEntry): void;
320
+ getConversationLog(agentId: string, sessionId: string, limit?: number): ConversationLogEntry[];
321
+ addToSyncQueue(memoryId: string, layer: "qdrant" | "age", operation: "upsert" | "delete"): void;
322
+ getSyncQueue(limit?: number): SyncQueueItem[];
323
+ updateSyncQueueItem(id: number, attempts: number, lastError: string | null): void;
324
+ removeSyncQueueItem(id: number): void;
325
+ clearCompletedSyncItems(): number;
326
+ getMemoryCount(): number;
327
+ getDatabaseSize(): number;
328
+ healthCheck(): boolean;
329
+ private rowToMemory;
330
+ close(): void;
331
+ }
332
+
333
+ interface QdrantStorageConfig {
334
+ url: string;
335
+ collection: string;
336
+ apiKey?: string;
337
+ }
338
+ declare class QdrantStorage {
339
+ private client;
340
+ private collection;
341
+ private config;
342
+ private ready;
343
+ constructor(config: QdrantStorageConfig);
344
+ private getClient;
345
+ ensureCollection(vectorSize?: number): Promise<void>;
346
+ upsertMemory(memory: Memory, vector: number[]): Promise<void>;
347
+ deleteMemory(id: string): Promise<void>;
348
+ search(queryVector: number[], agentId?: string, scopes?: MemoryScope[], subjectId?: string | null, limit?: number, crossAgent?: boolean): Promise<ScoredMemory[]>;
349
+ healthCheck(): Promise<boolean>;
350
+ getCollectionInfo(): Promise<{
351
+ vectorCount: number;
352
+ } | null>;
353
+ private buildFilter;
354
+ private payloadToMemory;
355
+ }
356
+
357
+ interface AgeStorageConfig {
358
+ host: string;
359
+ port: number;
360
+ user: string;
361
+ password: string;
362
+ database: string;
363
+ graph: string;
364
+ }
365
+ declare class AgeStorage {
366
+ private pool;
367
+ private config;
368
+ private graph;
369
+ private initialized;
370
+ constructor(config: AgeStorageConfig);
371
+ private getPool;
372
+ ensureGraph(): Promise<void>;
373
+ private cypherQuery;
374
+ private cypherExec;
375
+ upsertMemoryNode(memory: Memory): Promise<void>;
376
+ upsertEntityNode(entity: ExtractedEntity, agentId: string): Promise<string>;
377
+ createRelationship(rel: ExtractedRelationship, agentId: string): Promise<void>;
378
+ linkMemoryToEntity(memoryId: string, entityId: string): Promise<void>;
379
+ deleteMemoryNode(memoryId: string): Promise<void>;
380
+ getEntityWithRelationships(entityType: string, entityId: string): Promise<{
381
+ entity: Record<string, unknown> | null;
382
+ relationships: Array<{
383
+ type: string;
384
+ direction: string;
385
+ target: Record<string, unknown>;
386
+ }>;
387
+ }>;
388
+ getRelatedEntities(entityId: string, depth?: number): Promise<Array<{
389
+ entity: Record<string, unknown>;
390
+ relationship: string;
391
+ distance: number;
392
+ }>>;
393
+ searchByEntity(entityName: string, entityType?: string, agentId?: string, limit?: number): Promise<ScoredMemory[]>;
394
+ private searchByEntityNameFuzzy;
395
+ listEntities(entityType?: string, agentId?: string, limit?: number): Promise<Array<Record<string, unknown>>>;
396
+ ensureAgentNode(agentId: string, name: string, role: string): Promise<void>;
397
+ getStats(): Promise<{
398
+ entityCount: number;
399
+ relationshipCount: number;
400
+ } | null>;
401
+ healthCheck(): Promise<boolean>;
402
+ close(): Promise<void>;
403
+ private parseAgtype;
404
+ private propsToMemory;
405
+ private graphResultToScoredMemory;
406
+ private guessEntityType;
407
+ }
408
+
409
+ interface EmbeddingConfig {
410
+ apiKey: string;
411
+ baseUrl?: string;
412
+ model: string;
413
+ dimensions: number;
414
+ }
415
+ declare class EmbeddingService {
416
+ private client;
417
+ private model;
418
+ private dimensions;
419
+ constructor(config: EmbeddingConfig);
420
+ embed(text: string): Promise<number[] | null>;
421
+ embedBatch(texts: string[]): Promise<(number[] | null)[]>;
422
+ getDimensions(): number;
423
+ }
424
+
425
+ interface ExtractionConfig {
426
+ apiKey: string;
427
+ baseUrl?: string;
428
+ model: string;
429
+ enabled: boolean;
430
+ }
431
+ declare class EntityExtractor {
432
+ private client;
433
+ private model;
434
+ constructor(config: ExtractionConfig);
435
+ extract(text: string): Promise<ExtractionResult>;
436
+ private validateExtractionResult;
437
+ }
438
+
439
+ declare class StorageOrchestrator {
440
+ readonly tier: Tier;
441
+ readonly sqlite: SqliteStorage;
442
+ readonly qdrant: QdrantStorage | null;
443
+ readonly age: AgeStorage | null;
444
+ readonly embeddings: EmbeddingService | null;
445
+ readonly entityExtractor: EntityExtractor | null;
446
+ private syncProcessor;
447
+ private startTime;
448
+ constructor(config: ResolvedConfig);
449
+ init(): Promise<void>;
450
+ createMemory(req: CreateMemoryRequest): Promise<CreateMemoryResponse>;
451
+ updateMemory(id: string, req: UpdateMemoryRequest): Promise<CreateMemoryResponse | null>;
452
+ deleteMemory(id: string): Promise<boolean>;
453
+ healthCheck(): Promise<HealthResponse>;
454
+ retrySyncQueue(): Promise<{
455
+ processed: number;
456
+ succeeded: number;
457
+ failed: number;
458
+ }>;
459
+ close(): Promise<void>;
460
+ private asyncL2Upsert;
461
+ private asyncL3Upsert;
462
+ }
463
+
464
+ declare function createServer(configPath?: string): Promise<{
465
+ app: elysia.default<"", {
466
+ decorator: {};
467
+ store: {};
468
+ derive: {};
469
+ resolve: {};
470
+ }, {
471
+ typebox: {};
472
+ error: {};
473
+ } & {
474
+ typebox: {};
475
+ error: {};
476
+ }, {
477
+ schema: {};
478
+ standaloneSchema: {};
479
+ macro: {};
480
+ macroFn: {};
481
+ parser: {};
482
+ response: {};
483
+ } & {
484
+ schema: {};
485
+ standaloneSchema: {};
486
+ macro: {};
487
+ macroFn: {};
488
+ parser: {};
489
+ response: {};
490
+ }, {
491
+ api: {
492
+ memories: {
493
+ post: {
494
+ body: {
495
+ subject_id?: string | null | undefined;
496
+ tags?: string[] | undefined;
497
+ source?: "explicit" | "derived" | "observation" | "conversation_summary" | "entity_extraction" | "daily_digest" | "migration" | undefined;
498
+ created_by?: string | null | undefined;
499
+ expires_at?: string | null | undefined;
500
+ extract_entities?: boolean | undefined;
501
+ agent_id: string;
502
+ scope: "user" | "agent" | "global" | "project" | "session";
503
+ content: string;
504
+ };
505
+ params: {};
506
+ query: unknown;
507
+ headers: unknown;
508
+ response: {
509
+ 200: CreateMemoryResponse | {
510
+ error: string;
511
+ details: string;
512
+ };
513
+ 422: {
514
+ type: "validation";
515
+ on: string;
516
+ summary?: string;
517
+ message?: string;
518
+ found?: unknown;
519
+ property?: string;
520
+ expected?: string;
521
+ };
522
+ };
523
+ };
524
+ };
525
+ };
526
+ } & {
527
+ api: {
528
+ memories: {
529
+ ":id": {
530
+ get: {
531
+ body: unknown;
532
+ params: {
533
+ id: string;
534
+ } & {};
535
+ query: unknown;
536
+ headers: unknown;
537
+ response: {
538
+ 200: Memory | {
539
+ error: string;
540
+ };
541
+ 422: {
542
+ type: "validation";
543
+ on: string;
544
+ summary?: string;
545
+ message?: string;
546
+ found?: unknown;
547
+ property?: string;
548
+ expected?: string;
549
+ };
550
+ };
551
+ };
552
+ };
553
+ };
554
+ };
555
+ } & {
556
+ api: {
557
+ memories: {
558
+ ":id": {
559
+ put: {
560
+ body: {
561
+ scope?: "user" | "agent" | "global" | "project" | "session" | undefined;
562
+ subject_id?: string | null | undefined;
563
+ content?: string | undefined;
564
+ tags?: string[] | undefined;
565
+ expires_at?: string | null | undefined;
566
+ extract_entities?: boolean | undefined;
567
+ };
568
+ params: {
569
+ id: string;
570
+ } & {};
571
+ query: unknown;
572
+ headers: unknown;
573
+ response: {
574
+ 200: CreateMemoryResponse | {
575
+ error: string;
576
+ details?: undefined;
577
+ } | {
578
+ error: string;
579
+ details: string;
580
+ };
581
+ 422: {
582
+ type: "validation";
583
+ on: string;
584
+ summary?: string;
585
+ message?: string;
586
+ found?: unknown;
587
+ property?: string;
588
+ expected?: string;
589
+ };
590
+ };
591
+ };
592
+ };
593
+ };
594
+ };
595
+ } & {
596
+ api: {
597
+ memories: {
598
+ ":id": {
599
+ delete: {
600
+ body: unknown;
601
+ params: {
602
+ id: string;
603
+ } & {};
604
+ query: unknown;
605
+ headers: unknown;
606
+ response: {
607
+ 200: {
608
+ error: string;
609
+ deleted?: undefined;
610
+ id?: undefined;
611
+ details?: undefined;
612
+ } | {
613
+ deleted: boolean;
614
+ id: string;
615
+ error?: undefined;
616
+ details?: undefined;
617
+ } | {
618
+ error: string;
619
+ details: string;
620
+ deleted?: undefined;
621
+ id?: undefined;
622
+ };
623
+ 422: {
624
+ type: "validation";
625
+ on: string;
626
+ summary?: string;
627
+ message?: string;
628
+ found?: unknown;
629
+ property?: string;
630
+ expected?: string;
631
+ };
632
+ };
633
+ };
634
+ };
635
+ };
636
+ };
637
+ } & {
638
+ api: {
639
+ memories: {
640
+ get: {
641
+ body: unknown;
642
+ params: {};
643
+ query: unknown;
644
+ headers: unknown;
645
+ response: {
646
+ 200: {
647
+ memories: Memory[];
648
+ count: number;
649
+ };
650
+ };
651
+ };
652
+ };
653
+ };
654
+ } & {
655
+ api: {
656
+ search: {
657
+ post: {
658
+ body: {
659
+ agent_id?: string | undefined;
660
+ subject_id?: string | null | undefined;
661
+ limit?: number | undefined;
662
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
663
+ include_graph?: boolean | undefined;
664
+ cross_agent?: boolean | undefined;
665
+ strategy?: "auto" | "semantic" | "fulltext" | "graph" | "all" | undefined;
666
+ query: string;
667
+ };
668
+ params: {};
669
+ query: unknown;
670
+ headers: unknown;
671
+ response: {
672
+ 200: SearchResponse | {
673
+ error: string;
674
+ details: string;
675
+ };
676
+ 422: {
677
+ type: "validation";
678
+ on: string;
679
+ summary?: string;
680
+ message?: string;
681
+ found?: unknown;
682
+ property?: string;
683
+ expected?: string;
684
+ };
685
+ };
686
+ };
687
+ };
688
+ };
689
+ } & {
690
+ api: {
691
+ search: {
692
+ semantic: {
693
+ post: {
694
+ body: {
695
+ agent_id?: string | undefined;
696
+ subject_id?: string | null | undefined;
697
+ limit?: number | undefined;
698
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
699
+ cross_agent?: boolean | undefined;
700
+ query: string;
701
+ };
702
+ params: {};
703
+ query: unknown;
704
+ headers: unknown;
705
+ response: {
706
+ 200: SearchResponse | {
707
+ error: string;
708
+ details: string;
709
+ };
710
+ 422: {
711
+ type: "validation";
712
+ on: string;
713
+ summary?: string;
714
+ message?: string;
715
+ found?: unknown;
716
+ property?: string;
717
+ expected?: string;
718
+ };
719
+ };
720
+ };
721
+ };
722
+ };
723
+ };
724
+ } & {
725
+ api: {
726
+ search: {
727
+ graph: {
728
+ post: {
729
+ body: {
730
+ agent_id?: string | undefined;
731
+ subject_id?: string | null | undefined;
732
+ limit?: number | undefined;
733
+ scopes?: ("user" | "agent" | "global" | "project" | "session")[] | undefined;
734
+ query: string;
735
+ };
736
+ params: {};
737
+ query: unknown;
738
+ headers: unknown;
739
+ response: {
740
+ 200: SearchResponse | {
741
+ error: string;
742
+ details: string;
743
+ };
744
+ 422: {
745
+ type: "validation";
746
+ on: string;
747
+ summary?: string;
748
+ message?: string;
749
+ found?: unknown;
750
+ property?: string;
751
+ expected?: string;
752
+ };
753
+ };
754
+ };
755
+ };
756
+ };
757
+ };
758
+ } & {
759
+ api: {
760
+ search: {
761
+ fulltext: {
762
+ post: {
763
+ body: {
764
+ agent_id?: string | undefined;
765
+ subject_id?: string | null | undefined;
766
+ limit?: number | undefined;
767
+ scopes?: string[] | undefined;
768
+ query: string;
769
+ };
770
+ params: {};
771
+ query: unknown;
772
+ headers: unknown;
773
+ response: {
774
+ 200: SearchResponse | {
775
+ error: string;
776
+ details: string;
777
+ };
778
+ 422: {
779
+ type: "validation";
780
+ on: string;
781
+ summary?: string;
782
+ message?: string;
783
+ found?: unknown;
784
+ property?: string;
785
+ expected?: string;
786
+ };
787
+ };
788
+ };
789
+ };
790
+ };
791
+ };
792
+ } & {
793
+ api: {
794
+ conversations: {
795
+ log: {
796
+ post: {
797
+ body: {
798
+ agent_id: string;
799
+ content: string;
800
+ session_id: string;
801
+ user_id: string;
802
+ channel: string;
803
+ role: "user" | "assistant" | "system";
804
+ timestamp: string;
805
+ };
806
+ params: {};
807
+ query: unknown;
808
+ headers: unknown;
809
+ response: {
810
+ 200: {
811
+ ok: boolean;
812
+ error?: undefined;
813
+ details?: undefined;
814
+ } | {
815
+ error: string;
816
+ details: string;
817
+ ok?: undefined;
818
+ };
819
+ 422: {
820
+ type: "validation";
821
+ on: string;
822
+ summary?: string;
823
+ message?: string;
824
+ found?: unknown;
825
+ property?: string;
826
+ expected?: string;
827
+ };
828
+ };
829
+ };
830
+ };
831
+ };
832
+ };
833
+ } & {
834
+ api: {
835
+ conversations: {
836
+ summarize: {
837
+ post: {
838
+ body: {
839
+ reason?: string | undefined;
840
+ agent_id: string;
841
+ session_id: string;
842
+ user_id: string;
843
+ channel: string;
844
+ messages: {
845
+ content: string;
846
+ role: "user" | "assistant" | "system";
847
+ timestamp: string;
848
+ }[];
849
+ };
850
+ params: {};
851
+ query: unknown;
852
+ headers: unknown;
853
+ response: {
854
+ 200: SummarizeResponse | {
855
+ error: string;
856
+ details?: undefined;
857
+ } | {
858
+ error: string;
859
+ details: string;
860
+ };
861
+ 422: {
862
+ type: "validation";
863
+ on: string;
864
+ summary?: string;
865
+ message?: string;
866
+ found?: unknown;
867
+ property?: string;
868
+ expected?: string;
869
+ };
870
+ };
871
+ };
872
+ };
873
+ };
874
+ };
875
+ } & {
876
+ api: {
877
+ entities: {
878
+ ":type": {
879
+ get: {
880
+ body: unknown;
881
+ params: {
882
+ type: string;
883
+ } & {};
884
+ query: unknown;
885
+ headers: unknown;
886
+ response: {
887
+ 200: {
888
+ error: string;
889
+ entities?: undefined;
890
+ count?: undefined;
891
+ details?: undefined;
892
+ } | {
893
+ entities: Record<string, unknown>[];
894
+ count: number;
895
+ error?: undefined;
896
+ details?: undefined;
897
+ } | {
898
+ error: string;
899
+ details: string;
900
+ entities?: undefined;
901
+ count?: undefined;
902
+ };
903
+ 422: {
904
+ type: "validation";
905
+ on: string;
906
+ summary?: string;
907
+ message?: string;
908
+ found?: unknown;
909
+ property?: string;
910
+ expected?: string;
911
+ };
912
+ };
913
+ };
914
+ };
915
+ };
916
+ };
917
+ } & {
918
+ api: {
919
+ entities: {
920
+ ":type": {
921
+ ":id": {
922
+ get: {
923
+ body: unknown;
924
+ params: {
925
+ id: string;
926
+ type: string;
927
+ } & {};
928
+ query: unknown;
929
+ headers: unknown;
930
+ response: {
931
+ 200: {
932
+ entity: Record<string, unknown> | null;
933
+ relationships: Array<{
934
+ type: string;
935
+ direction: string;
936
+ target: Record<string, unknown>;
937
+ }>;
938
+ } | {
939
+ error: string;
940
+ details?: undefined;
941
+ } | {
942
+ error: string;
943
+ details: string;
944
+ };
945
+ 422: {
946
+ type: "validation";
947
+ on: string;
948
+ summary?: string;
949
+ message?: string;
950
+ found?: unknown;
951
+ property?: string;
952
+ expected?: string;
953
+ };
954
+ };
955
+ };
956
+ };
957
+ };
958
+ };
959
+ };
960
+ } & {
961
+ api: {
962
+ entities: {
963
+ ":type": {
964
+ ":id": {
965
+ related: {
966
+ get: {
967
+ body: unknown;
968
+ params: {
969
+ id: string;
970
+ type: string;
971
+ } & {};
972
+ query: unknown;
973
+ headers: unknown;
974
+ response: {
975
+ 200: {
976
+ error: string;
977
+ related?: undefined;
978
+ count?: undefined;
979
+ details?: undefined;
980
+ } | {
981
+ related: {
982
+ entity: Record<string, unknown>;
983
+ relationship: string;
984
+ distance: number;
985
+ }[];
986
+ count: number;
987
+ error?: undefined;
988
+ details?: undefined;
989
+ } | {
990
+ error: string;
991
+ details: string;
992
+ related?: undefined;
993
+ count?: undefined;
994
+ };
995
+ 422: {
996
+ type: "validation";
997
+ on: string;
998
+ summary?: string;
999
+ message?: string;
1000
+ found?: unknown;
1001
+ property?: string;
1002
+ expected?: string;
1003
+ };
1004
+ };
1005
+ };
1006
+ };
1007
+ };
1008
+ };
1009
+ };
1010
+ };
1011
+ } & {
1012
+ api: {
1013
+ entities: {
1014
+ extract: {
1015
+ post: {
1016
+ body: {
1017
+ text: string;
1018
+ };
1019
+ params: {};
1020
+ query: unknown;
1021
+ headers: unknown;
1022
+ response: {
1023
+ 200: ExtractionResult | {
1024
+ error: string;
1025
+ details?: undefined;
1026
+ } | {
1027
+ error: string;
1028
+ details: string;
1029
+ };
1030
+ 422: {
1031
+ type: "validation";
1032
+ on: string;
1033
+ summary?: string;
1034
+ message?: string;
1035
+ found?: unknown;
1036
+ property?: string;
1037
+ expected?: string;
1038
+ };
1039
+ };
1040
+ };
1041
+ };
1042
+ };
1043
+ };
1044
+ } & {
1045
+ api: {
1046
+ health: {
1047
+ get: {
1048
+ body: unknown;
1049
+ params: {};
1050
+ query: unknown;
1051
+ headers: unknown;
1052
+ response: {
1053
+ 200: HealthResponse;
1054
+ };
1055
+ };
1056
+ };
1057
+ };
1058
+ } & {
1059
+ api: {
1060
+ sync: {
1061
+ retry: {
1062
+ post: {
1063
+ body: unknown;
1064
+ params: {};
1065
+ query: unknown;
1066
+ headers: unknown;
1067
+ response: {
1068
+ 200: {
1069
+ processed: number;
1070
+ succeeded: number;
1071
+ failed: number;
1072
+ } | {
1073
+ error: string;
1074
+ details: string;
1075
+ };
1076
+ };
1077
+ };
1078
+ };
1079
+ };
1080
+ };
1081
+ } & {
1082
+ api: {
1083
+ sync: {
1084
+ queue: {
1085
+ get: {
1086
+ body: unknown;
1087
+ params: {};
1088
+ query: unknown;
1089
+ headers: unknown;
1090
+ response: {
1091
+ 200: {
1092
+ items: SyncQueueItem[];
1093
+ count: number;
1094
+ };
1095
+ };
1096
+ };
1097
+ };
1098
+ };
1099
+ };
1100
+ } & {
1101
+ api: {
1102
+ admin: {
1103
+ "migrate-markdown": {
1104
+ post: {
1105
+ body: {
1106
+ dry_run?: boolean | undefined;
1107
+ agent_id: string;
1108
+ markdown_paths: string[];
1109
+ };
1110
+ params: {};
1111
+ query: unknown;
1112
+ headers: unknown;
1113
+ response: {
1114
+ 200: {
1115
+ migrated: number;
1116
+ skipped: number;
1117
+ errors: string[];
1118
+ memories: Array<{
1119
+ id: string;
1120
+ content_preview: string;
1121
+ }>;
1122
+ } | {
1123
+ error: string;
1124
+ details: string;
1125
+ };
1126
+ 422: {
1127
+ type: "validation";
1128
+ on: string;
1129
+ summary?: string;
1130
+ message?: string;
1131
+ found?: unknown;
1132
+ property?: string;
1133
+ expected?: string;
1134
+ };
1135
+ };
1136
+ };
1137
+ };
1138
+ };
1139
+ };
1140
+ } & {
1141
+ api: {
1142
+ admin: {
1143
+ "daily-digest": {
1144
+ post: {
1145
+ body: unknown;
1146
+ params: {};
1147
+ query: unknown;
1148
+ headers: unknown;
1149
+ response: {
1150
+ 200: {
1151
+ error: string;
1152
+ };
1153
+ };
1154
+ };
1155
+ };
1156
+ };
1157
+ };
1158
+ }, {
1159
+ derive: {};
1160
+ resolve: {};
1161
+ schema: {};
1162
+ standaloneSchema: {};
1163
+ response: {};
1164
+ }, {
1165
+ derive: {};
1166
+ resolve: {};
1167
+ schema: {};
1168
+ standaloneSchema: {};
1169
+ response: {
1170
+ 200: {
1171
+ error: string;
1172
+ code: string;
1173
+ details?: undefined;
1174
+ } | {
1175
+ error: string;
1176
+ code: string;
1177
+ details: unknown;
1178
+ } | {
1179
+ error: string;
1180
+ details: string;
1181
+ code?: undefined;
1182
+ } | {
1183
+ error: string;
1184
+ code?: undefined;
1185
+ details?: undefined;
1186
+ };
1187
+ };
1188
+ } & {
1189
+ derive: {};
1190
+ resolve: {};
1191
+ schema: {};
1192
+ standaloneSchema: {};
1193
+ response: {};
1194
+ }>;
1195
+ orchestrator: StorageOrchestrator;
1196
+ config: ResolvedConfig;
1197
+ }>;
1198
+
1199
+ export { type Config as C, type ExtractionResult as E, type HealthResponse as H, type ListParams as L, type Memory as M, type ResolvedConfig as R, type StoreParams as S, type Tier as T, type UpdateParams as U, type StoreResult as a, type SearchParams as b, type SearchResponse as c, type ConversationLogEntry as d, type SummarizeResponse as e, StorageOrchestrator as f, type CreateMemoryResponse as g, type SyncQueueItem as h, type CreateMemoryRequest as i, type EntityType as j, type ExtractedEntity as k, type ExtractedRelationship as l, type ListMemoriesQuery as m, type MemoryScope as n, type MemorySource as o, type MigrateMarkdownRequest as p, type RelationshipType as q, type ScoredMemory as r, type SearchRequest as s, type SummarizeRequest as t, type SyncStatus as u, TIER_CAPABILITIES as v, type TierCapabilities as w, type UpdateMemoryRequest as x, createServer as y };