@papr/memory 1.16.0 → 1.18.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 (96) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +29 -0
  3. package/client.d.mts +14 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +14 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +9 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +9 -0
  10. package/client.mjs.map +1 -1
  11. package/internal/to-file.d.mts +1 -1
  12. package/internal/to-file.d.ts +1 -1
  13. package/internal/to-file.js +1 -1
  14. package/internal/to-file.mjs +1 -1
  15. package/internal/tslib.js +22 -22
  16. package/internal/utils/values.js +3 -3
  17. package/internal/utils/values.js.map +1 -1
  18. package/internal/utils/values.mjs +3 -3
  19. package/internal/utils/values.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/resources/document.d.mts +119 -0
  22. package/resources/document.d.mts.map +1 -0
  23. package/resources/document.d.ts +119 -0
  24. package/resources/document.d.ts.map +1 -0
  25. package/resources/document.js +40 -0
  26. package/resources/document.js.map +1 -0
  27. package/resources/document.mjs +36 -0
  28. package/resources/document.mjs.map +1 -0
  29. package/resources/feedback.d.mts +20 -0
  30. package/resources/feedback.d.mts.map +1 -1
  31. package/resources/feedback.d.ts +20 -0
  32. package/resources/feedback.d.ts.map +1 -1
  33. package/resources/graphql.d.mts +52 -0
  34. package/resources/graphql.d.mts.map +1 -0
  35. package/resources/graphql.d.ts +52 -0
  36. package/resources/graphql.d.ts.map +1 -0
  37. package/resources/graphql.js +54 -0
  38. package/resources/graphql.js.map +1 -0
  39. package/resources/graphql.mjs +50 -0
  40. package/resources/graphql.mjs.map +1 -0
  41. package/resources/index.d.mts +6 -2
  42. package/resources/index.d.mts.map +1 -1
  43. package/resources/index.d.ts +6 -2
  44. package/resources/index.d.ts.map +1 -1
  45. package/resources/index.js +9 -1
  46. package/resources/index.js.map +1 -1
  47. package/resources/index.mjs +4 -0
  48. package/resources/index.mjs.map +1 -1
  49. package/resources/memory.d.mts +373 -270
  50. package/resources/memory.d.mts.map +1 -1
  51. package/resources/memory.d.ts +373 -270
  52. package/resources/memory.d.ts.map +1 -1
  53. package/resources/memory.js +29 -4
  54. package/resources/memory.js.map +1 -1
  55. package/resources/memory.mjs +29 -4
  56. package/resources/memory.mjs.map +1 -1
  57. package/resources/schemas.d.mts +404 -0
  58. package/resources/schemas.d.mts.map +1 -0
  59. package/resources/schemas.d.ts +404 -0
  60. package/resources/schemas.d.ts.map +1 -0
  61. package/resources/schemas.js +127 -0
  62. package/resources/schemas.js.map +1 -0
  63. package/resources/schemas.mjs +123 -0
  64. package/resources/schemas.mjs.map +1 -0
  65. package/resources/shared.d.mts +10 -0
  66. package/resources/shared.d.mts.map +1 -0
  67. package/resources/shared.d.ts +10 -0
  68. package/resources/shared.d.ts.map +1 -0
  69. package/resources/shared.js +4 -0
  70. package/resources/shared.js.map +1 -0
  71. package/resources/shared.mjs +3 -0
  72. package/resources/shared.mjs.map +1 -0
  73. package/resources/user.d.mts +1 -18
  74. package/resources/user.d.mts.map +1 -1
  75. package/resources/user.d.ts +1 -18
  76. package/resources/user.d.ts.map +1 -1
  77. package/resources/user.js +0 -11
  78. package/resources/user.js.map +1 -1
  79. package/resources/user.mjs +0 -11
  80. package/resources/user.mjs.map +1 -1
  81. package/src/client.ts +61 -2
  82. package/src/internal/to-file.ts +1 -1
  83. package/src/internal/utils/values.ts +3 -3
  84. package/src/resources/document.ts +164 -0
  85. package/src/resources/feedback.ts +24 -0
  86. package/src/resources/graphql.ts +65 -0
  87. package/src/resources/index.ts +24 -1
  88. package/src/resources/memory.ts +418 -492
  89. package/src/resources/schemas.ts +541 -0
  90. package/src/resources/shared.ts +14 -0
  91. package/src/resources/user.ts +0 -23
  92. package/src/version.ts +1 -1
  93. package/version.d.mts +1 -1
  94. package/version.d.ts +1 -1
  95. package/version.js +1 -1
  96. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as MemoryAPI from './memory';
5
+ import * as Shared from './shared';
5
6
  import { APIPromise } from '../core/api-promise';
6
7
  import { buildHeaders } from '../internal/headers';
7
8
  import { RequestOptions } from '../internal/request-options';
