@papr/memory 1.20.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/LICENSE +1 -1
- package/README.md +13 -1
- package/client.d.mts +37 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +37 -9
- package/client.d.ts.map +1 -1
- package/client.js +17 -2
- package/client.js.map +1 -1
- package/client.mjs +17 -2
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +22 -22
- package/package.json +1 -1
- package/resources/document.d.mts +16 -3
- package/resources/document.d.mts.map +1 -1
- package/resources/document.d.ts +16 -3
- package/resources/document.d.ts.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/memory.d.mts +498 -119
- package/resources/memory.d.mts.map +1 -1
- package/resources/memory.d.ts +498 -119
- package/resources/memory.d.ts.map +1 -1
- package/resources/memory.js +8 -4
- package/resources/memory.js.map +1 -1
- package/resources/memory.mjs +8 -4
- package/resources/memory.mjs.map +1 -1
- package/resources/messages/index.d.mts +3 -0
- package/resources/messages/index.d.mts.map +1 -0
- package/resources/messages/index.d.ts +3 -0
- package/resources/messages/index.d.ts.map +1 -0
- package/resources/messages/index.js +9 -0
- package/resources/messages/index.js.map +1 -0
- package/resources/messages/index.mjs +4 -0
- package/resources/messages/index.mjs.map +1 -0
- package/resources/messages/messages.d.mts +160 -0
- package/resources/messages/messages.d.mts.map +1 -0
- package/resources/messages/messages.d.ts +160 -0
- package/resources/messages/messages.d.ts.map +1 -0
- package/resources/messages/messages.js +54 -0
- package/resources/messages/messages.js.map +1 -0
- package/resources/messages/messages.mjs +49 -0
- package/resources/messages/messages.mjs.map +1 -0
- package/resources/messages/sessions.d.mts +262 -0
- package/resources/messages/sessions.d.mts.map +1 -0
- package/resources/messages/sessions.d.ts +262 -0
- package/resources/messages/sessions.d.ts.map +1 -0
- package/resources/messages/sessions.js +122 -0
- package/resources/messages/sessions.js.map +1 -0
- package/resources/messages/sessions.mjs +118 -0
- package/resources/messages/sessions.mjs.map +1 -0
- package/resources/messages.d.mts +2 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +2 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +6 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +3 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/omo.d.mts +98 -0
- package/resources/omo.d.mts.map +1 -0
- package/resources/omo.d.ts +98 -0
- package/resources/omo.d.ts.map +1 -0
- package/resources/omo.js +36 -0
- package/resources/omo.js.map +1 -0
- package/resources/omo.mjs +32 -0
- package/resources/omo.mjs.map +1 -0
- package/resources/schemas.d.mts +667 -76
- package/resources/schemas.d.mts.map +1 -1
- package/resources/schemas.d.ts +667 -76
- package/resources/schemas.d.ts.map +1 -1
- package/resources/schemas.js.map +1 -1
- package/resources/schemas.mjs.map +1 -1
- package/resources/shared.d.mts +671 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +671 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/sync.d.mts +142 -0
- package/resources/sync.d.mts.map +1 -0
- package/resources/sync.d.ts +142 -0
- package/resources/sync.d.ts.map +1 -0
- package/resources/sync.js +36 -0
- package/resources/sync.js.map +1 -0
- package/resources/sync.mjs +32 -0
- package/resources/sync.mjs.map +1 -0
- package/resources/user.d.mts +18 -1
- package/resources/user.d.mts.map +1 -1
- package/resources/user.d.ts +18 -1
- package/resources/user.d.ts.map +1 -1
- package/resources/user.js +11 -0
- package/resources/user.js.map +1 -1
- package/resources/user.mjs +11 -0
- package/resources/user.mjs.map +1 -1
- package/src/client.ts +80 -8
- package/src/internal/parse.ts +6 -0
- package/src/resources/document.ts +17 -4
- package/src/resources/index.ts +21 -0
- package/src/resources/memory.ts +548 -163
- package/src/resources/messages/index.ts +11 -0
- package/src/resources/messages/messages.ts +193 -0
- package/src/resources/messages/sessions.ts +315 -0
- package/src/resources/messages.ts +3 -0
- package/src/resources/omo.ts +132 -0
- package/src/resources/schemas.ts +701 -95
- package/src/resources/shared.ts +752 -0
- package/src/resources/sync.ts +179 -0
- package/src/resources/user.ts +23 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/memory.ts
CHANGED
|
@@ -97,8 +97,12 @@ export class Memory extends APIResource {
|
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
99
|
add(params: MemoryAddParams, options?: RequestOptions): APIPromise<AddMemoryResponse> {
|
|
100
|
-
const { skip_background_processing, ...body } = params;
|
|
101
|
-
return this._client.post('/v1/memory', {
|
|
100
|
+
const { enable_holographic, format, skip_background_processing, ...body } = params;
|
|
101
|
+
return this._client.post('/v1/memory', {
|
|
102
|
+
query: { enable_holographic, format, skip_background_processing },
|
|
103
|
+
body,
|
|
104
|
+
...options,
|
|
105
|
+
});
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
/**
|
|
@@ -189,8 +193,12 @@ export class Memory extends APIResource {
|
|
|
189
193
|
* const searchResponse = await client.memory.get('memory_id');
|
|
190
194
|
* ```
|
|
191
195
|
*/
|
|
192
|
-
get(
|
|
193
|
-
|
|
196
|
+
get(
|
|
197
|
+
memoryID: string,
|
|
198
|
+
query: MemoryGetParams | null | undefined = {},
|
|
199
|
+
options?: RequestOptions,
|
|
200
|
+
): APIPromise<SearchResponse> {
|
|
201
|
+
return this._client.get(path`/v1/memory/${memoryID}`, { query, ...options });
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
/**
|
|
@@ -287,15 +295,61 @@ export interface AddMemory {
|
|
|
287
295
|
content: string;
|
|
288
296
|
|
|
289
297
|
/**
|
|
290
|
-
*
|
|
298
|
+
* Conversation history context for this memory. Use for providing message history
|
|
299
|
+
* when adding a memory. Format: [{role: 'user'|'assistant', content: '...'}]
|
|
291
300
|
*/
|
|
292
301
|
context?: Array<ContextItem> | null;
|
|
293
302
|
|
|
294
303
|
/**
|
|
295
|
-
*
|
|
304
|
+
* Your application's user identifier. This is the primary way to identify users.
|
|
305
|
+
* Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr
|
|
306
|
+
* will automatically resolve or create internal users as needed.
|
|
307
|
+
*/
|
|
308
|
+
external_user_id?: string | null;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated Graph generation configuration
|
|
296
312
|
*/
|
|
297
313
|
graph_generation?: GraphGeneration | null;
|
|
298
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Shorthand DSL for node/edge constraints. Expands to
|
|
317
|
+
* memory_policy.node_constraints and edge_constraints. Formats: - String:
|
|
318
|
+
* 'Task:title' (semantic match on Task.title) - List: ['Task:title',
|
|
319
|
+
* 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}}
|
|
320
|
+
* (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact),
|
|
321
|
+
* 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow
|
|
322
|
+
* syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special:
|
|
323
|
+
* '$this', '$previous', '$context:N' Example:
|
|
324
|
+
* 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
|
|
325
|
+
*/
|
|
326
|
+
link_to?: string | Array<string> | { [key: string]: unknown } | null;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Unified memory processing policy.
|
|
330
|
+
*
|
|
331
|
+
* This is the SINGLE source of truth for how a memory should be processed,
|
|
332
|
+
* combining graph generation control AND OMO (Open Memory Object) safety
|
|
333
|
+
* standards.
|
|
334
|
+
*
|
|
335
|
+
* **Graph Generation Modes:**
|
|
336
|
+
*
|
|
337
|
+
* - auto: LLM extracts entities freely (default)
|
|
338
|
+
* - manual: Developer provides exact nodes (no LLM extraction)
|
|
339
|
+
*
|
|
340
|
+
* **OMO Safety Standards:**
|
|
341
|
+
*
|
|
342
|
+
* - consent: How data owner allowed storage (explicit, implicit, terms, none)
|
|
343
|
+
* - risk: Safety assessment (none, sensitive, flagged)
|
|
344
|
+
* - acl: Access control list for read/write permissions
|
|
345
|
+
*
|
|
346
|
+
* **Schema Integration:**
|
|
347
|
+
*
|
|
348
|
+
* - schema_id: Reference a schema that may have its own default memory_policy
|
|
349
|
+
* - Schema-level policies are merged with request-level (request takes precedence)
|
|
350
|
+
*/
|
|
351
|
+
memory_policy?: Shared.MemoryPolicy | null;
|
|
352
|
+
|
|
299
353
|
/**
|
|
300
354
|
* Metadata for memory request
|
|
301
355
|
*/
|
|
@@ -314,7 +368,10 @@ export interface AddMemory {
|
|
|
314
368
|
organization_id?: string | null;
|
|
315
369
|
|
|
316
370
|
/**
|
|
317
|
-
*
|
|
371
|
+
* @deprecated DEPRECATED: Use 'memory_policy' instead. Migration options: 1.
|
|
372
|
+
* Specific memory: relationships=[{source: '$this', target: 'mem_123', type:
|
|
373
|
+
* 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related
|
|
374
|
+
* memories: link_to_related_memories=3
|
|
318
375
|
*/
|
|
319
376
|
relationships_json?: Array<RelationshipItem> | null;
|
|
320
377
|
|
|
@@ -322,6 +379,12 @@ export interface AddMemory {
|
|
|
322
379
|
* Memory item type; defaults to 'text' if omitted
|
|
323
380
|
*/
|
|
324
381
|
type?: MemoryType;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @deprecated DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user
|
|
385
|
+
* ID. Most developers should not use this field directly.
|
|
386
|
+
*/
|
|
387
|
+
user_id?: string | null;
|
|
325
388
|
}
|
|
326
389
|
|
|
327
390
|
/**
|
|
@@ -367,11 +430,6 @@ export interface AutoGraphGeneration {
|
|
|
367
430
|
* Force AI to use this specific schema instead of auto-selecting
|
|
368
431
|
*/
|
|
369
432
|
schema_id?: string | null;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Limit AI to system + one user schema for consistency
|
|
373
|
-
*/
|
|
374
|
-
simple_schema_mode?: boolean;
|
|
375
433
|
}
|
|
376
434
|
|
|
377
435
|
export namespace AutoGraphGeneration {
|
|
@@ -596,6 +654,12 @@ export namespace ManualGraphGeneration {
|
|
|
596
654
|
* Metadata for memory request
|
|
597
655
|
*/
|
|
598
656
|
export interface MemoryMetadata {
|
|
657
|
+
/**
|
|
658
|
+
* @deprecated DEPRECATED: Use 'memory_policy.acl' at request level instead.
|
|
659
|
+
* Format: {'read': [...], 'write': [...]}.
|
|
660
|
+
*/
|
|
661
|
+
acl?: { [key: string]: Array<string> } | null;
|
|
662
|
+
|
|
599
663
|
assistantMessage?: string | null;
|
|
600
664
|
|
|
601
665
|
/**
|
|
@@ -604,6 +668,12 @@ export interface MemoryMetadata {
|
|
|
604
668
|
*/
|
|
605
669
|
category?: 'preference' | 'task' | 'goal' | 'fact' | 'context' | 'skills' | 'learning' | null;
|
|
606
670
|
|
|
671
|
+
/**
|
|
672
|
+
* @deprecated DEPRECATED: Use 'memory_policy.consent' at request level instead.
|
|
673
|
+
* Values: 'explicit', 'implicit' (default), 'terms', 'none'.
|
|
674
|
+
*/
|
|
675
|
+
consent?: string | null;
|
|
676
|
+
|
|
607
677
|
conversationId?: string | null;
|
|
608
678
|
|
|
609
679
|
/**
|
|
@@ -621,10 +691,22 @@ export interface MemoryMetadata {
|
|
|
621
691
|
|
|
622
692
|
'emotion tags'?: Array<string> | null;
|
|
623
693
|
|
|
694
|
+
/**
|
|
695
|
+
* @deprecated DEPRECATED: Use 'external_user_id' at request level instead. This
|
|
696
|
+
* field will be removed in v2.
|
|
697
|
+
*/
|
|
624
698
|
external_user_id?: string | null;
|
|
625
699
|
|
|
700
|
+
/**
|
|
701
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
702
|
+
* instead.
|
|
703
|
+
*/
|
|
626
704
|
external_user_read_access?: Array<string> | null;
|
|
627
705
|
|
|
706
|
+
/**
|
|
707
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
708
|
+
* instead.
|
|
709
|
+
*/
|
|
628
710
|
external_user_write_access?: Array<string> | null;
|
|
629
711
|
|
|
630
712
|
goalClassificationScores?: Array<number> | null;
|
|
@@ -632,20 +714,44 @@ export interface MemoryMetadata {
|
|
|
632
714
|
/**
|
|
633
715
|
* Hierarchical structures to enable navigation from broad topics to specific ones
|
|
634
716
|
*/
|
|
635
|
-
hierarchical_structures?: string | null;
|
|
717
|
+
hierarchical_structures?: string | Array<unknown> | null;
|
|
636
718
|
|
|
637
719
|
location?: string | null;
|
|
638
720
|
|
|
721
|
+
/**
|
|
722
|
+
* @deprecated DEPRECATED: Use 'namespace_id' at request level instead. This field
|
|
723
|
+
* will be removed in v2.
|
|
724
|
+
*/
|
|
639
725
|
namespace_id?: string | null;
|
|
640
726
|
|
|
727
|
+
/**
|
|
728
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
729
|
+
* instead.
|
|
730
|
+
*/
|
|
641
731
|
namespace_read_access?: Array<string> | null;
|
|
642
732
|
|
|
733
|
+
/**
|
|
734
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
735
|
+
* instead.
|
|
736
|
+
*/
|
|
643
737
|
namespace_write_access?: Array<string> | null;
|
|
644
738
|
|
|
739
|
+
/**
|
|
740
|
+
* @deprecated DEPRECATED: Use 'organization_id' at request level instead. This
|
|
741
|
+
* field will be removed in v2.
|
|
742
|
+
*/
|
|
645
743
|
organization_id?: string | null;
|
|
646
744
|
|
|
745
|
+
/**
|
|
746
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
747
|
+
* instead.
|
|
748
|
+
*/
|
|
647
749
|
organization_read_access?: Array<string> | null;
|
|
648
750
|
|
|
751
|
+
/**
|
|
752
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
753
|
+
* instead.
|
|
754
|
+
*/
|
|
649
755
|
organization_write_access?: Array<string> | null;
|
|
650
756
|
|
|
651
757
|
pageId?: string | null;
|
|
@@ -658,13 +764,27 @@ export interface MemoryMetadata {
|
|
|
658
764
|
|
|
659
765
|
relatedUseCases?: Array<string> | null;
|
|
660
766
|
|
|
767
|
+
/**
|
|
768
|
+
* @deprecated DEPRECATED: Use 'memory_policy.risk' at request level instead.
|
|
769
|
+
* Values: 'none' (default), 'sensitive', 'flagged'.
|
|
770
|
+
*/
|
|
771
|
+
risk?: string | null;
|
|
772
|
+
|
|
661
773
|
/**
|
|
662
774
|
* Role of the message sender
|
|
663
775
|
*/
|
|
664
776
|
role?: 'user' | 'assistant' | null;
|
|
665
777
|
|
|
778
|
+
/**
|
|
779
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
780
|
+
* instead.
|
|
781
|
+
*/
|
|
666
782
|
role_read_access?: Array<string> | null;
|
|
667
783
|
|
|
784
|
+
/**
|
|
785
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
786
|
+
* instead.
|
|
787
|
+
*/
|
|
668
788
|
role_write_access?: Array<string> | null;
|
|
669
789
|
|
|
670
790
|
sessionId?: string | null;
|
|
@@ -684,18 +804,38 @@ export interface MemoryMetadata {
|
|
|
684
804
|
|
|
685
805
|
useCaseClassificationScores?: Array<number> | null;
|
|
686
806
|
|
|
807
|
+
/**
|
|
808
|
+
* @deprecated DEPRECATED: Use 'external_user_id' at request level instead. This
|
|
809
|
+
* field will be removed in v2.
|
|
810
|
+
*/
|
|
687
811
|
user_id?: string | null;
|
|
688
812
|
|
|
813
|
+
/**
|
|
814
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
815
|
+
* instead.
|
|
816
|
+
*/
|
|
689
817
|
user_read_access?: Array<string> | null;
|
|
690
818
|
|
|
819
|
+
/**
|
|
820
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
821
|
+
* instead.
|
|
822
|
+
*/
|
|
691
823
|
user_write_access?: Array<string> | null;
|
|
692
824
|
|
|
693
825
|
userMessage?: string | null;
|
|
694
826
|
|
|
695
827
|
workspace_id?: string | null;
|
|
696
828
|
|
|
829
|
+
/**
|
|
830
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
831
|
+
* instead.
|
|
832
|
+
*/
|
|
697
833
|
workspace_read_access?: Array<string> | null;
|
|
698
834
|
|
|
835
|
+
/**
|
|
836
|
+
* INTERNAL: Auto-populated for vector store filtering. Use memory_policy.acl
|
|
837
|
+
* instead.
|
|
838
|
+
*/
|
|
699
839
|
workspace_write_access?: Array<string> | null;
|
|
700
840
|
|
|
701
841
|
[k: string]: unknown;
|
|
@@ -765,7 +905,7 @@ export namespace SearchResponse {
|
|
|
765
905
|
* Return type for SearchResult
|
|
766
906
|
*/
|
|
767
907
|
export interface Data {
|
|
768
|
-
memories: Array<
|
|
908
|
+
memories: Array<Shared.Memory>;
|
|
769
909
|
|
|
770
910
|
nodes: Array<Data.Node>;
|
|
771
911
|
|
|
@@ -777,134 +917,6 @@ export namespace SearchResponse {
|
|
|
777
917
|
}
|
|
778
918
|
|
|
779
919
|
export namespace Data {
|
|
780
|
-
/**
|
|
781
|
-
* A memory item in the knowledge base
|
|
782
|
-
*/
|
|
783
|
-
export interface Memory {
|
|
784
|
-
id: string;
|
|
785
|
-
|
|
786
|
-
acl: { [key: string]: { [key: string]: boolean } };
|
|
787
|
-
|
|
788
|
-
content: string;
|
|
789
|
-
|
|
790
|
-
type: string;
|
|
791
|
-
|
|
792
|
-
user_id: string;
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* Memory category based on role
|
|
796
|
-
*/
|
|
797
|
-
category?: string | null;
|
|
798
|
-
|
|
799
|
-
context?: Array<MemoryAPI.ContextItem> | null;
|
|
800
|
-
|
|
801
|
-
conversation_id?: string;
|
|
802
|
-
|
|
803
|
-
createdAt?: string | null;
|
|
804
|
-
|
|
805
|
-
current_step?: string | null;
|
|
806
|
-
|
|
807
|
-
customMetadata?: { [key: string]: unknown } | null;
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Full precision (float32) embedding vector from Qdrant. Typically 2560 dimensions
|
|
811
|
-
* for Qwen4B. Used for CoreML/ANE fp16 models.
|
|
812
|
-
*/
|
|
813
|
-
embedding?: Array<number> | null;
|
|
814
|
-
|
|
815
|
-
/**
|
|
816
|
-
* Quantized INT8 embedding vector (values -128 to 127). 4x smaller than float32.
|
|
817
|
-
* Default format for efficiency.
|
|
818
|
-
*/
|
|
819
|
-
embedding_int8?: Array<number> | null;
|
|
820
|
-
|
|
821
|
-
external_user_id?: string | null;
|
|
822
|
-
|
|
823
|
-
external_user_read_access?: Array<string> | null;
|
|
824
|
-
|
|
825
|
-
external_user_write_access?: Array<string> | null;
|
|
826
|
-
|
|
827
|
-
file_url?: string | null;
|
|
828
|
-
|
|
829
|
-
filename?: string | null;
|
|
830
|
-
|
|
831
|
-
hierarchical_structures?: string;
|
|
832
|
-
|
|
833
|
-
location?: string | null;
|
|
834
|
-
|
|
835
|
-
metadata?: string | { [key: string]: unknown } | null;
|
|
836
|
-
|
|
837
|
-
/**
|
|
838
|
-
* Namespace ID this memory belongs to
|
|
839
|
-
*/
|
|
840
|
-
namespace_id?: string | null;
|
|
841
|
-
|
|
842
|
-
namespace_read_access?: Array<string> | null;
|
|
843
|
-
|
|
844
|
-
namespace_write_access?: Array<string> | null;
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* Organization ID that owns this memory
|
|
848
|
-
*/
|
|
849
|
-
organization_id?: string | null;
|
|
850
|
-
|
|
851
|
-
organization_read_access?: Array<string> | null;
|
|
852
|
-
|
|
853
|
-
organization_write_access?: Array<string> | null;
|
|
854
|
-
|
|
855
|
-
page?: string | null;
|
|
856
|
-
|
|
857
|
-
page_number?: number | null;
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* Relevance score from server-side ranking algorithm. Higher scores indicate more
|
|
861
|
-
* relevant memories. Computed as: 60% vector similarity + 30% transition
|
|
862
|
-
* probability + 20% access frequency.
|
|
863
|
-
*/
|
|
864
|
-
relevance_score?: number | null;
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* Role that generated this memory (user or assistant)
|
|
868
|
-
*/
|
|
869
|
-
role?: string | null;
|
|
870
|
-
|
|
871
|
-
role_read_access?: Array<string> | null;
|
|
872
|
-
|
|
873
|
-
role_write_access?: Array<string> | null;
|
|
874
|
-
|
|
875
|
-
source_document_id?: string | null;
|
|
876
|
-
|
|
877
|
-
source_message_id?: string | null;
|
|
878
|
-
|
|
879
|
-
source_type?: string;
|
|
880
|
-
|
|
881
|
-
source_url?: string;
|
|
882
|
-
|
|
883
|
-
steps?: Array<string>;
|
|
884
|
-
|
|
885
|
-
tags?: Array<string>;
|
|
886
|
-
|
|
887
|
-
title?: string | null;
|
|
888
|
-
|
|
889
|
-
topics?: Array<string>;
|
|
890
|
-
|
|
891
|
-
total_pages?: number | null;
|
|
892
|
-
|
|
893
|
-
updatedAt?: string | null;
|
|
894
|
-
|
|
895
|
-
user_read_access?: Array<string> | null;
|
|
896
|
-
|
|
897
|
-
user_write_access?: Array<string> | null;
|
|
898
|
-
|
|
899
|
-
workspace_id?: string | null;
|
|
900
|
-
|
|
901
|
-
workspace_read_access?: Array<string> | null;
|
|
902
|
-
|
|
903
|
-
workspace_write_access?: Array<string> | null;
|
|
904
|
-
|
|
905
|
-
[k: string]: unknown;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
920
|
/**
|
|
909
921
|
* Public-facing node structure - supports both system and custom schema nodes
|
|
910
922
|
*/
|
|
@@ -1049,6 +1061,49 @@ export interface MemoryUpdateParams {
|
|
|
1049
1061
|
*/
|
|
1050
1062
|
context?: Array<ContextItem> | null;
|
|
1051
1063
|
|
|
1064
|
+
/**
|
|
1065
|
+
* Graph generation configuration
|
|
1066
|
+
*/
|
|
1067
|
+
graph_generation?: GraphGeneration | null;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Shorthand DSL for node/edge constraints. Expands to
|
|
1071
|
+
* memory_policy.node_constraints and edge_constraints. Formats: - String:
|
|
1072
|
+
* 'Task:title' (semantic match on Task.title) - List: ['Task:title',
|
|
1073
|
+
* 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}}
|
|
1074
|
+
* (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact),
|
|
1075
|
+
* 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow
|
|
1076
|
+
* syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special:
|
|
1077
|
+
* '$this', '$previous', '$context:N' Example:
|
|
1078
|
+
* 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
|
|
1079
|
+
*/
|
|
1080
|
+
link_to?: string | Array<string> | { [key: string]: unknown } | null;
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Unified memory processing policy.
|
|
1084
|
+
*
|
|
1085
|
+
* This is the SINGLE source of truth for how a memory should be processed,
|
|
1086
|
+
* combining graph generation control AND OMO (Open Memory Object) safety
|
|
1087
|
+
* standards.
|
|
1088
|
+
*
|
|
1089
|
+
* **Graph Generation Modes:**
|
|
1090
|
+
*
|
|
1091
|
+
* - auto: LLM extracts entities freely (default)
|
|
1092
|
+
* - manual: Developer provides exact nodes (no LLM extraction)
|
|
1093
|
+
*
|
|
1094
|
+
* **OMO Safety Standards:**
|
|
1095
|
+
*
|
|
1096
|
+
* - consent: How data owner allowed storage (explicit, implicit, terms, none)
|
|
1097
|
+
* - risk: Safety assessment (none, sensitive, flagged)
|
|
1098
|
+
* - acl: Access control list for read/write permissions
|
|
1099
|
+
*
|
|
1100
|
+
* **Schema Integration:**
|
|
1101
|
+
*
|
|
1102
|
+
* - schema_id: Reference a schema that may have its own default memory_policy
|
|
1103
|
+
* - Schema-level policies are merged with request-level (request takes precedence)
|
|
1104
|
+
*/
|
|
1105
|
+
memory_policy?: Shared.MemoryPolicy | null;
|
|
1106
|
+
|
|
1052
1107
|
/**
|
|
1053
1108
|
* Metadata for memory request
|
|
1054
1109
|
*/
|
|
@@ -1090,22 +1145,80 @@ export interface MemoryAddParams {
|
|
|
1090
1145
|
*/
|
|
1091
1146
|
content: string;
|
|
1092
1147
|
|
|
1148
|
+
/**
|
|
1149
|
+
* Query param: If True, applies holographic neural transforms and stores in
|
|
1150
|
+
* holographic collection
|
|
1151
|
+
*/
|
|
1152
|
+
enable_holographic?: boolean;
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Query param: Response format. Use 'omo' for Open Memory Object standard format
|
|
1156
|
+
* (portable across platforms).
|
|
1157
|
+
*/
|
|
1158
|
+
format?: string | null;
|
|
1159
|
+
|
|
1093
1160
|
/**
|
|
1094
1161
|
* Query param: If True, skips adding background tasks for processing
|
|
1095
1162
|
*/
|
|
1096
1163
|
skip_background_processing?: boolean;
|
|
1097
1164
|
|
|
1098
1165
|
/**
|
|
1099
|
-
* Body param:
|
|
1100
|
-
* memory
|
|
1166
|
+
* Body param: Conversation history context for this memory. Use for providing
|
|
1167
|
+
* message history when adding a memory. Format: [{role: 'user'|'assistant',
|
|
1168
|
+
* content: '...'}]
|
|
1101
1169
|
*/
|
|
1102
1170
|
context?: Array<ContextItem> | null;
|
|
1103
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* Body param: Your application's user identifier. This is the primary way to
|
|
1174
|
+
* identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID,
|
|
1175
|
+
* email). Papr will automatically resolve or create internal users as needed.
|
|
1176
|
+
*/
|
|
1177
|
+
external_user_id?: string | null;
|
|
1178
|
+
|
|
1104
1179
|
/**
|
|
1105
1180
|
* Body param: Graph generation configuration
|
|
1106
1181
|
*/
|
|
1107
1182
|
graph_generation?: GraphGeneration | null;
|
|
1108
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Body param: Shorthand DSL for node/edge constraints. Expands to
|
|
1186
|
+
* memory_policy.node_constraints and edge_constraints. Formats: - String:
|
|
1187
|
+
* 'Task:title' (semantic match on Task.title) - List: ['Task:title',
|
|
1188
|
+
* 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}}
|
|
1189
|
+
* (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact),
|
|
1190
|
+
* 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow
|
|
1191
|
+
* syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special:
|
|
1192
|
+
* '$this', '$previous', '$context:N' Example:
|
|
1193
|
+
* 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
|
|
1194
|
+
*/
|
|
1195
|
+
link_to?: string | Array<string> | { [key: string]: unknown } | null;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Body param: Unified memory processing policy.
|
|
1199
|
+
*
|
|
1200
|
+
* This is the SINGLE source of truth for how a memory should be processed,
|
|
1201
|
+
* combining graph generation control AND OMO (Open Memory Object) safety
|
|
1202
|
+
* standards.
|
|
1203
|
+
*
|
|
1204
|
+
* **Graph Generation Modes:**
|
|
1205
|
+
*
|
|
1206
|
+
* - auto: LLM extracts entities freely (default)
|
|
1207
|
+
* - manual: Developer provides exact nodes (no LLM extraction)
|
|
1208
|
+
*
|
|
1209
|
+
* **OMO Safety Standards:**
|
|
1210
|
+
*
|
|
1211
|
+
* - consent: How data owner allowed storage (explicit, implicit, terms, none)
|
|
1212
|
+
* - risk: Safety assessment (none, sensitive, flagged)
|
|
1213
|
+
* - acl: Access control list for read/write permissions
|
|
1214
|
+
*
|
|
1215
|
+
* **Schema Integration:**
|
|
1216
|
+
*
|
|
1217
|
+
* - schema_id: Reference a schema that may have its own default memory_policy
|
|
1218
|
+
* - Schema-level policies are merged with request-level (request takes precedence)
|
|
1219
|
+
*/
|
|
1220
|
+
memory_policy?: Shared.MemoryPolicy | null;
|
|
1221
|
+
|
|
1109
1222
|
/**
|
|
1110
1223
|
* Body param: Metadata for memory request
|
|
1111
1224
|
*/
|
|
@@ -1124,7 +1237,10 @@ export interface MemoryAddParams {
|
|
|
1124
1237
|
organization_id?: string | null;
|
|
1125
1238
|
|
|
1126
1239
|
/**
|
|
1127
|
-
* Body param:
|
|
1240
|
+
* @deprecated Body param: DEPRECATED: Use 'memory_policy' instead. Migration
|
|
1241
|
+
* options: 1. Specific memory: relationships=[{source: '$this', target: 'mem_123',
|
|
1242
|
+
* type: 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related
|
|
1243
|
+
* memories: link_to_related_memories=3
|
|
1128
1244
|
*/
|
|
1129
1245
|
relationships_json?: Array<RelationshipItem> | null;
|
|
1130
1246
|
|
|
@@ -1132,6 +1248,12 @@ export interface MemoryAddParams {
|
|
|
1132
1248
|
* Body param: Memory item type; defaults to 'text' if omitted
|
|
1133
1249
|
*/
|
|
1134
1250
|
type?: MemoryType;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* @deprecated Body param: DEPRECATED: Use 'external_user_id' instead. Internal
|
|
1254
|
+
* Papr Parse user ID. Most developers should not use this field directly.
|
|
1255
|
+
*/
|
|
1256
|
+
user_id?: string | null;
|
|
1135
1257
|
}
|
|
1136
1258
|
|
|
1137
1259
|
export interface MemoryAddBatchParams {
|
|
@@ -1151,8 +1273,9 @@ export interface MemoryAddBatchParams {
|
|
|
1151
1273
|
batch_size?: number | null;
|
|
1152
1274
|
|
|
1153
1275
|
/**
|
|
1154
|
-
* Body param:
|
|
1155
|
-
*
|
|
1276
|
+
* Body param: Your application's user identifier for all memories in the batch.
|
|
1277
|
+
* This is the primary way to identify users. Papr will automatically resolve or
|
|
1278
|
+
* create internal users as needed.
|
|
1156
1279
|
*/
|
|
1157
1280
|
external_user_id?: string | null;
|
|
1158
1281
|
|
|
@@ -1161,6 +1284,44 @@ export interface MemoryAddBatchParams {
|
|
|
1161
1284
|
*/
|
|
1162
1285
|
graph_generation?: GraphGeneration | null;
|
|
1163
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* Body param: Shorthand DSL for node/edge constraints. Expands to
|
|
1289
|
+
* memory_policy.node_constraints and edge_constraints. Formats: - String:
|
|
1290
|
+
* 'Task:title' (semantic match on Task.title) - List: ['Task:title',
|
|
1291
|
+
* 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}}
|
|
1292
|
+
* (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact),
|
|
1293
|
+
* 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow
|
|
1294
|
+
* syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special:
|
|
1295
|
+
* '$this', '$previous', '$context:N' Example:
|
|
1296
|
+
* 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
|
|
1297
|
+
*/
|
|
1298
|
+
link_to?: string | Array<string> | { [key: string]: unknown } | null;
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* Body param: Unified memory processing policy.
|
|
1302
|
+
*
|
|
1303
|
+
* This is the SINGLE source of truth for how a memory should be processed,
|
|
1304
|
+
* combining graph generation control AND OMO (Open Memory Object) safety
|
|
1305
|
+
* standards.
|
|
1306
|
+
*
|
|
1307
|
+
* **Graph Generation Modes:**
|
|
1308
|
+
*
|
|
1309
|
+
* - auto: LLM extracts entities freely (default)
|
|
1310
|
+
* - manual: Developer provides exact nodes (no LLM extraction)
|
|
1311
|
+
*
|
|
1312
|
+
* **OMO Safety Standards:**
|
|
1313
|
+
*
|
|
1314
|
+
* - consent: How data owner allowed storage (explicit, implicit, terms, none)
|
|
1315
|
+
* - risk: Safety assessment (none, sensitive, flagged)
|
|
1316
|
+
* - acl: Access control list for read/write permissions
|
|
1317
|
+
*
|
|
1318
|
+
* **Schema Integration:**
|
|
1319
|
+
*
|
|
1320
|
+
* - schema_id: Reference a schema that may have its own default memory_policy
|
|
1321
|
+
* - Schema-level policies are merged with request-level (request takes precedence)
|
|
1322
|
+
*/
|
|
1323
|
+
memory_policy?: Shared.MemoryPolicy | null;
|
|
1324
|
+
|
|
1164
1325
|
/**
|
|
1165
1326
|
* Body param: Optional namespace ID for multi-tenant batch memory scoping. When
|
|
1166
1327
|
* provided, all memories in the batch are associated with this namespace.
|
|
@@ -1174,8 +1335,8 @@ export interface MemoryAddBatchParams {
|
|
|
1174
1335
|
organization_id?: string | null;
|
|
1175
1336
|
|
|
1176
1337
|
/**
|
|
1177
|
-
* Body param:
|
|
1178
|
-
*
|
|
1338
|
+
* @deprecated Body param: DEPRECATED: Use 'external_user_id' instead. Internal
|
|
1339
|
+
* Papr Parse user ID.
|
|
1179
1340
|
*/
|
|
1180
1341
|
user_id?: string | null;
|
|
1181
1342
|
|
|
@@ -1212,6 +1373,26 @@ export interface MemoryDeleteAllParams {
|
|
|
1212
1373
|
user_id?: string | null;
|
|
1213
1374
|
}
|
|
1214
1375
|
|
|
1376
|
+
export interface MemoryGetParams {
|
|
1377
|
+
/**
|
|
1378
|
+
* If true, return 404 if the memory has risk='flagged'. Filters out flagged
|
|
1379
|
+
* content.
|
|
1380
|
+
*/
|
|
1381
|
+
exclude_flagged?: boolean;
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory
|
|
1385
|
+
* exceeds this, return 404.
|
|
1386
|
+
*/
|
|
1387
|
+
max_risk?: string | null;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* If true, return 404 if the memory has consent='none'. Ensures only consented
|
|
1391
|
+
* memories are returned.
|
|
1392
|
+
*/
|
|
1393
|
+
require_consent?: boolean;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1215
1396
|
export interface MemorySearchParams {
|
|
1216
1397
|
/**
|
|
1217
1398
|
* Body param: Detailed search query describing what you're looking for. For best
|
|
@@ -1259,12 +1440,22 @@ export interface MemorySearchParams {
|
|
|
1259
1440
|
enable_agentic_graph?: boolean;
|
|
1260
1441
|
|
|
1261
1442
|
/**
|
|
1262
|
-
* Body param:
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1443
|
+
* Body param: Your application's user identifier to filter search results. This is
|
|
1444
|
+
* the primary way to identify users. Use this for your app's user IDs (e.g.,
|
|
1445
|
+
* 'user_alice_123', UUID, email).
|
|
1265
1446
|
*/
|
|
1266
1447
|
external_user_id?: string | null;
|
|
1267
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* Body param: Configuration for holographic neural embedding transforms and H-COND
|
|
1451
|
+
* scoring.
|
|
1452
|
+
*
|
|
1453
|
+
* Neural holographic embeddings use 13 brain-inspired frequency bands to encode
|
|
1454
|
+
* hierarchical semantic metadata alongside the base embedding. H-COND (Holographic
|
|
1455
|
+
* CONDitional) scoring uses phase alignment for improved relevance ranking.
|
|
1456
|
+
*/
|
|
1457
|
+
holographic_config?: MemorySearchParams.HolographicConfig | null;
|
|
1458
|
+
|
|
1268
1459
|
/**
|
|
1269
1460
|
* Body param: Metadata for memory request
|
|
1270
1461
|
*/
|
|
@@ -1276,6 +1467,14 @@ export interface MemorySearchParams {
|
|
|
1276
1467
|
*/
|
|
1277
1468
|
namespace_id?: string | null;
|
|
1278
1469
|
|
|
1470
|
+
/**
|
|
1471
|
+
* Body param: Filter for Open Memory Object (OMO) safety standards in
|
|
1472
|
+
* search/retrieval.
|
|
1473
|
+
*
|
|
1474
|
+
* Use this to filter search results by consent level and/or risk level.
|
|
1475
|
+
*/
|
|
1476
|
+
omo_filter?: MemorySearchParams.OmoFilter | null;
|
|
1477
|
+
|
|
1279
1478
|
/**
|
|
1280
1479
|
* Body param: Optional organization ID for multi-tenant search scoping. When
|
|
1281
1480
|
* provided, search is scoped to memories within this organization.
|
|
@@ -1283,13 +1482,21 @@ export interface MemorySearchParams {
|
|
|
1283
1482
|
organization_id?: string | null;
|
|
1284
1483
|
|
|
1285
1484
|
/**
|
|
1286
|
-
* Body param:
|
|
1287
|
-
*
|
|
1288
|
-
*
|
|
1289
|
-
* search pipeline and need
|
|
1485
|
+
* @deprecated Body param: DEPRECATED: Use 'reranking_config' instead. Whether to
|
|
1486
|
+
* enable additional ranking of search results. Default is false because results
|
|
1487
|
+
* are already ranked when using an LLM for search (recommended approach). Only
|
|
1488
|
+
* enable this if you're not using an LLM in your search pipeline and need
|
|
1489
|
+
* additional result ranking. Migration: Replace 'rank_results: true' with
|
|
1490
|
+
* 'reranking_config: {reranking_enabled: true, reranking_provider: "cohere",
|
|
1491
|
+
* reranking_model: "rerank-v3.5"}'
|
|
1290
1492
|
*/
|
|
1291
1493
|
rank_results?: boolean;
|
|
1292
1494
|
|
|
1495
|
+
/**
|
|
1496
|
+
* Body param: Configuration for reranking memory search results
|
|
1497
|
+
*/
|
|
1498
|
+
reranking_config?: MemorySearchParams.RerankingConfig | null;
|
|
1499
|
+
|
|
1293
1500
|
/**
|
|
1294
1501
|
* Body param: Optional user-defined schema ID to use for this search. If provided,
|
|
1295
1502
|
* this schema (plus system schema) will be used for query generation. If not
|
|
@@ -1299,16 +1506,13 @@ export interface MemorySearchParams {
|
|
|
1299
1506
|
schema_id?: string | null;
|
|
1300
1507
|
|
|
1301
1508
|
/**
|
|
1302
|
-
* Body param:
|
|
1303
|
-
* user schema. This ensures better consistency between add/search operations and
|
|
1304
|
-
* reduces query complexity. Recommended for production use.
|
|
1509
|
+
* Body param: Complete search override specification provided by developer
|
|
1305
1510
|
*/
|
|
1306
|
-
|
|
1511
|
+
search_override?: MemorySearchParams.SearchOverride | null;
|
|
1307
1512
|
|
|
1308
1513
|
/**
|
|
1309
|
-
* Body param:
|
|
1310
|
-
* user.
|
|
1311
|
-
* external_user_id are provided, user_id takes precedence.
|
|
1514
|
+
* @deprecated Body param: DEPRECATED: Use 'external_user_id' instead. Internal
|
|
1515
|
+
* Papr Parse user ID. Most developers should not use this field directly.
|
|
1312
1516
|
*/
|
|
1313
1517
|
user_id?: string | null;
|
|
1314
1518
|
|
|
@@ -1318,6 +1522,186 @@ export interface MemorySearchParams {
|
|
|
1318
1522
|
'Accept-Encoding'?: string;
|
|
1319
1523
|
}
|
|
1320
1524
|
|
|
1525
|
+
export namespace MemorySearchParams {
|
|
1526
|
+
/**
|
|
1527
|
+
* Configuration for holographic neural embedding transforms and H-COND scoring.
|
|
1528
|
+
*
|
|
1529
|
+
* Neural holographic embeddings use 13 brain-inspired frequency bands to encode
|
|
1530
|
+
* hierarchical semantic metadata alongside the base embedding. H-COND (Holographic
|
|
1531
|
+
* CONDitional) scoring uses phase alignment for improved relevance ranking.
|
|
1532
|
+
*/
|
|
1533
|
+
export interface HolographicConfig {
|
|
1534
|
+
/**
|
|
1535
|
+
* Whether to enable holographic embedding transforms
|
|
1536
|
+
*/
|
|
1537
|
+
enabled?: boolean;
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* Maximum boost to add for high alignment (0.0-0.5)
|
|
1541
|
+
*/
|
|
1542
|
+
hcond_boost_factor?: number;
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* Phase alignment threshold above which to apply boost (0.0-1.0)
|
|
1546
|
+
*/
|
|
1547
|
+
hcond_boost_threshold?: number;
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* Maximum penalty for low alignment (0.0-0.5)
|
|
1551
|
+
*/
|
|
1552
|
+
hcond_penalty_factor?: number;
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
1555
|
+
* Search mode: 'disabled' (off), 'integrated' (search transformed embeddings),
|
|
1556
|
+
* 'post_search' (fetch then rerank with H-COND)
|
|
1557
|
+
*/
|
|
1558
|
+
search_mode?: 'disabled' | 'integrated' | 'post_search';
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
/**
|
|
1562
|
+
* Filter for Open Memory Object (OMO) safety standards in search/retrieval.
|
|
1563
|
+
*
|
|
1564
|
+
* Use this to filter search results by consent level and/or risk level.
|
|
1565
|
+
*/
|
|
1566
|
+
export interface OmoFilter {
|
|
1567
|
+
/**
|
|
1568
|
+
* Explicitly exclude memories with these consent levels. Example:
|
|
1569
|
+
* exclude_consent=['none'] filters out all memories without consent.
|
|
1570
|
+
*/
|
|
1571
|
+
exclude_consent?: Array<'explicit' | 'implicit' | 'terms' | 'none'> | null;
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* If true, exclude all flagged content (risk == 'flagged'). Shorthand for
|
|
1575
|
+
* exclude_risk=['flagged'].
|
|
1576
|
+
*/
|
|
1577
|
+
exclude_flagged?: boolean;
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Explicitly exclude memories with these risk levels. Example:
|
|
1581
|
+
* exclude_risk=['flagged'] filters out all flagged content.
|
|
1582
|
+
*/
|
|
1583
|
+
exclude_risk?: Array<'none' | 'sensitive' | 'flagged'> | null;
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* Post-ingest safety assessment of memory content.
|
|
1587
|
+
*
|
|
1588
|
+
* Aligned with Open Memory Object (OMO) standard.
|
|
1589
|
+
*/
|
|
1590
|
+
max_risk?: 'none' | 'sensitive' | 'flagged' | null;
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* How the data owner allowed this memory to be stored/used.
|
|
1594
|
+
*
|
|
1595
|
+
* Aligned with Open Memory Object (OMO) standard.
|
|
1596
|
+
*/
|
|
1597
|
+
min_consent?: 'explicit' | 'implicit' | 'terms' | 'none' | null;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* If true, only return memories with explicit consent (consent != 'none').
|
|
1601
|
+
* Shorthand for exclude_consent=['none'].
|
|
1602
|
+
*/
|
|
1603
|
+
require_consent?: boolean;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Configuration for reranking memory search results
|
|
1608
|
+
*/
|
|
1609
|
+
export interface RerankingConfig {
|
|
1610
|
+
/**
|
|
1611
|
+
* Whether to enable reranking of search results
|
|
1612
|
+
*/
|
|
1613
|
+
reranking_enabled?: boolean;
|
|
1614
|
+
|
|
1615
|
+
/**
|
|
1616
|
+
* Model to use for reranking. OpenAI (LLM): 'gpt-5-nano' (fast reasoning,
|
|
1617
|
+
* default), 'gpt-5-mini' (better quality reasoning). Cohere (cross-encoder):
|
|
1618
|
+
* 'rerank-v3.5' (latest), 'rerank-english-v3.0', 'rerank-multilingual-v3.0'
|
|
1619
|
+
*/
|
|
1620
|
+
reranking_model?: string;
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Reranking provider: 'openai' (better quality, slower) or 'cohere' (faster,
|
|
1624
|
+
* optimized for reranking)
|
|
1625
|
+
*/
|
|
1626
|
+
reranking_provider?: 'openai' | 'cohere';
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Complete search override specification provided by developer
|
|
1631
|
+
*/
|
|
1632
|
+
export interface SearchOverride {
|
|
1633
|
+
/**
|
|
1634
|
+
* Graph pattern to search for (source)-[relationship]->(target)
|
|
1635
|
+
*/
|
|
1636
|
+
pattern: SearchOverride.Pattern;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Property filters to apply to the search pattern
|
|
1640
|
+
*/
|
|
1641
|
+
filters?: Array<SearchOverride.Filter>;
|
|
1642
|
+
|
|
1643
|
+
/**
|
|
1644
|
+
* Specific properties to return. If not specified, returns all properties.
|
|
1645
|
+
*/
|
|
1646
|
+
return_properties?: Array<string> | null;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
export namespace SearchOverride {
|
|
1650
|
+
/**
|
|
1651
|
+
* Graph pattern to search for (source)-[relationship]->(target)
|
|
1652
|
+
*/
|
|
1653
|
+
export interface Pattern {
|
|
1654
|
+
/**
|
|
1655
|
+
* Relationship type (e.g., 'ASSOCIATED_WITH', 'WORKS_FOR'). Must match schema
|
|
1656
|
+
* relationship types.
|
|
1657
|
+
*/
|
|
1658
|
+
relationship_type: string;
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* Source node label (e.g., 'Memory', 'Person', 'Company'). Must match schema node
|
|
1662
|
+
* types.
|
|
1663
|
+
*/
|
|
1664
|
+
source_label: string;
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* Target node label (e.g., 'Person', 'Company', 'Project'). Must match schema node
|
|
1668
|
+
* types.
|
|
1669
|
+
*/
|
|
1670
|
+
target_label: string;
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* Relationship direction: '->' (outgoing), '<-' (incoming), or '-' (bidirectional)
|
|
1674
|
+
*/
|
|
1675
|
+
direction?: string;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Property filters for search override
|
|
1680
|
+
*/
|
|
1681
|
+
export interface Filter {
|
|
1682
|
+
/**
|
|
1683
|
+
* Node type to filter (e.g., 'Person', 'Memory', 'Company')
|
|
1684
|
+
*/
|
|
1685
|
+
node_type: string;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Filter operator: 'CONTAINS', 'EQUALS', 'STARTS_WITH', 'IN'
|
|
1689
|
+
*/
|
|
1690
|
+
operator: string;
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* Property name to filter on (e.g., 'name', 'content', 'role')
|
|
1694
|
+
*/
|
|
1695
|
+
property_name: string;
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Filter value(s). Use list for 'IN' operator.
|
|
1699
|
+
*/
|
|
1700
|
+
value: string | Array<string> | number | boolean;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1321
1705
|
export declare namespace Memory {
|
|
1322
1706
|
export {
|
|
1323
1707
|
type AddMemory as AddMemory,
|
|
@@ -1339,6 +1723,7 @@ export declare namespace Memory {
|
|
|
1339
1723
|
type MemoryAddParams as MemoryAddParams,
|
|
1340
1724
|
type MemoryAddBatchParams as MemoryAddBatchParams,
|
|
1341
1725
|
type MemoryDeleteAllParams as MemoryDeleteAllParams,
|
|
1726
|
+
type MemoryGetParams as MemoryGetParams,
|
|
1342
1727
|
type MemorySearchParams as MemorySearchParams,
|
|
1343
1728
|
};
|
|
1344
1729
|
}
|