API for managing memory, context, and retrieval for AI agents or apps with authentication and user-specific data.
API for managing memory, context, and retrieval for AI agents or apps 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": {} }
curl -i -X GET \
'http://memory.papr.ai/v1/memory/{memory_id}' \
-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).
Graph generation configuration. Defaults to auto mode with AI-selected schema.
Graph generation configuration. Defaults to auto mode with AI-selected schema.
Internal user ID for all memories in the batch. If not provided, developer's user ID will be used.
Internal user ID for all memories in the batch. If not provided, developer's user ID will be used.
Internal user ID for all memories in the batch. If not provided, developer's user ID will be used.
External user ID for all memories in the batch. If provided and user_id is not, will be resolved to internal user ID.
External user ID for all memories in the batch. If provided and user_id is not, will be resolved to internal user ID.
External user ID for all memories in the batch. If provided and user_id is not, will be resolved to internal user ID.
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
Graph generation configuration. Defaults to auto mode with AI-selected schema.
Graph generation configuration. Defaults to auto mode with AI-selected schema.
The content of the memory item you want to add to memory
Memory item type; defaults to 'text' if omitted
Metadata used in Neo4J and Pinecone for a memory item. Include role and category here.
Metadata used in Neo4J and Pinecone for a memory item. Include role and category here.
Context can be conversation history or any relevant context for a memory item
Context can be conversation history or any relevant context for a memory item
Array of relationships that we can use in Graph DB (neo4J)
Array of relationships that we can use in Graph DB (neo4J)
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.
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'.
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 }