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

# Add agent memories

> Add messages and extract memory into memory space.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/memories/agent
openapi: 3.1.0
info:
  title: EverOS API
  description: >-
    Enterprise-grade intelligent memory system for AI agents. Extracts,
    structures, and retrieves information from conversations.
  version: 1.0.0
  contact:
    name: EverOS Team
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.evermind.ai
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Memories
    description: Memory ingestion, retrieval, search, and deletion
  - name: Groups
    description: Group resource CRUD operations
  - name: Senders
    description: Sender resource CRUD operations
  - name: Settings
    description: Global settings management
  - name: Tasks
    description: Async task status tracking
  - name: Storage
    description: Multimodal content storage (pre-signed upload)
paths:
  /api/v1/memories/agent:
    post:
      tags:
        - Memories
      summary: Add agent memories
      description: Add messages and extract memory into memory space.
      operationId: addAgentMemories
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentAddRequest'
      responses:
        '200':
          description: 'Messages accepted successfully (sync mode: async_mode=false)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddResponse'
        '202':
          description: Messages queued for async processing (async_mode=true, default)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncAddResponse'
        '400':
          description: >-
            Request syntax error (malformed JSON, empty body, body size
            exceeded, missing required fields)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Validation error (invalid parameter values, business rule
            violations)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                tool_missing_tool_call_id:
                  summary: role=tool without tool_call_id
                  value:
                    code: InvalidParameter
                    message: tool_call_id is required when role is tool
                    request_id: unknown
                    timestamp: '2026-03-24T00:00:00+00:00'
                    path: /api/v1/memories/agent
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            from everos_cloud import EverOS

            client = EverOS()
            agent = client.v1.memories.agent

            response = agent.add(
                user_id="<string>",
                session_id="<string>",
                messages=[
                    {
                        "role": "<string>",
                        "timestamp": "<integer>",
                        "content": "<string>"
                    }
                ]
            )
            print(response)
        - lang: cURL
          source: |-
            curl --request POST \
              --url 'https://api.evermind.ai/api/v1/memories/agent' \
              --header 'Authorization: Bearer <api_key>' \
              --header 'Content-Type: application/json' \
              --data '{}'
components:
  schemas:
    AgentAddRequest:
      type: object
      required:
        - user_id
        - messages
      properties:
        user_id:
          type: string
          description: Owner user ID
        session_id:
          description: Session identifier
          type:
            - string
            - 'null'
        messages:
          type: array
          description: Agent trajectory messages (1-500 items)
          items:
            $ref: '#/components/schemas/AgentMessageItem'
          minItems: 1
          maxItems: 500
        async_mode:
          type: boolean
          description: >-
            Enable async processing. When true, returns 202 with task_id; when
            false, processes synchronously and returns 200.
          default: true
    AddResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AddResult'
    AsyncAddResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AsyncAddResult'
    ErrorResponse:
      type: object
      required:
        - code
        - message
        - timestamp
        - path
      properties:
        code:
          type: string
          description: Error code
          examples:
            - InvalidParameter
            - NotFound
            - InternalError
        message:
          type: string
          description: Error message
        request_id:
          type: string
          description: Request ID
          default: unknown
        timestamp:
          type: string
          description: ISO 8601 timestamp
        path:
          type: string
          description: Request path
    AgentMessageItem:
      type: object
      required:
        - role
        - timestamp
      properties:
        role:
          type: string
          description: Message sender role
          enum:
            - user
            - assistant
            - tool
        timestamp:
          type: integer
          description: Message timestamp in unix milliseconds
        content:
          description: >-
            Content items array for multimodal content, or plain string for
            text-only messages.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentItem'
              minItems: 1
            - type: 'null'
        sender_id:
          description: Sender identifier
          type:
            - string
            - 'null'
        tool_calls:
          description: >-
            Tool calls made by assistant (OpenAI format). Only when
            role='assistant'.
          items:
            $ref: '#/components/schemas/ToolCall'
          type:
            - array
            - 'null'
        tool_call_id:
          description: >-
            ID of the tool call this message responds to. Required when
            role='tool'.
          type:
            - string
            - 'null'
    AddResult:
      type: object
      properties:
        task_id:
          type: string
          description: Task tracking ID
          default: ''
        message_count:
          type: integer
          description: Number of messages accepted
          default: 0
        status:
          type: string
          description: Processing status
          enum:
            - accumulated
            - extracted
          default: accumulated
        message:
          type: string
          description: Human-readable status description
          default: Messages accepted
    AsyncAddResult:
      type: object
      properties:
        task_id:
          type: string
          description: Async task tracking ID
        status:
          type: string
          description: Always 'queued' for async mode
          enum:
            - queued
          default: queued
        message_count:
          type: integer
          description: Number of messages accepted
          default: 0
        message:
          type: string
          description: Human-readable status description
          default: Message accepted and queued for processing
    ContentItem:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: Content type
          enum:
            - text
            - audio
            - image
            - doc
            - pdf
            - html
            - email
        text:
          description: Content body. For type='text', this is the actual text.
          type:
            - string
            - 'null'
        source:
          description: Content source (e.g., google_doc, notion, confluence, zoom)
          type:
            - string
            - 'null'
        uri:
          description: >-
            The objectKey returned by the Upload multimodal data API (POST
            /api/v1/object/sign).
          type:
            - string
            - 'null'
        ext:
          description: File extension (e.g., png, mp3, pdf)
          type:
            - string
            - 'null'
        name:
          description: File name
          type:
            - string
            - 'null'
        source_info:
          description: Source-related traceability info
          additionalProperties: true
          type:
            - object
            - 'null'
        extras:
          description: Type-specific extra fields
          additionalProperties: true
          type:
            - object
            - 'null'
    ToolCall:
      type: object
      required:
        - id
        - function
      properties:
        id:
          type: string
          description: Unique tool call ID
        type:
          type: string
          description: Tool call type
          default: function
        function:
          $ref: '#/components/schemas/ToolCallFunction'
    ToolCallFunction:
      type: object
      required:
        - name
        - arguments
      properties:
        name:
          type: string
          description: Function/tool name
        arguments:
          type: string
          description: JSON-encoded arguments string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      x-default: Bearer <api_key>
      description: >-
        Bearer authentication header of the form Bearer 'api_key', obtain your
        API key from [everos.evermind.ai](https://everos.evermind.ai).

````