v1
Memory

Add Memory V1

Add a new memory item to the system with size validation and background processing.

**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')

**Role-Based Memory Categories**:
- **User memories**: preference, task, goal, facts, context
- **Assistant memories**: skills, learning

**New Metadata Fields**:
- `metadata.role`: Optional field to specify who generated the memory (user or assistant)
- `metadata.category`: Optional field for memory categorization based on role
- Both fields are stored within metadata at the same level as topics, location, etc.

The API validates content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
post/v1/memory

Query parameters

skip_background_processingboolean

If True, skips adding background tasks for processing

If True, skips adding background tasks for processing

Request body

contentstring required

The content of the memory item you want to add to memory

type'text' | 'code_snippet' | 'document'

Valid memory types

organization_idstring nullable

Optional organization ID for multi-tenant memory scoping. When provided, memory is associated with this organization.

namespace_idstring nullable

Optional namespace ID for multi-tenant memory scoping. When provided, memory is associated with this namespace.

Example request

{
  "content": "Meeting with John Smith from Acme Corp about the Q4 project timeline",
  "context": [
    {
      "content": "Let's discuss the Q4 project timeline with John",
      "role": "user"
    },
    {
      "content": "I'll help you prepare for the timeline discussion. What are your key milestones?",
      "role": "assistant"
    }
  ],
  "graph_override": {
    "nodes": [
      {
        "id": "person_john_smith",
        "label": "Person",
        "properties": {
          "name": "John Smith",
          "role": "Project Manager",
          "description": "Senior PM at Acme Corp"
        }
      },
      {
        "id": "company_acme_corp",
        "label": "Company",
        "properties": {
          "name": "Acme Corp",
          "description": "Client company for Q4 project"
        }
      }
    ],
    "relationships": [
      {
        "properties": {
          "role": "Project Manager"
        },
        "relationship_type": "WORKS_FOR",
        "source_node_id": "person_john_smith",
        "target_node_id": "company_acme_corp"
      }
    ]
  },
  "metadata": {
    "conversationId": "conv-123",
    "createdAt": "2024-10-04T10:00:00Z",
    "emoji_tags": "📅,👥,📋",
    "emotion_tags": "focused, productive",
    "external_user_id": "external_user_123",
    "external_user_read_access": [
      "external_user_123",
      "external_user_789"
    ],
    "external_user_write_access": [
      "external_user_123"
    ],
    "hierarchical_structures": "Business/Meetings/Project Planning",
    "location": "Conference Room A",
    "sourceUrl": "https://calendar.example.com/meeting/123",
    "topics": [
      "product",
      "planning"
    ]
  },
  "type": "text"
}

Response

Memory successfully added

codeinteger

HTTP status code

statusstring

'success' or 'error'

errorstring nullable

Error message if failed

{"stackTrail":"components:schemas:AddMemoryResponse:properties:details:anyOf","oasType":"schema","type":"unknown","title":"Details","description":"Additional error details or context","nullable":true}

Changes