Papr Memory API (1.0.0)

API for managing personal memory items with authentication and user-specific data.

Authentication

This API supports three authentication methods:

  • API Key: Include your API key in the X-API-Key header
    X-API-Key: <your-api-key>
  • Session Token: Include your session token in the X-Session-Token header
    X-Session-Token: <your-session-token>
  • Bearer Token: Include your OAuth2 token from Auth0 in the Authorization header
    Authorization: Bearer <token>

All endpoints require one of these authentication methods.

Download OpenAPI description
Languages
Servers
Production server
http://memory.papr.ai/

v1

Operations

Get Sync Tiers

Request

Return initial Tier 0 (goals/OKRs/use-cases --> tier 0 memories) and Tier 1 (hot memories) for the requesting user/workspace.

This is a minimal initial implementation to enable SDK integration. It uses simple heuristics and will be enhanced with analytics-driven selection.

Bodyapplication/jsonrequired
max_tier0integer(Max Tier0)[ 0 .. 2000 ]

Max Tier 0 items (goals/OKRs/use-cases)

Default 300
Example: 300
max_tier1integer(Max Tier1)[ 0 .. 5000 ]

Max Tier 1 items (hot memories)

Default 1000
Example: 1000
workspace_idWorkspace Id (string) or Workspace Id (null)(Workspace Id)

Optional workspace id to scope tiers

Example: "workspace_123"
Any of:

Optional workspace id to scope tiers

string(Workspace Id)

Optional workspace id to scope tiers

user_idUser Id (string) or User Id (null)(User Id)

Optional internal user ID to filter tiers 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.

Example: "internal_user_123"
Any of:

Optional internal user ID to filter tiers 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.

string(User Id)

Optional internal user ID to filter tiers 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.

external_user_idExternal User Id (string) or External User Id (null)(External User Id)

Optional external user ID to filter tiers by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.

Example: "external_user_abc"
Any of:

Optional external user ID to filter tiers by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.

string(External User Id)

Optional external user ID to filter tiers by a specific external user. If both user_id and external_user_id are provided, user_id takes precedence.

organization_idOrganization Id (string) or Organization Id (null)(Organization Id)

Optional organization ID for multi-tenant scoping. When provided, tiers are scoped to memories within this organization.

Any of:

Optional organization ID for multi-tenant scoping. When provided, tiers are scoped to memories within this organization.

string(Organization Id)

Optional organization ID for multi-tenant scoping. When provided, tiers are scoped to memories within this organization.

namespace_idNamespace Id (string) or Namespace Id (null)(Namespace Id)

Optional namespace ID for multi-tenant scoping. When provided, tiers are scoped to memories within this namespace.

Any of:

Optional namespace ID for multi-tenant scoping. When provided, tiers are scoped to memories within this namespace.

string(Namespace Id)

Optional namespace ID for multi-tenant scoping. When provided, tiers are scoped to memories within this namespace.

include_embeddingsboolean(Include Embeddings)

Include embeddings in the response. Format controlled by embedding_format parameter.

Default false
embedding_formatstring(EmbeddingFormat)

Embedding format: 'int8' (quantized, 4x smaller, default for efficiency), 'float32' (full precision, recommended for CoreML/ANE fp16 models). Only applies to Tier1; Tier0 always uses float32 when embeddings are included.

Default "int8"
Enum"int8""float32"
embed_modelstring(Embed Model)

Embedding model hint: 'sbert' or 'bigbird' or 'Qwen4B'

Default "Qwen4B"
Example: "sbert"
embed_limitinteger(Embed Limit)[ 0 .. 1000 ]

Max items to embed per tier to control latency

Default 200
Example: 200
curl -i -X POST \
  http://memory.papr.ai/v1/sync/tiers \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "embed_limit": 200,
    "embed_model": "sbert",
    "external_user_id": "external_user_abc",
    "include_embeddings": false,
    "max_tier0": 300,
    "max_tier1": 1000,
    "user_id": "internal_user_123",
    "workspace_id": "workspace_123"
  }'

