API for managing personal memory items with authentication and user-specific data.
API for managing personal memory items with authentication and user-specific data.
This API supports three authentication methods:
X-API-Key headerX-API-Key: <your-api-key>X-Session-Token headerX-Session-Token: <your-session-token>Authorization headerAuthorization: Bearer <token>All endpoints require one of these authentication methods.
curl -i -X DELETE \
'http://memory.papr.ai/v1/memory/{memory_id}?skip_parse=false' \
-H 'X-API-Key: YOUR_API_KEY_HERE'{ "code": 200, "status": "success", "message": "string", "error": "string", "memoryId": "", "objectId": "", "deletion_status": { "pinecone": false, "neo4j": false, "parse": false, "qdrant": false }, "details": {} }
If true, return 404 if the memory has consent='none'. Ensures only consented memories are returned.
If true, return 404 if the memory has risk='flagged'. Filters out flagged content.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
Maximum risk level allowed. Values: 'none', 'sensitive', 'flagged'. If memory exceeds this, return 404.
curl -i -X GET \
'http://memory.papr.ai/v1/memory/{memory_id}?exclude_flagged=false&max_risk=string&require_consent=false' \
-H 'X-API-Key: YOUR_API_KEY_HERE'Memory successfully retrieved
Search results if successful
Search results if successful
Error message if failed
Error message if failed
Error message if failed
Additional error details or context
Additional error details or context
Additional error details or context
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
Unique identifier for this search query, maps to QueryLog objectId in Parse Server
{ "code": 200, "data": { "memories": [], "nodes": [] }, "search_id": "abc123def456", "status": "success" }
Add multiple memory items in a batch with size validation and background processing.
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerRequired Headers:
The API validates individual memory content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Your application's user identifier for all memories in the batch. This is the primary way to identify users. Papr will automatically resolve or create internal users as needed.
Optional organization ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this organization.
Optional organization ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this organization.
Optional organization ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this organization.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
Optional namespace ID for multi-tenant batch memory scoping. When provided, all memories in the batch are associated with this namespace.
List of memory items to add in batch
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction, constraints applied if provided) or 'manual' (exact nodes). Includes consent, risk, and ACL settings. If schema_id is set, schema's memory_policy is used as defaults.
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
Shorthand DSL for node/edge constraints. Expands to memory_policy.node_constraints and edge_constraints. Formats: - String: 'Task:title' (semantic match on Task.title) - List: ['Task:title', 'Person:email'] (multiple constraints) - Dict: {'Task:title': {'set': {...}}} (with options) Syntax: - Node: 'Type:property', 'Type:prop=value' (exact), 'Type:prop~value' (semantic) - Edge: 'Source->EDGE->Target:property' (arrow syntax) - Via: 'Type.via(EDGE->Target:prop)' (relationship traversal) - Special: '$this', '$previous', '$context:N' Example: 'SecurityBehavior->MITIGATES->TacticDef:name' with {'create': 'never'}
The content of the memory item you want to add to memory
Memory item type; defaults to 'text' if omitted
Optional organization ID for multi-tenant memory scoping. When provided, memory is associated with this organization.
Optional organization ID for multi-tenant memory scoping. When provided, memory is associated with this organization.
Optional organization ID for multi-tenant memory scoping. When provided, memory is associated with this organization.
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Your application's user identifier. This is the primary way to identify users. Use this for your app's user IDs (e.g., 'user_alice_123', UUID, email). Papr will automatically resolve or create internal users as needed.
Metadata used in graph and vector store for a memory item. Include role and category here.
Metadata used in graph and vector store for a memory item. Include role and category here.
Conversation history context for this memory. Use for providing message history when adding a memory. Format: [{role: 'user'|'assistant', content: '...'}]
Conversation history context for this memory. Use for providing message history when adding a memory. Format: [{role: 'user'|'assistant', content: '...'}]
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID. Most developers should not use this field directly.
DEPRECATED: Use 'memory_policy' instead. Migration options: 1. Specific memory: relationships=[{source: '$this', target: 'mem_123', type: 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related memories: link_to_related_memories=3
DEPRECATED: Use 'memory_policy' instead. Migration options: 1. Specific memory: relationships=[{source: '$this', target: 'mem_123', type: 'FOLLOWS'}] 2. Previous memory: link_to_previous_memory=True 3. Related memories: link_to_related_memories=3
Number of items to process in parallel
Number of items to process in parallel
Number of items to process in parallel
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional webhook URL to notify when batch processing is complete. The webhook will receive a POST request with batch completion details.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
Optional secret key for webhook authentication. If provided, will be included in the webhook request headers as 'X-Webhook-Secret'.
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'memory_policy' instead. Legacy graph generation configuration. If both memory_policy and graph_generation are provided, memory_policy takes precedence.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
DEPRECATED: Use 'external_user_id' instead. Internal Papr Parse user ID.
curl -i -X POST \
'http://memory.papr.ai/v1/memory/batch?skip_background_processing=false' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"batch_size": 10,
"external_user_id": "external_user_abcde",
"memories": [
{
"content": "Meeting notes from the product planning session",
"metadata": {
"createdAt": "2024-03-21T10:00:00Z",
"emoji tags": "📊,💡,📝",
"emotion tags": "focused, productive",
"hierarchical structures": "Business/Planning/Product",
"topics": "product, planning"
},
"type": "text"
},
{
"content": "Follow-up tasks from the planning meeting",
"metadata": {
"createdAt": "2024-03-21T11:00:00Z",
"emoji tags": "✅,📋",
"emotion tags": "organized",
"hierarchical structures": "Business/Tasks/Planning",
"topics": "tasks, planning"
},
"type": "text"
}
],
"user_id": "internal_user_id_12345"
}'Memories successfully added
Human-readable status message
Human-readable status message
Human-readable status message
Batch-level error message, if any
Batch-level error message, if any
Batch-level error message, if any
Additional error details or context
Additional error details or context
Additional error details or context
{ "code": 200, "status": "success", "message": "string", "error": "string", "details": {}, "successful": [ { … } ], "errors": [ { … } ], "total_processed": 0, "total_successful": 0, "total_failed": 0, "total_content_size": 0, "total_storage_size": 0 }