> ## Documentation Index
> Fetch the complete documentation index at: https://docs.recallio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Store a new memory (background processing)

> Stores a new memory with embedding vector for semantic search and retrieval. The content will be automatically vectorized using embeddings for semantic search capabilities. This endpoint returns immediately and processes the memory in the background.



## OpenAPI

````yaml https://app.recallio.ai/swagger/v1/swagger.json post /api/Memory/write
openapi: 3.0.4
info:
  title: Recallio API
  description: API for Recallio.AI
  contact:
    name: Recallio.AI Team
    email: support@recallio.ai
  version: v1
servers:
  - url: https://app.recallio.ai
security:
  - Bearer: []
tags:
  - name: Knowledge
  - name: Memory
  - name: MemoryGraph (Extra Pack)
paths:
  /api/Memory/write:
    post:
      tags:
        - Memory
      summary: Store a new memory (background processing)
      description: >-
        Stores a new memory with embedding vector for semantic search and
        retrieval. The content will be automatically vectorized using embeddings
        for semantic search capabilities. This endpoint returns immediately and
        processes the memory in the background.
      operationId: WriteMemory
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryWriteRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/MemoryWriteRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/MemoryWriteRequest'
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReturnClass'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReturnClass'
components:
  schemas:
    MemoryWriteRequest:
      required:
        - consentFlag
        - content
        - userId
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique identifier for the user storing the memory
          example: user_123
        projectId:
          type: string
          description: Project identifier to associate the memory with (optional)
          nullable: true
          example: project_abc
        content:
          maxLength: 30000
          minLength: 1
          type: string
          description: >-
            The actual content/text to be stored. This can be either a string or
            a JSON object. The JSON object format is: [{ "role": "user",
            "content": "string" }, { "role": "assistant", "content": "string" }]
          example: >-
            [{ "role": "user", "content": "I prefer dark mode" }, { "role":
            "assistant", "content": "I will set the dark mode" }]
        tags:
          type: array
          items:
            type: string
          description: Optional tags to categorize and filter memories
          nullable: true
          example:
            - preferences
            - ui
            - notifications
        metadata:
          description: Optional JSON Metadata to categorize and filter memories
          nullable: true
          example:
            timestamp: '2025-08-02T14:30:00Z'
            category: user-preferences
            source: settings-page
        consentFlag:
          type: boolean
          description: >-
            User consent flag - must be true to store the memory (required for
            compliance)
          example: true
      additionalProperties: false
    ErrorReturnClass:
      required:
        - error
      type: object
      properties:
        error:
          minLength: 1
          type: string
          description: Error message indicating the specific validation issue
          example: '"Invalid scope type. Must be ''user'', ''project'', or ''team''."'
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````