Responses

Tier assignments returned

Bodyapplication/json
codeinteger(Code)

HTTP status code

Default 200
Example: 200
statusstring(Status)

'success' or 'error'

Default "success"
Example: "success"
tier0Array of objects(Tier0)

Tier 0 items (goals/OKRs/use-cases)

Example: [{"content":"Improve API performance","id":"goal_123","metadata":{"class":"goal","sourceType":"papr"},"topics":["performance","api"],"type":"goal"}]
tier1Array of objects(Tier1)

Tier 1 items (hot memories)

Example: [{"content":"Customer complained about slow API response times","id":"memory_456","metadata":{"sourceType":"papr"},"topics":["customer","api","performance"],"type":"text"}]
transitionsArray of objects(Transitions)

Transition items between tiers

Example: []
next_cursorNext Cursor (string) or Next Cursor (null)(Next Cursor)

Cursor for pagination

Any of:

Cursor for pagination

string(Next Cursor)

Cursor for pagination

has_moreboolean(Has More)

Whether there are more items available

Default false
errorError (string) or Error (null)(Error)

Error message if failed

Any of:

Error message if failed

string(Error)

Error message if failed

detailsDetails (any) or Details (null)(Details)

Additional error details or context

Any of:

Additional error details or context

any(Details)

Additional error details or context

Response
application/json
{ "code": 200, "has_more": false, "status": "success", "tier0": [ {} ], "tier1": [ {} ], "transitions": [] }

Get Sync Delta

Request

Return upserts/deletes since the provided cursor for a user/workspace. Cursor is an opaque watermark over updatedAt and objectId.

Query
cursorCursor (string) or Cursor (null)(Cursor)

Opaque cursor from previous sync

Any of:

Opaque cursor from previous sync

string(Cursor)

Opaque cursor from previous sync

limitinteger(Limit)[ 1 .. 1000 ]
Default 200
workspace_idWorkspace Id (string) or Workspace Id (null)(Workspace Id)
Any of:
string(Workspace Id)
include_embeddingsboolean(Include Embeddings)
Default false
curl -i -X GET \
  'http://memory.papr.ai/v1/sync/delta?cursor=string&include_embeddings=false&limit=200&workspace_id=string' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

Delta since cursor returned

Bodyapplication/json
property name*anyadditional property
Response
application/json
{}

Create User Schema V1

Request

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:

  • Define custom node types with properties and validation rules
  • Define custom relationship types with constraints
  • Automatic validation against system schemas
  • Support for different scopes (personal, workspace, namespace, organization)
  • Status control: Set status to "active" to immediately activate the schema, or "draft" to save as draft (default)
  • Enum support: Use enum_values to restrict property values to a predefined list (max 15 values)
  • Auto-indexing: Required properties are automatically indexed in Neo4j when schema becomes active

Schema Limits (optimized for LLM performance):

  • Maximum 10 node types per schema
  • Maximum 20 relationship types per schema
  • Maximum 10 properties per node type
  • Maximum 15 enum values per property

Property Types & Validation:

  • string: Text values with optional enum_values, min_length, max_length, pattern
  • integer: Whole numbers with optional min_value, max_value
  • float: Decimal numbers with optional min_value, max_value
  • boolean: True/false values
  • datetime: ISO 8601 timestamp strings
  • array: Lists of values
  • object: Complex nested objects

Enum Values:

  • Add enum_values to any string property to restrict values to a predefined list
  • Maximum 15 enum values allowed per property
  • Use with default to set a default enum value
  • Example: "enum_values": ["small", "medium", "large"]

When to Use Enums:

  • Limited, well-defined options (≤15 values): sizes, statuses, categories, priorities
  • Controlled vocabularies: "active/inactive", "high/medium/low", "bronze/silver/gold"
  • When you want exact matching and no variations