@@ -76,14 +77,22 @@ export class Memory extends APIResource {
76
77
  * - Content-Type: application/json
77
78
  * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
78
79
  *
80
+ * **Role-Based Memory Categories**:
81
+ * - **User memories**: preference, task, goal, facts, context
82
+ * - **Assistant memories**: skills, learning
83
+ *
84
+ * **New Metadata Fields**:
85
+ * - `metadata.role`: Optional field to specify who generated the memory (user or assistant)
86
+ * - `metadata.category`: Optional field for memory categorization based on role
87
+ * - Both fields are stored within metadata at the same level as topics, location, etc.
88
+ *
79
89
  * The API validates content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
80
90
  *
81
91
  * @example
82
92
  * ```ts
83
93
  * const addMemoryResponse = await client.memory.add({
84
94
  * content:
85
- * 'Meeting notes from the product planning session',
86
- * type: 'text',
95
+ * 'Meeting with John Smith from Acme Corp about the Q4 project timeline',
87
96
  * });
88
97
  * ```
89
98
  */
@@ -115,11 +124,9 @@ export class Memory extends APIResource {
115
124
  * {
116
125
  * content:
117
126
  * 'Meeting notes from the product planning session',
118
- * type: 'text',
119
127
  * },
120
128
  * {
121
129
  * content: 'Follow-up tasks from the planning meeting',
122
- * type: 'text',
123
130
  * },
124
131
  * ],
125
132
  * });
