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

# Initialize mem0 sandbox with data

> Initialize the sandbox with mem0-specific data following the defined schema.



## OpenAPI

````yaml post /sandbox/mem0/{sandbox_id}/initialize
openapi: 3.1.0
info:
  title: Klavis AI (https://www.klavis.ai)
  description: Klavis AI - Open Source MCP Integrations for AI Applications
  version: 0.1.0
servers:
  - url: https://api.klavis.ai
    description: US Production server
  - url: https://api.eu.klavis.ai
    description: EU Production server
security: []
paths:
  /sandbox/mem0/{sandbox_id}/initialize:
    post:
      tags:
        - sandbox
      summary: Initialize mem0 sandbox with data
      description: >-
        Initialize the sandbox with mem0-specific data following the defined
        schema.
      operationId: initialize_sandbox_sandbox_mem0__sandbox_id__initialize_post
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            description: The unique sandbox identifier
            title: Sandbox Id
          description: The unique sandbox identifier
        - name: init_default_data
          in: query
          required: false
          schema:
            type: boolean
            description: If true, use default test data for initialization
            default: false
            title: Init Default Data
          description: If true, use default test data for initialization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/Mem0Data-Input'
                - type: 'null'
              title: Request Body
            examples:
              default:
                summary: Example initialization data
                value:
                  memory_list:
                    - message_list:
                        - role: user
                          content: I prefer dark mode for all applications
                      user_id: user_001
                      agent_id: agent_assistant
                      app_id: settings_app
                      run_id: run_12345
                      auto_infer: true
                      background_processing: true
                      category_definitions:
                        - ui_preferences: >-
                            Tracks user interface settings and visual
                            preferences including themes, colors, and display
                            options
                      metadata:
                        category: preferences
                        tags:
                          - ui
                          - settings
                      version: v2
                    - message_list:
                        - role: user
                          content: My favorite programming language is Python
                        - role: assistant
                          content: >-
                            I've noted that Python is your favorite programming
                            language.
                      user_id: user_001
                      agent_id: agent_assistant
                      app_id: dev_app
                      run_id: run_12346
                      auto_infer: true
                      background_processing: true
                      category_definitions:
                        - technical_skills: >-
                            Tracks programming languages, frameworks, tools and
                            technical expertise levels
                      metadata:
                        category: preferences
                        tags:
                          - programming
                          - development
                      version: v2
                    - message_list:
                        - role: user
                          content: I have a meeting every Monday at 9 AM
                      user_id: user_001
                      agent_id: agent_calendar
                      app_id: calendar_app
                      run_id: run_12347
                      auto_infer: true
                      background_processing: false
                      category_definitions:
                        - schedule_management: >-
                            Tracks recurring events, meetings, appointments and
                            time commitments
                      processing_instructions: Store all calendar events with timezone information
                      metadata:
                        category: schedule
                        tags:
                          - calendar
                          - recurring
                      version: v2
                    - message_list:
                        - role: user
                          content: >-
                            I'm working on a machine learning project using
                            TensorFlow
                      user_id: user_001
                      agent_id: agent_assistant
                      app_id: project_app
                      run_id: run_12348
                      auto_infer: true
                      background_processing: true
                      include_preferences: project details, technologies, status
                      category_definitions:
                        - project_tracking: >-
                            Tracks active and past projects including
                            technologies used, status, and objectives
                      metadata:
                        category: projects
                        tags:
                          - ml
                          - tensorflow
                          - current
                      version: v2
                    - message_list:
                        - role: user
                          content: My email is user@example.com
                      user_id: user_001
                      agent_id: agent_assistant
                      app_id: contact_app
                      run_id: run_12349
                      auto_infer: false
                      background_processing: true
                      read_only: true
                      exclude_preferences: temporary contact info
                      category_definitions:
                        - contact_information: >-
                            Tracks permanent contact details including email,
                            phone numbers, and social media handles
                      metadata:
                        category: contact
                        tags:
                          - email
                          - personal
                      version: v2
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitializeSandboxResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Mem0Data-Input:
      properties:
        memory_list:
          items:
            $ref: '#/components/schemas/Mem0Memory'
          type: array
          title: Memory List
          description: List of memories
      type: object
      title: Mem0Data
      description: Complete Mem0 sandbox data structure
    InitializeSandboxResponse:
      properties:
        sandbox_id:
          type: string
          title: Sandbox Id
          description: Sandbox identifier
        status:
          $ref: '#/components/schemas/SandboxStatus'
          description: Current status
        message:
          type: string
          title: Message
          description: Initialization result message
      type: object
      required:
        - sandbox_id
        - status
        - message
      title: InitializeSandboxResponse
      description: Response model for sandbox initialization
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Mem0Memory:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Memory ID (read-only, set by Mem0)
        content_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Text
          description: Memory content (returned from API)
        message_list:
          anyOf:
            - items:
                $ref: '#/components/schemas/Mem0Message'
              type: array
            - type: 'null'
          title: Message List
          description: Array of message objects representing the content
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: Agent ID
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: User ID
        app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: App Id
          description: App ID
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
          description: Run ID
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Additional metadata
        include_preferences:
          anyOf:
            - type: string
            - type: 'null'
          title: Include Preferences
          description: String to include specific preferences in the memory
        exclude_preferences:
          anyOf:
            - type: string
            - type: 'null'
          title: Exclude Preferences
          description: String to exclude specific preferences in the memory
        auto_infer:
          type: boolean
          title: Auto Infer
          description: Whether to infer memories or directly store messages
          default: true
        response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Format
          description: Response format structure (v1.0 or v1.1)
          default: v1.1
        category_definitions:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Category Definitions
          description: List of custom categories with name and description
        processing_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Instructions
          description: Project-specific guidelines for handling memories
        read_only:
          type: boolean
          title: Read Only
          description: Whether the memory is immutable
          default: false
        background_processing:
          type: boolean
          title: Background Processing
          description: Whether to add memory asynchronously
          default: true
        timestamp:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timestamp
          description: Unix timestamp of the memory
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: Last update timestamp
      type: object
      title: Mem0Memory
      description: Mem0 Memory object
    SandboxStatus:
      type: string
      enum:
        - idle
        - occupied
        - error
      title: SandboxStatus
      description: Status of a sandbox instance - matches database enum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Mem0Message:
      properties:
        role:
          type: string
          title: Role
          description: Role of the message sender (user or assistant)
        content:
          type: string
          title: Content
          description: Content of the message
      type: object
      required:
        - role
        - content
      title: Mem0Message
      description: Message object for memory
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````