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.
Search through memories with authentication required.
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerCustom Schema Support: This endpoint supports both system-defined and custom user-defined node types:
When custom schema nodes are returned:
schema_id field referencing the UserGraphSchemaschemas_used array listing all schema IDs usedGET /v1/schemas/{schema_id} to retrieve full schema definitions including:Recommended Headers:
Accept-Encoding: gzipThe API supports response compression for improved performance. Responses larger than 1KB will be automatically compressed when this header is present.
HIGHLY RECOMMENDED SETTINGS FOR BEST RESULTS:
enable_agentic_graph: true for intelligent, context-aware search that can understand ambiguous referencesmax_memories: 15-20 for comprehensive memory coveragemax_nodes: 10-15 for comprehensive graph entity relationshipsAgentic Graph Benefits: When enabled, the system can understand vague references by first identifying specific entities from your memory graph, then performing targeted searches. For example:
Role-Based Memory Filtering: Filter memories by role and category using metadata fields:
metadata.role: Filter by "user" or "assistant"metadata.category: Filter by category (user: preference, task, goal, facts, context | assistant: skills, learning)User Resolution Precedence:
HIGHLY RECOMMENDED: Maximum number of memories to return. Use at least 15-20 for comprehensive results. Lower values (5-10) may miss relevant information. Default is 20 for optimal coverage.
Detailed search query describing what you're looking for. For best results, write 2-3 sentences that include specific details, context, and time frame. Examples: 'Find recurring customer complaints about API performance from the last month. Focus on issues where customers specifically mentioned timeout errors or slow response times in their conversations.' 'What are the main issues and blockers in my current projects? Focus on technical challenges and timeline impacts.' 'Find insights about team collaboration and communication patterns from recent meetings and discussions.'
Whether to enable additional ranking of search results. Default is false because results are already ranked when using an LLM for search (recommended approach). Only enable this if you're not using an LLM in your search pipeline and need additional result ranking.
HIGHLY RECOMMENDED: Enable agentic graph search for intelligent, context-aware results. When enabled, the system can understand ambiguous references by first identifying specific entities from your memory graph, then performing targeted searches. Examples: 'customer feedback' → identifies your customers first, then finds their specific feedback; 'project issues' → identifies your projects first, then finds related issues; 'team meeting notes' → identifies team members first, then finds meeting notes. This provides much more relevant and comprehensive results. Set to false only if you need faster, simpler keyword-based search.
Optional internal user ID to filter search results by a specific user. If not provided, results are not filtered by user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional internal user ID to filter search results by a specific user. If not provided, results are not filtered by user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional internal user ID to filter search results by a specific user. If not provided, results are not filtered by user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional external user ID to filter search results by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional external user ID to filter search results by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional external user ID to filter search results by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.
Optional organization ID for multi-tenant search scoping. When provided, search is scoped to memories within this organization.
Optional organization ID for multi-tenant search scoping. When provided, search is scoped to memories within this organization.
Optional organization ID for multi-tenant search scoping. When provided, search is scoped to memories within this organization.
Optional namespace ID for multi-tenant search scoping. When provided, search is scoped to memories within this namespace.
Optional namespace ID for multi-tenant search scoping. When provided, search is scoped to memories within this namespace.
Optional namespace ID for multi-tenant search scoping. When provided, search is scoped to memories within this namespace.
Optional user-defined schema ID to use for this search. If provided, this schema (plus system schema) will be used for query generation. If not provided, system will automatically select relevant schema based on query content.
Optional user-defined schema ID to use for this search. If provided, this schema (plus system schema) will be used for query generation. If not provided, system will automatically select relevant schema based on query content.
Optional user-defined schema ID to use for this search. If provided, this schema (plus system schema) will be used for query generation. If not provided, system will automatically select relevant schema based on query content.
If true, uses simple schema mode: system schema + ONE most relevant user schema. This ensures better consistency between add/search operations and reduces query complexity. Recommended for production use.
Optional metadata filter. Any field in MemoryMetadata (including custom fields) can be used for filtering.
Optional metadata filter. Any field in MemoryMetadata (including custom fields) can be used for filtering.
OPTIONAL: Override automatic search query generation with your own exact graph pattern and filters. ⚡ AUTOMATIC BY DEFAULT: If not provided, the system automatically generates optimized Cypher queries using AI - no action required! 🎯 USE WHEN: You want precise control over search patterns, have specific graph traversals in mind, or want to bypass AI query generation for performance. 📋 VALIDATION: All patterns and filters must comply with your schema definitions.
OPTIONAL: Override automatic search query generation with your own exact graph pattern and filters. ⚡ AUTOMATIC BY DEFAULT: If not provided, the system automatically generates optimized Cypher queries using AI - no action required! 🎯 USE WHEN: You want precise control over search patterns, have specific graph traversals in mind, or want to bypass AI query generation for performance. 📋 VALIDATION: All patterns and filters must comply with your schema definitions.
curl -i -X POST \
'http://memory.papr.ai/v1/memory/search?max_memories=20&max_nodes=15' \
-H 'Accept-Encoding: gzip' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"enable_agentic_graph": false,
"external_user_id": "external_user_123",
"query": "Find recurring customer complaints about API performance from the last month. Focus on issues that multiple customers have mentioned and any specific feature requests or workflow improvements they'\''ve suggested.",
"rank_results": true
}'Successfully retrieved memories
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
Standard response when only system-defined node types are found
{ "code": 200, "status": "success", "data": { "memories": [ … ], "nodes": [ … ] }, "search_id": "search-789" }
curl -i -X POST \
http://memory.papr.ai/v1/user \
-H 'Content-Type: application/json' \
-H 'X-API-Key: string' \
-d '{
"email": "user@example.com",
"external_id": "user123",
"metadata": {
"name": "John Doe",
"preferences": {
"theme": "dark"
}
},
"type": "developerUser"
}'{ "code": 200, "created_at": "2024-03-20T10:00:00.000Z", "email": "user@example.com", "external_id": "user123", "metadata": { "name": "John Doe", "preferences": { … } }, "status": "success", "updated_at": "2024-03-20T10:00:00.000Z", "user_id": "abc123" }
curl -i -X GET \
'http://memory.papr.ai/v1/user?email=string&external_id=string&page=1&page_size=10' \
-H 'X-API-Key: string'{ "code": 200, "data": [ { … } ], "page": 1, "page_size": 10, "status": "success", "total": 1 }