@@ -195,6 +202,19 @@ export class Memory extends APIResource {
195
202
  * - API Key in `X-API-Key` header
196
203
  * - Session token in `X-Session-Token` header
197
204
  *
205
+ * **Custom Schema Support**:
206
+ * This endpoint supports both system-defined and custom user-defined node types:
207
+ * - **System nodes**: Memory, Person, Company, Project, Task, Insight, Meeting, Opportunity, Code
208
+ * - **Custom nodes**: Defined by developers via UserGraphSchema (e.g., Developer, Product, Customer, Function)
209
+ *
210
+ * When custom schema nodes are returned:
211
+ * - Each custom node includes a `schema_id` field referencing the UserGraphSchema
212
+ * - The response includes a `schemas_used` array listing all schema IDs used
213
+ * - Use `GET /v1/schemas/{schema_id}` to retrieve full schema definitions including:
214
+ * - Node type definitions and properties
215
+ * - Relationship type definitions and constraints
216
+ * - Validation rules and requirements
217
+ *
198
218
  * **Recommended Headers**:
199
219
  * ```
200
220
  * Accept-Encoding: gzip
@@ -212,6 +232,12 @@ export class Memory extends APIResource {
212
232
  * - "customer feedback" → identifies your customers first, then finds their specific feedback
213
233
  * - "project issues" → identifies your projects first, then finds related issues
214
234
  * - "team meeting notes" → identifies your team members first, then finds meeting notes
235
+ * - "code functions" → identifies your functions first, then finds related code
236
+ *
237
+ * **Role-Based Memory Filtering:**
238
+ * Filter memories by role and category using metadata fields:
239
+ * - `metadata.role`: Filter by "user" or "assistant"
240
+ * - `metadata.category`: Filter by category (user: preference, task, goal, facts, context | assistant: skills, learning)
215
241
  *
216
242
  * **User Resolution Precedence:**
217
243
  * - If both user_id and external_user_id are provided, user_id takes precedence.
@@ -250,24 +276,41 @@ export interface AddMemory {
250
276
  content: string;
251
277
 
252
278
  /**
253
- * Valid memory types
279
+ * Context can be conversation history or any relevant context for a memory item
254
280
  */
255
- type: MemoryType;
281
+ context?: Array<ContextItem> | null;
256
282
 
257
283
  /**
258
- * Context can be conversation history or any relevant context for a memory item
284
+ * Graph generation configuration
259
285
  */
260
- context?: Array<ContextItem> | null;
286
+ graph_generation?: GraphGeneration | null;
261
287
 
262
288
  /**
263
289
  * Metadata for memory request
264
290
  */
265
291
  metadata?: MemoryMetadata | null;
266
292
 
293
+ /**
294
+ * Optional namespace ID for multi-tenant memory scoping. When provided, memory is
295
+ * associated with this namespace.
296
+ */
297
+ namespace_id?: string | null;
298
+
299
+ /**
300
+ * Optional organization ID for multi-tenant memory scoping. When provided, memory
301
+ * is associated with this organization.
302
+ */
303
+ organization_id?: string | null;
304
+
267
305
  /**
268
306
  * Array of relationships that we can use in Graph DB (neo4J)
269
307
  */
270
308
  relationships_json?: Array<RelationshipItem> | null;
309
+
310
+ /**
311
+ * Memory item type; defaults to 'text' if omitted
312
+ */
313
+ type?: MemoryType;
271
314
  }
272
315
 
273
316
  /**
@@ -282,7 +325,7 @@ export interface AddMemoryResponse {
282
325
  /**
283
326
  * List of memory items if successful
284
327
  */
285
- data?: Array<AddMemoryResponse.Data> | null;
328
+ data?: Array<Shared.AddMemoryItem> | null;
286
329
 
287
330
  /**
288
331
  * Additional error details or context
@@ -300,18 +343,46 @@ export interface AddMemoryResponse {
300
343
  status?: string;
301
344
  }
302
345
 
303
- export namespace AddMemoryResponse {
346
+ /**
347
+ * AI-powered graph generation with optional guidance
348
+ */
349
+ export interface AutoGraphGeneration {
304
350
  /**
305
- * Response model for a single memory item in add_memory response
351
+ * Override specific property values in AI-generated nodes with match conditions
306
352
  */
307
- export interface Data {
308
- createdAt: string;
353
+ property_overrides?: Array<AutoGraphGeneration.PropertyOverride> | null;
309
354
 
310
- memoryId: string;
355
+ /**
356
+ * Force AI to use this specific schema instead of auto-selecting
357
+ */
358
+ schema_id?: string | null;
311
359
 
312
- objectId: string;
360
+ /**
361
+ * Limit AI to system + one user schema for consistency
362
+ */
363
+ simple_schema_mode?: boolean;
364
+ }
365
+
366
+ export namespace AutoGraphGeneration {
367
+ /**
368
+ * Property override rule with optional match conditions
369
+ */
370
+ export interface PropertyOverride {
371
+ /**
372
+ * Node type to apply overrides to (e.g., 'User', 'SecurityBehavior')
373
+ */
374
+ nodeLabel: string;
313
375
 
314
- memoryChunkIds?: Array<string>;
376
+ /**
377
+ * Properties to set/override on matching nodes
378
+ */
379
+ set: { [key: string]: unknown };
380
+
381
+ /**
382
+ * Optional conditions that must be met for override to apply. If not provided,
383
+ * applies to all nodes of this type
384
+ */
385
+ match?: { [key: string]: unknown } | null;
315
386
  }
316
387
  }
317
388
 
@@ -385,6 +456,26 @@ export interface ContextItem {
385
456
  role: 'user' | 'assistant';
386
457
  }
387
458
 
459
+ /**
460
+ * Graph generation configuration
461
+ */
462
+ export interface GraphGeneration {
463
+ /**
464
+ * AI-powered graph generation with optional guidance
465
+ */
466
+ auto?: AutoGraphGeneration | null;
467
+
468
+ /**
469
+ * Complete manual control over graph structure
470
+ */
471
+ manual?: ManualGraphGeneration | null;
472
+
473
+ /**
474
+ * Graph generation mode: 'auto' (AI-powered) or 'manual' (exact specification)
475
+ */
476
+ mode?: 'auto' | 'manual';
477
+ }
478
+
388
479
  export interface HTTPValidationError {
389
480
  detail?: Array<HTTPValidationError.Detail>;
390
481
  }
@@ -399,12 +490,109 @@ export namespace HTTPValidationError {
399
490
  }
400
491
  }
401
492
 
493
+ /**
494
+ * Complete manual control over graph structure
495
+ */
496
+ export interface ManualGraphGeneration {
497
+ /**
498
+ * Exact nodes to create
499
+ */
500
+ nodes: Array<ManualGraphGeneration.Node>;
501
+
502
+ /**
503
+ * Exact relationships to create
504
+ */
505
+ relationships?: Array<ManualGraphGeneration.Relationship>;
506
+ }
507
+
508
+ export namespace ManualGraphGeneration {
509
+ /**
510
+ * Developer-specified node for graph override.
511
+ *
512
+ * IMPORTANT:
513
+ *
514
+ * - 'id' is REQUIRED (relationships reference nodes by these IDs)
515
+ * - 'label' must match a node type from your registered UserGraphSchema
516
+ * - 'properties' must include ALL required fields from your schema definition
517
+ *
518
+ * 📋 Schema Management:
519
+ *
520
+ * - Register schemas: POST /v1/schemas
521
+ * - View your schemas: GET /v1/schemas
522
+ */
523
+ export interface Node {
524
+ /**
525
+ * **REQUIRED**: Unique identifier for this node. Must be unique within this
526
+ * request. Relationships reference this via source_node_id/target_node_id.
527
+ * Example: 'person_john_123', 'finding_cve_2024_1234'
528
+ */
529
+ id: string;
530
+
531
+ /**
532
+ * **REQUIRED**: Node type from your UserGraphSchema. View available types at GET
533
+ * /v1/schemas. System types: Memory, Person, Company, Project, Task, Insight,
534
+ * Meeting, Opportunity, Code
535
+ */
536
+ label: string;
537
+
538
+ /**
539
+ * **REQUIRED**: Node properties matching your UserGraphSchema definition. Must
540
+ * include: (1) All required properties from your schema, (2) unique_identifiers if
541
+ * defined (e.g., 'email' for Person) to enable MERGE deduplication. View schema
542
+ * requirements at GET /v1/schemas
543
+ */
544
+ properties: { [key: string]: unknown };
545
+ }
546
+
547
+ /**
548
+ * Developer-specified relationship for graph override.
549
+ *
550
+ * IMPORTANT:
551
+ *
552
+ * - source_node_id MUST exactly match a node 'id' from the 'nodes' array
553
+ * - target_node_id MUST exactly match a node 'id' from the 'nodes' array
554
+ * - relationship_type MUST exist in your registered UserGraphSchema
555
+ */
556
+ export interface Relationship {
557
+ /**
558
+ * **REQUIRED**: Relationship type from your UserGraphSchema. View available types
559
+ * at GET /v1/schemas. System types: WORKS_FOR, WORKS_ON, HAS_PARTICIPANT,
560
+ * DISCUSSES, MENTIONS, RELATES_TO, CREATED_BY
561
+ */
562
+ relationship_type: string;
563
+
564
+ /**
565
+ * **REQUIRED**: Must exactly match the 'id' field of a node defined in the 'nodes'
566
+ * array of this request
567
+ */
568
+ source_node_id: string;
569
+
570
+ /**
571
+ * **REQUIRED**: Must exactly match the 'id' field of a node defined in the 'nodes'
572
+ * array of this request
573
+ */
574
+ target_node_id: string;
575
+
576
+ /**
577
+ * Optional relationship properties (e.g., {'since': '2024-01-01', 'role':
578
+ * 'manager'})
579
+ */
580
+ properties?: { [key: string]: unknown } | null;
581
+ }
582
+ }
583
+
402
584
  /**
403
585
  * Metadata for memory request
404
586
  */
405
587
  export interface MemoryMetadata {
406
588
  assistantMessage?: string | null;
407
589
 
590
+ /**
591
+ * Memory category based on role. For users: preference, task, goal, fact, context.
592
+ * For assistants: skills, learning, task, goal, fact, context.
593
+ */
594
+ category?: 'preference' | 'task' | 'goal' | 'fact' | 'context' | 'skills' | 'learning' | null;
595
+
408
596
  conversationId?: string | null;
409
597
 
410
598
  /**
@@ -437,6 +625,10 @@ export interface MemoryMetadata {
437
625
 
438
626
  location?: string | null;
439
627
 
628
+ namespace_id?: string | null;
629
+
630
+ organization_id?: string | null;
631
+
440
632
  pageId?: string | null;
441
633
 
442
634
  post?: string | null;
@@ -447,6 +639,11 @@ export interface MemoryMetadata {
447
639
 
448
640
  relatedUseCases?: Array<string> | null;
449
641
 
642
+ /**
643
+ * Role of the message sender
644
+ */
645
+ role?: 'user' | 'assistant' | null;
646
+
450
647
  role_read_access?: Array<string> | null;
451
648
 
452
649
  role_write_access?: Array<string> | null;
@@ -461,6 +658,11 @@ export interface MemoryMetadata {
461
658
 
462
659
  topics?: Array<string> | null;
463
660
 
661
+ /**
662
+ * Upload ID for document processing workflows
663
+ */
664
+ upload_id?: string | null;
665
+
464
666
  useCaseClassificationScores?: Array<number> | null;
465
667
 
466
668
  user_id?: string | null;
@@ -547,6 +749,12 @@ export namespace SearchResponse {
547
749
  memories: Array<Data.Memory>;
548
750
 
549
751
  nodes: Array<Data.Node>;
752
+
753
+ /**
754
+ * List of UserGraphSchema IDs used in this response. Use GET /v1/schemas/{id} to
755
+ * get full schema definitions.
756
+ */
757
+ schemas_used?: Array<string> | null;
550
758
  }
551
759
 
552
760
  export namespace Data {
@@ -564,6 +772,11 @@ export namespace SearchResponse {
564
772
 
565
773
  user_id: string;
566
774
 
775
+ /**
776
+ * Memory category based on role
777
+ */
778
+ category?: string | null;
779
+
567
780
  context?: Array<MemoryAPI.ContextItem> | null;
568
781
 
569
782
  conversation_id?: string;
@@ -590,10 +803,25 @@ export namespace SearchResponse {
590
803
 
591
804
  metadata?: string | { [key: string]: unknown } | null;
592
805
 
806
+ /**
807
+ * Namespace ID this memory belongs to
808
+ */
809
+ namespace_id?: string | null;
810
+
811
+ /**
812
+ * Organization ID that owns this memory
813
+ */
814
+ organization_id?: string | null;
815
+
593
816
  page?: string | null;
594
817
 
595
818
  page_number?: number | null;
596
819
 
820
+ /**
821
+ * Role that generated this memory (user or assistant)
822
+ */
823
+ role?: string | null;
824
+
597
825
  role_read_access?: Array<string> | null;
598
826
 
599
827
  role_write_access?: Array<string> | null;
@@ -632,487 +860,25 @@ export namespace SearchResponse {
632
860
  }
633
861
 
634
862
  /**
635
- * Public-facing node structure matching our internal representation
863
+ * Public-facing node structure - supports both system and custom schema nodes
636
864
  */
637
865
  export interface Node {
638
- label:
639
- | 'Memory'
640
- | 'Person'
641
- | 'Company'
642
- | 'Project'
643
- | 'Task'
644
- | 'Insight'
645
- | 'Meeting'
646
- | 'Opportunity'
647
- | 'Code';
648
-
649
- /**
650
- * Memory node properties
651
- */
652
- properties:
653
- | Node.PaprMemoryNodeProperties
654
- | Node.PersonNodeProperties
655
- | Node.CompanyNodeProperties
656
- | Node.ProjectNodeProperties
657
- | Node.TaskNodeProperties
658
- | Node.InsightNodeProperties
659
- | Node.MeetingNodeProperties
660
- | Node.OpportunityNodeProperties
661
- | Node.CodeNodeProperties;
662
- }
663
-
664
- export namespace Node {
665
- /**
666
- * Memory node properties
667
- */
668
- export interface PaprMemoryNodeProperties {
669
- id: string;
670
-
671
- content: string;
672
-
673
- current_step: string;
674
-
675
- emotion_tags: Array<string>;
676
-
677
- steps: Array<string>;
678
-
679
- topics: Array<string>;
680
-
681
- type: string;
682
-
683
- conversationId?: string | null;
684
-
685
- createdAt?: string | null;
686
-
687
- emoji_tags?: Array<string> | null;
688
-
689
- external_user_read_access?: Array<string> | null;
690
-
691
- external_user_write_access?: Array<string> | null;
692
-
693
- hierarchical_structures?: string | null;
694
-
695
- pageId?: string | null;
696
-
697
- role_read_access?: Array<string> | null;
698
-
699
- role_write_access?: Array<string> | null;
700
-
701
- sourceType?: string | null;
702
-
703
- sourceUrl?: string | null;
704
-
705
- title?: string | null;
706
-
707
- updatedAt?: string | null;
708
-
709
- user_id?: string | null;
710
-
711
- user_read_access?: Array<string> | null;
712
-
713
- user_write_access?: Array<string> | null;
714
-
715
- workspace_id?: string | null;
716
-
717
- workspace_read_access?: Array<string> | null;
718
-
719
- workspace_write_access?: Array<string> | null;
720
- }
721
-
722
- /**
723
- * Person node properties
724
- */
725
- export interface PersonNodeProperties {
726
- id: string;
727
-
728
- description: string;
729
-
730
- name: string;
731
-
732
- role: string;
733
-
734
- conversationId?: string | null;
735
-
736
- createdAt?: string | null;
737
-
738
- external_user_read_access?: Array<string> | null;
739
-
740
- external_user_write_access?: Array<string> | null;
741
-
742
- pageId?: string | null;
743
-
744
- role_read_access?: Array<string> | null;
745
-
746
- role_write_access?: Array<string> | null;
747
-
748
- sourceType?: string | null;
749
-
750
- sourceUrl?: string | null;
751
-
752
- updatedAt?: string | null;
753
-
754
- user_id?: string | null;
755
-
756
- user_read_access?: Array<string> | null;
757
-
758
- user_write_access?: Array<string> | null;
759
-
760
- workspace_id?: string | null;
761
-
762
- workspace_read_access?: Array<string> | null;
763
-
764
- workspace_write_access?: Array<string> | null;
765
- }
766
-
767
- /**
768
- * Company node properties
769
- */
770
- export interface CompanyNodeProperties {
771
- id: string;
772
-
773
- description: string;
774
-
775
- name: string;
776
-
777
- conversationId?: string | null;
778
-
779
- createdAt?: string | null;
780
-
781
- external_user_read_access?: Array<string> | null;
782
-
783
- external_user_write_access?: Array<string> | null;
784
-
785
- pageId?: string | null;
786
-
787
- role_read_access?: Array<string> | null;
788
-
789
- role_write_access?: Array<string> | null;
790
-
791
- sourceType?: string | null;
792
-
793
- sourceUrl?: string | null;
794
-
795
- updatedAt?: string | null;
796
-
797
- user_id?: string | null;
798
-
799
- user_read_access?: Array<string> | null;
800
-
801
- user_write_access?: Array<string> | null;
802
-
803
- workspace_id?: string | null;
804
-
805
- workspace_read_access?: Array<string> | null;
806
-
807
- workspace_write_access?: Array<string> | null;
808
- }
809
-
810
- /**
811
- * Project node properties
812
- */
813
- export interface ProjectNodeProperties {
814
- id: string;
815
-
816
- description: string;
817
-
818
- name: string;
819
-
820
- type: string;
821
-
822
- conversationId?: string | null;
823
-
824
- createdAt?: string | null;
825
-
826
- external_user_read_access?: Array<string> | null;
827
-
828
- external_user_write_access?: Array<string> | null;
829
-
830
- pageId?: string | null;
831
-
832
- role_read_access?: Array<string> | null;
833
-
834
- role_write_access?: Array<string> | null;
835
-
836
- sourceType?: string | null;
837
-
838
- sourceUrl?: string | null;
839
-
840
- updatedAt?: string | null;
841
-
842
- user_id?: string | null;
843
-
844
- user_read_access?: Array<string> | null;
845
-
846
- user_write_access?: Array<string> | null;
847
-
848
- workspace_id?: string | null;
849
-
850
- workspace_read_access?: Array<string> | null;
851
-
852
- workspace_write_access?: Array<string> | null;
853
- }
854
-
855
- /**
856
- * Task node properties
857
- */
858
- export interface TaskNodeProperties {
859
- id: string;
860
-
861
- description: string;
862
-
863
- status: 'new' | 'in_progress' | 'completed';
864
-
865
- title: string;
866
-
867
- type: 'task' | 'subtask' | 'bug' | 'feature_request' | 'epic' | 'support_ticket';
868
-
869
- conversationId?: string | null;
870
-
871
- createdAt?: string | null;
872
-
873
- /**
874
- * Due date for the task in ISO 8601 format
875
- */
876
- date?: string | null;
877
-
878
- external_user_read_access?: Array<string> | null;
879
-
880
- external_user_write_access?: Array<string> | null;
881
-
882
- pageId?: string | null;
883
-
884
- priority?: 'low' | 'medium' | 'high' | 'urgent' | null;
885
-
886
- role_read_access?: Array<string> | null;
887
-
888
- role_write_access?: Array<string> | null;
889
-
890
- sourceType?: string | null;
891
-
892
- sourceUrl?: string | null;
893
-
894
- updatedAt?: string | null;
895
-
896
- user_id?: string | null;
897
-
898
- user_read_access?: Array<string> | null;
899
-
900
- user_write_access?: Array<string> | null;
901
-
902
- workspace_id?: string | null;
903
-
904
- workspace_read_access?: Array<string> | null;
905
-
906
- workspace_write_access?: Array<string> | null;
907
- }
908
-
909
- /**
910
- * Insight node properties
911
- */
912
- export interface InsightNodeProperties {
913
- id: string;
914
-
915
- description: string;
916
-
917
- source: string;
918
-
919
- title: string;
920
-
921
- type:
922
- | 'customer_insight'
923
- | 'product_insight'
924
- | 'market_insight'
925
- | 'competitive_insight'
926
- | 'technical_insight'
927
- | 'other';
928
-
929
- conversationId?: string | null;
930
-
931
- createdAt?: string | null;
932
-
933
- external_user_read_access?: Array<string> | null;
934
-
935
- external_user_write_access?: Array<string> | null;
936
-
937
- pageId?: string | null;
938
-
939
- role_read_access?: Array<string> | null;
940
-
941
- role_write_access?: Array<string> | null;
942
-
943
- sourceType?: string | null;
944
-
945
- sourceUrl?: string | null;
946
-
947
- updatedAt?: string | null;
948
-
949
- user_id?: string | null;
950
-
951
- user_read_access?: Array<string> | null;
952
-
953
- user_write_access?: Array<string> | null;
954
-
955
- workspace_id?: string | null;
956
-
957
- workspace_read_access?: Array<string> | null;
958
-
959
- workspace_write_access?: Array<string> | null;
960
- }
961
-
962
866
  /**
963
- * Meeting node properties
867
+ * Node type label - can be system type (Memory, Person, etc.) or custom type from
868
+ * UserGraphSchema
964
869
  */
965
- export interface MeetingNodeProperties {
966
- id: string;
967
-
968
- action_items: Array<string>;
969
-
970
- agenda: string;
971
-
972
- date: string;
973
-
974
- outcome: string;
975
-
976
- participants: Array<string>;
977
-
978
- summary: string;
979
-
980
- time: string;
981
-
982
- title: string;
983
-
984
- type: string;
985
-
986
- conversationId?: string | null;
987
-
988
- createdAt?: string | null;
989
-
990
- external_user_read_access?: Array<string> | null;
991
-
992
- external_user_write_access?: Array<string> | null;
993
-
994
- pageId?: string | null;
995
-
996
- role_read_access?: Array<string> | null;
997
-
998
- role_write_access?: Array<string> | null;
999
-
1000
- sourceType?: string | null;
1001
-
1002
- sourceUrl?: string | null;
1003
-
1004
- updatedAt?: string | null;
1005
-
1006
- user_id?: string | null;
1007
-
1008
- user_read_access?: Array<string> | null;
1009
-
1010
- user_write_access?: Array<string> | null;
1011
-
1012
- workspace_id?: string | null;
1013
-
1014
- workspace_read_access?: Array<string> | null;
1015
-
1016
- workspace_write_access?: Array<string> | null;
1017
- }
870
+ label: string;
1018
871
 
1019
872
  /**
1020
- * Opportunity node properties
873
+ * Node properties - structure depends on node type and schema
1021
874
  */
1022
- export interface OpportunityNodeProperties {
1023
- id: string;
1024
-
1025
- close_date: string;
1026
-
1027
- description: string;
1028
-
1029
- next_steps: Array<string>;
1030
-
1031
- probability: number;
1032
-
1033
- stage: 'prospect' | 'lead' | 'opportunity' | 'won' | 'lost';
1034
-
1035
- title: string;
1036
-
1037
- value: number;
1038
-
1039
- conversationId?: string | null;
1040
-
1041
- createdAt?: string | null;
1042
-
1043
- external_user_read_access?: Array<string> | null;
1044
-
1045
- external_user_write_access?: Array<string> | null;
1046
-
1047
- pageId?: string | null;
1048
-
1049
- role_read_access?: Array<string> | null;
1050
-
1051
- role_write_access?: Array<string> | null;
1052
-
1053
- sourceType?: string | null;
1054
-
1055
- sourceUrl?: string | null;
1056
-
1057
- updatedAt?: string | null;
1058
-
1059
- user_id?: string | null;
1060
-
1061
- user_read_access?: Array<string> | null;
1062
-
1063
- user_write_access?: Array<string> | null;
1064
-
1065
- workspace_id?: string | null;
1066
-
1067
- workspace_read_access?: Array<string> | null;
1068
-
1069
- workspace_write_access?: Array<string> | null;
1070
- }
875
+ properties: { [key: string]: unknown };
1071
876
 
1072
877
  /**
1073
- * Code node properties
878
+ * Reference to UserGraphSchema ID for custom nodes. Use GET
879
+ * /v1/schemas/{schema_id} to get full schema definition. Null for system nodes.
1074
880
  */
1075
- export interface CodeNodeProperties {
1076
- id: string;
1077
-
1078
- author: string;
1079
-
1080
- language: string;
1081
-
1082
- name: string;
1083
-
1084
- conversationId?: string | null;
1085
-
1086
- createdAt?: string | null;
1087
-
1088
- external_user_read_access?: Array<string> | null;
1089
-
1090
- external_user_write_access?: Array<string> | null;
1091
-
1092
- pageId?: string | null;
1093
-
1094
- role_read_access?: Array<string> | null;
1095
-
1096
- role_write_access?: Array<string> | null;
1097
-
1098
- sourceType?: string | null;
1099
-
1100
- sourceUrl?: string | null;
1101
-
1102
- updatedAt?: string | null;
1103
-
1104
- user_id?: string | null;
1105
-
1106
- user_read_access?: Array<string> | null;
1107
-
1108
- user_write_access?: Array<string> | null;
1109
-
1110
- workspace_id?: string | null;
1111
-
1112
- workspace_read_access?: Array<string> | null;
1113
-
1114
- workspace_write_access?: Array<string> | null;
1115
- }
881
+ schema_id?: string | null;
1116
882
  }
1117
883
  }
1118
884
  }
@@ -1242,6 +1008,18 @@ export interface MemoryUpdateParams {
1242
1008
  */
1243
1009
  metadata?: MemoryMetadata | null;
1244
1010
 
1011
+ /**
1012
+ * Optional namespace ID for multi-tenant memory scoping. When provided, update is
1013
+ * scoped to memories within this namespace.
1014
+ */
1015
+ namespace_id?: string | null;
1016
+
1017
+ /**
1018
+ * Optional organization ID for multi-tenant memory scoping. When provided, update
1019
+ * is scoped to memories within this organization.
1020
+ */
1021
+ organization_id?: string | null;
1022
+
1245
1023
  /**
1246
1024
  * Updated relationships for Graph DB (neo4J)
1247
1025
  */
@@ -1266,11 +1044,6 @@ export interface MemoryAddParams {
1266
1044
  */
1267
1045
  content: string;
1268
1046
 
1269
- /**
1270
- * Body param: Valid memory types
1271
- */
1272
- type: MemoryType;
1273
-
1274
1047
  /**
1275
1048
  * Query param: If True, skips adding background tasks for processing
1276
1049
  */
@@ -1282,15 +1055,37 @@ export interface MemoryAddParams {
1282
1055
  */
1283
1056
  context?: Array<ContextItem> | null;
1284
1057
 
1058
+ /**
1059
+ * Body param: Graph generation configuration
1060
+ */
1061
+ graph_generation?: GraphGeneration | null;
1062
+
1285
1063
  /**
1286
1064
  * Body param: Metadata for memory request
1287
1065
  */
1288
1066
  metadata?: MemoryMetadata | null;
1289
1067
 
1068
+ /**
1069
+ * Body param: Optional namespace ID for multi-tenant memory scoping. When
1070
+ * provided, memory is associated with this namespace.
1071
+ */
1072
+ namespace_id?: string | null;
1073
+
1074
+ /**
1075
+ * Body param: Optional organization ID for multi-tenant memory scoping. When
1076
+ * provided, memory is associated with this organization.
1077
+ */
1078
+ organization_id?: string | null;
1079
+
1290
1080
  /**
1291
1081
  * Body param: Array of relationships that we can use in Graph DB (neo4J)
1292
1082
  */
1293
1083
  relationships_json?: Array<RelationshipItem> | null;
1084
+
1085
+ /**
1086
+ * Body param: Memory item type; defaults to 'text' if omitted
1087
+ */
1088
+ type?: MemoryType;
1294
1089
  }
1295
1090
 
1296
1091
  export interface MemoryAddBatchParams {
@@ -1315,6 +1110,23 @@ export interface MemoryAddBatchParams {
1315
1110
  */
1316
1111
  external_user_id?: string | null;
1317
1112
 
1113
+ /**
1114
+ * Body param: Graph generation configuration
1115
+ */
1116
+ graph_generation?: GraphGeneration | null;
1117
+
1118
+ /**
1119
+ * Body param: Optional namespace ID for multi-tenant batch memory scoping. When
1120
+ * provided, all memories in the batch are associated with this namespace.
1121
+ */
1122
+ namespace_id?: string | null;
1123
+
1124
+ /**
1125
+ * Body param: Optional organization ID for multi-tenant batch memory scoping. When
1126
+ * provided, all memories in the batch are associated with this organization.
1127
+ */
1128
+ organization_id?: string | null;
1129
+
1318
1130
  /**
1319
1131
  * Body param: Internal user ID for all memories in the batch. If not provided,
1320
1132
  * developer's user ID will be used.
@@ -1332,6 +1144,8 @@ export interface MemoryAddBatchParams {
1332
1144
  * The webhook will receive a POST request with batch completion details.
1333
1145
  */
1334
1146
  webhook_url?: string | null;
1147
+
1148
+ [k: string]: unknown;
1335
1149
  }
1336
1150
 
1337
1151
  export interface MemoryDeleteAllParams {
@@ -1404,6 +1218,18 @@ export interface MemorySearchParams {
1404
1218
  */
1405
1219
  metadata?: MemoryMetadata | null;
1406
1220
 
1221
+ /**
1222
+ * Body param: Optional namespace ID for multi-tenant search scoping. When
1223
+ * provided, search is scoped to memories within this namespace.
1224
+ */
1225
+ namespace_id?: string | null;
1226
+
1227
+ /**
1228
+ * Body param: Optional organization ID for multi-tenant search scoping. When
1229
+ * provided, search is scoped to memories within this organization.
1230
+ */
1231
+ organization_id?: string | null;
1232
+
1407
1233
  /**
1408
1234
  * Body param: Whether to enable additional ranking of search results. Default is
1409
1235
  * false because results are already ranked when using an LLM for search
@@ -1412,6 +1238,26 @@ export interface MemorySearchParams {
1412
1238
  */
1413
1239
  rank_results?: boolean;
1414
1240
 
1241
+ /**
1242
+ * Body param: Optional user-defined schema ID to use for this search. If provided,
1243
+ * this schema (plus system schema) will be used for query generation. If not
1244
+ * provided, system will automatically select relevant schema based on query
1245
+ * content.
1246
+ */
1247
+ schema_id?: string | null;
1248
+
1249
+ /**
1250
+ * Body param: Complete search override specification provided by developer
1251
+ */
1252
+ search_override?: MemorySearchParams.SearchOverride | null;
1253
+
1254
+ /**
1255
+ * Body param: If true, uses simple schema mode: system schema + ONE most relevant
1256
+ * user schema. This ensures better consistency between add/search operations and
1257
+ * reduces query complexity. Recommended for production use.
1258
+ */
1259
+ simple_schema_mode?: boolean;
1260
+
1415
1261
  /**
1416
1262
  * Body param: Optional internal user ID to filter search results by a specific
1417
1263
  * user. If not provided, results are not filtered by user. If both user_id and
@@ -1425,13 +1271,93 @@ export interface MemorySearchParams {
1425
1271
  'Accept-Encoding'?: string;
1426
1272
  }
1427
1273
 
1274
+ export namespace MemorySearchParams {
1275
+ /**
1276
+ * Complete search override specification provided by developer
1277
+ */
1278
+ export interface SearchOverride {
1279
+ /**
1280
+ * Graph pattern to search for (source)-[relationship]->(target)
1281
+ */
1282
+ pattern: SearchOverride.Pattern;
1283
+
1284
+ /**
1285
+ * Property filters to apply to the search pattern
1286
+ */
1287
+ filters?: Array<SearchOverride.Filter>;
1288
+
1289
+ /**
1290
+ * Specific properties to return. If not specified, returns all properties.
1291
+ */
1292
+ return_properties?: Array<string> | null;
1293
+ }
1294
+
1295
+ export namespace SearchOverride {
1296
+ /**
1297
+ * Graph pattern to search for (source)-[relationship]->(target)
1298
+ */
1299
+ export interface Pattern {
1300
+ /**
1301
+ * Relationship type (e.g., 'ASSOCIATED_WITH', 'WORKS_FOR'). Must match schema
1302
+ * relationship types.
1303
+ */
1304
+ relationship_type: string;
1305
+
1306
+ /**
1307
+ * Source node label (e.g., 'Memory', 'Person', 'Company'). Must match schema node
1308
+ * types.
1309
+ */
1310
+ source_label: string;
1311
+
1312
+ /**
1313
+ * Target node label (e.g., 'Person', 'Company', 'Project'). Must match schema node
1314
+ * types.
1315
+ */
1316
+ target_label: string;
1317
+
1318
+ /**
1319
+ * Relationship direction: '->' (outgoing), '<-' (incoming), or '-' (bidirectional)
1320
+ */
1321
+ direction?: string;
1322
+ }
1323
+
1324
+ /**
1325
+ * Property filters for search override
1326
+ */
1327
+ export interface Filter {
1328
+ /**
1329
+ * Node type to filter (e.g., 'Person', 'Memory', 'Company')
1330
+ */
1331
+ node_type: string;
1332
+
1333
+ /**
1334
+ * Filter operator: 'CONTAINS', 'EQUALS', 'STARTS_WITH', 'IN'
1335
+ */
1336
+ operator: string;
1337
+
1338
+ /**
1339
+ * Property name to filter on (e.g., 'name', 'content', 'role')
1340
+ */
1341
+ property_name: string;
1342
+
1343
+ /**
1344
+ * Filter value(s). Use list for 'IN' operator.
1345
+ */
1346
+ value: string | Array<string> | number | boolean;
1347
+ }
1348
+ }
1349
+ }
1350
+
1428
1351
  export declare namespace Memory {
1429
1352
  export {
1430
1353
  type AddMemory as AddMemory,
1431
1354
  type AddMemoryResponse as AddMemoryResponse,
1355
+ type AutoGraphGeneration as AutoGraphGeneration,
1432
1356
  type BatchMemoryResponse as BatchMemoryResponse,
1433
1357
  type ContextItem as ContextItem,
1358
+ type GraphGeneration as GraphGeneration,
1434
1359
  type HTTPValidationError as HTTPValidationError,
1360
+ type ManualGraphGeneration as ManualGraphGeneration,
1435
1361
  type MemoryMetadata as MemoryMetadata,
1436
1362
  type MemoryType as MemoryType,
1437
1363
  type RelationshipItem as RelationshipItem,