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/schemas/{schema_id}' \
-H 'X-API-Key: YOUR_API_KEY_HERE'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 conversationtitle: Set a human-readable title for the conversation (e.g., "Q4 Planning Session")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
The content of the chat message - can be a simple string or structured content objects
Optional title for the conversation session. Sets the Chat.title in Parse Server for easy identification.
Optional title for the conversation session. Sets the Chat.title in Parse Server for easy identification.
Optional title for the conversation session. Sets the Chat.title in Parse Server for easy identification.
Optional metadata for the message (topics, location, etc.)
Optional metadata for the message (topics, location, etc.)
Optional context for the message (conversation history or relevant context)
Optional context for the message (conversation history or relevant context)
Optional array of relationships for Graph DB (Neo4j)
Optional array of relationships for Graph DB (Neo4j)
Whether to process messages into memories (true) or just store them (false). Default is true.
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction), 'manual' (exact nodes), or 'hybrid' (LLM with constraints). Includes consent, risk, and ACL settings.
Unified policy for graph generation and OMO safety. Use mode='auto' (LLM extraction), 'manual' (exact nodes), or 'hybrid' (LLM with constraints). Includes consent, risk, and ACL settings.
Optional organization ID for multi-tenant message scoping
Optional organization ID for multi-tenant message scoping
Optional organization ID for multi-tenant message scoping
Optional namespace ID for multi-tenant message scoping
Optional namespace ID for multi-tenant message scoping
Optional namespace 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",
"title": "Q4 Product Planning"
}'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 sessionSummaries (if available):
context_for_llm field with pre-compressed context/sessions/{session_id}/compress endpoint to retrieve on-demandAccess 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
Hierarchical conversation summaries for context compression
Hierarchical conversation summaries for context compression
Pre-formatted compressed context ready for LLM consumption (summaries + recent messages)
Pre-formatted compressed context ready for LLM consumption (summaries + recent messages)
Pre-formatted compressed context ready for LLM consumption (summaries + recent messages)
{ "context_for_llm": "FULL SESSION: Product planning and strategy conversation\nRECENT (last ~100): Ongoing product planning discussion for Q4\nCURRENT (last 15): User requested help planning Q4 product roadmap", "messages": [ { … }, { … } ], "sessionId": "session_123", "summaries": { "long_term": "Product planning and strategy conversation", "medium_term": "Ongoing product planning discussion for Q4", "short_term": "User requested help planning Q4 product roadmap", "topics": [ … ] }, "total_count": 2 }