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.
X-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.
Store a chat message and queue it for AI analysis and memory creation.
Authentication Required: Bearer token, API key, or session token
Processing Control:
process_messages: true (default) to enable full AI analysis and memory creationprocess_messages: false to store messages only without processing into memoriesProcessing Flow (when process_messages=true):
Role-Based Categories:
Session Management:
sessionId is required to group related messagessessionId for an entire conversationThe content of the chat message - can be a simple string or structured content objects
The content of the chat message - can be a simple string or structured content objects
The content of the chat message - can be a simple string or structured content objects
Optional metadata for the message
Optional metadata for the message
Whether to process messages into memories (true) or just store them (false). Default is true.
Optional organization ID for multi-tenant message scoping
Optional organization ID for multi-tenant message scoping
Optional organization ID for multi-tenant message scoping
curl -i -X POST \
http://memory.papr.ai/v1/messages \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"content": "Can you help me plan the Q4 product roadmap?",
"metadata": {
"location": "Office",
"topics": [
"product",
"planning",
"roadmap"
]
},
"process_messages": true,
"role": "user",
"sessionId": "session_123"
}'Message stored and queued for processing
Content of the message - can be a simple string or structured content objects
Content of the message - can be a simple string or structured content objects
Content of the message - can be a simple string or structured content objects
When the message was created
{ "content": "Can you help me plan the Q4 product roadmap?", "createdAt": "2024-01-15T10:30:00Z", "objectId": "msg_abc123", "processing_status": "queued", "role": "user", "sessionId": "session_123" }
Retrieve message history for a specific conversation session.
Authentication Required: Bearer token, API key, or session token
Pagination:
limit and skip parameters for paginationtotal_count indicates total messages in the sessionAccess Control:
curl -i -X GET \
'http://memory.papr.ai/v1/messages/sessions/{session_id}?limit=50&skip=0' \
-H 'X-API-Key: YOUR_API_KEY_HERE'Message history retrieved
List of messages in chronological order
Parse Server objectId of the stored message
Role of the message sender
Content of the message - can be a simple string or structured content objects
Content of the message - can be a simple string or structured content objects
Content of the message - can be a simple string or structured content objects
When the message was created
{ "messages": [ { … }, { … } ], "sessionId": "session_123", "total_count": 2 }
curl -i -X GET \
'http://memory.papr.ai/v1/messages/sessions/{session_id}/status' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'