When to Avoid Enums:

  • Open-ended text fields: names, titles, descriptions, addresses
  • Large sets of options (>15): countries, cities, product models
  • When you want semantic similarity matching for entity resolution
  • Dynamic or frequently changing value sets

Unique Identifiers & Entity Resolution:

  • Properties marked as unique_identifiers are used for entity deduplication and merging
  • With enum_values: Exact matching is used - entities with the same enum value are considered identical
  • Without enum_values: Semantic similarity matching is used - entities with similar meanings are automatically merged
  • Example: A "name" unique_identifier without enums will merge "Apple Inc" and "Apple Inc." as the same entity
  • Example: A "sku" unique_identifier with enums will only merge entities with exactly matching SKU codes
  • Use enums for unique_identifiers when you have a limited, predefined set of values (≤15 options)
  • Avoid enums for unique_identifiers when you have broad, open-ended values or >15 possible options
  • Best practices: Use enums for controlled vocabularies (status codes, categories), avoid for open text (company names, product titles)
  • In the example above: "name" uses semantic similarity (open-ended), "sku" uses exact matching (controlled set)

LLM-Friendly Descriptions:

  • Write detailed property descriptions that guide the LLM on expected formats and usage
  • Include examples of typical values (e.g., "Product name, typically 2-4 words like 'iPhone 15 Pro'")
  • Specify data formats and constraints clearly (e.g., "Price in USD as decimal number")
  • For enums, explain when to use each option (e.g., "use 'new' for brand new items")

Authentication Required: One of the following authentication methods must be used:

  • Bearer token in Authorization header
  • API Key in X-API-Key header
  • Session token in X-Session-Token header

Required Headers:

  • Content-Type: application/json
  • X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
Bodyapplication/jsonrequired
idstring(Id)
namestring(Name)[ 1 .. 100 ] charactersrequired
descriptionDescription (string) or Description (null)(Description)
Any of:
<= 500 characters
string(Description)<= 500 characters
versionstring(Version)^\d+\.\d+\.\d+$
Default "1.0.0"
user_idUser Id (string) or User Id (object) or User Id (null)(User Id)
Any of:
string(User Id)
workspace_idWorkspace Id (string) or Workspace Id (object) or Workspace Id (null)(Workspace Id)
Any of:
string(Workspace Id)
organizationOrganization (string) or Organization (object) or Organization (null)(Organization)
Any of:
string(Organization)
namespaceNamespace (string) or Namespace (object) or Namespace (null)(Namespace)
Any of:
string(Namespace)
node_typesobject(Node Types)

Custom node types (max 10 per schema)

relationship_typesobject(Relationship Types)

Custom relationship types (max 20 per schema)

statusstring(SchemaStatus)
Default "draft"
Enum"draft""active""deprecated""archived"
scopestring(SchemaScope)

Schema scopes available through the API

Default "organization"
Enum"personal""workspace""namespace""organization"
created_atstring(date-time)(Created At)
updated_atUpdated At (string) or Updated At (null)(Updated At)
Any of:
string(date-time)(Updated At)
read_accessArray of strings(Read Access)
write_accessArray of strings(Write Access)
usage_countinteger(Usage Count)
Default 0
last_used_atLast Used At (string) or Last Used At (null)(Last Used At)
Any of:
string(date-time)(Last Used At)
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": "string",
    "namespace": "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"
  }'

Responses

Successful Response

Bodyapplication/json
successboolean(Success)required
dataUserGraphSchema (object) or null
Any of:

Complete user-defined graph schema

errorError (string) or Error (null)(Error)
Any of:
string(Error)
codeinteger(Code)
Default 200
Response
application/json
{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "version": "1.0.0", "user_id": "string", "workspace_id": "string", "organization": "string", "namespace": "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 }

Memory

Operations

User

Operations

Feedback

Operations

Sync

Operations

Schema Management

Operations

Messages

Operations

Document

Operations

GraphQL

Operations