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/document/{upload_id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{}
Create a new user-defined graph schema.
This endpoint allows users to define custom node types and relationships for their knowledge graph. The schema will be validated and stored for use in future memory extractions.
Features:
enum_values to restrict property values to a predefined list (max 10 values)Property Types & Validation:
string: Text values with optional enum_values, min_length, max_length, patterninteger: Whole numbers with optional min_value, max_valuefloat: Decimal numbers with optional min_value, max_valueboolean: True/false valuesdatetime: ISO 8601 timestamp stringsarray: Lists of valuesobject: Complex nested objectsEnum Values:
enum_values to any string property to restrict values to a predefined listdefault to set a default enum value"enum_values": ["small", "medium", "large"]When to Use Enums:
When to Avoid Enums:
Unique Identifiers & Entity Resolution:
unique_identifiers are used for entity deduplication and mergingLLM-Friendly Descriptions:
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headerRequired Headers:
curl -i -X POST \
http://memory.papr.ai/v1/schemas \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"id": "string",
"name": "string",
"description": "string",
"version": "1.0.0",
"user_id": "string",
"workspace_id": "string",
"organization_id": "string",
"node_types": {
"property1": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"required_properties": [
"string"
],
"unique_identifiers": [
"string"
],
"color": "#3498db",
"icon": "string"
},
"property2": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"required_properties": [
"string"
],
"unique_identifiers": [
"string"
],
"color": "#3498db",
"icon": "string"
}
},
"relationship_types": {
"property1": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"allowed_source_types": [
"string"
],
"allowed_target_types": [
"string"
],
"cardinality": "one-to-one",
"color": "#e74c3c"
},
"property2": {
"name": "string",
"label": "string",
"description": "string",
"properties": {
"property1": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
},
"property2": {
"type": "string",
"required": false,
"default": {},
"description": "string",
"min_length": 0,
"max_length": 0,
"min_value": 0,
"max_value": 0,
"enum_values": [
"string"
],
"pattern": "string"
}
},
"allowed_source_types": [
"string"
],
"allowed_target_types": [
"string"
],
"cardinality": "one-to-one",
"color": "#e74c3c"
}
},
"status": "draft",
"scope": "personal",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"read_access": [
"string"
],
"write_access": [
"string"
],
"usage_count": 0,
"last_used_at": "2019-08-24T14:15:22Z"
}'{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "version": "1.0.0", "user_id": "string", "workspace_id": "string", "organization_id": "string", "node_types": { … }, "relationship_types": { … }, "status": "draft", "scope": "personal", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "read_access": [ … ], "write_access": [ … ], "usage_count": 0, "last_used_at": "2019-08-24T14:15:22Z" }, "error": "string", "code": 200 }
List all schemas accessible to the authenticated user.
Returns schemas that the user owns or has read access to, including:
Authentication Required: One of the following authentication methods must be used:
Authorization headerX-API-Key headerX-Session-Token headercurl -i -X GET \
'http://memory.papr.ai/v1/schemas?status_filter=string&workspace_id=string' \
-H 'X-API-Key: YOUR_API_KEY_HERE'{ "success": true, "data": [ { … } ], "code": 200, "total": 1 }