openapi: 3.1.0
info:
  title: Evolution Foundation - Knowledge Service - Memory
  description: Knowledge base and memory management
  version: 1.0.0
servers:
- url: https://api.evoai.app
  description: Production server
- url: http://localhost:3005
  description: Development server
  variables:
    port:
      default: '3005'
- url: '{customUrl}'
  description: Custom server
  variables:
    customUrl:
      default: https://your-instance.com
      description: Enter your server URL
paths:
  /api/v1/memory:
    post:
      summary: Create Memory
      description: Create a new memory entry
      operationId: create_memory_api_v1_memory_post
      parameters:
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      - name: x-memory-base-config-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Memory-Base-Config-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemoryCreateResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid input data
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory base configuration not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory
                  method: POST
  /api/v1/memory/compress:
    post:
      summary: Compress Memory
      description: Manually compress short-term memory into medium-term summary
      operationId: compress_memory_api_v1_memory_compress_post
      parameters:
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      - name: x-memory-base-config-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Memory-Base-Config-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryCompressRequest'
      responses:
        '200':
          description: Memory compression completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemoryCompressResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid input data
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/compress
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/compress
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/compress
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory entries not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/compress
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/compress
                  method: POST
  /api/v1/memory/event:
    post:
      summary: Create Memory Event
      description: Create a single memory event (FIFO - removes oldest when limit reached)
      operationId: create_memory_event_api_v1_memory_event_post
      parameters:
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      - name: x-memory-base-config-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Memory-Base-Config-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryEventCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemoryEventCreateResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid input data
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/event
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/event
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/event
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory base configuration not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/event
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/event
                  method: POST
  /api/v1/memory/health/status:
    get:
      summary: Get Memory Health
      description: Get the health status of the memory service
      operationId: get_memory_health_api_v1_memory_health_status_get
      responses:
        '200':
          description: Health status retrieved successfully
          content:
            application/json:
              schema: {}
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/health/status
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/health/status
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/health/status
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/health/status
                  method: GET
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/health/status
                  method: GET
  /api/v1/memory/load:
    get:
      summary: Load Memory
      description: Load memory entries for an agent during execution (GET endpoint for easier use)
      operationId: load_memory_api_v1_memory_load_get
      parameters:
      - name: app_name
        in: query
        required: true
        schema:
          type: string
          description: Application name (usually agent_id)
          title: App Name
        description: Application name (usually agent_id)
      - name: user_id
        in: query
        required: true
        schema:
          type: string
          description: User ID to load memories for
          title: User Id
        description: User ID to load memories for
      - name: query
        in: query
        required: false
        schema:
          type: string
          description: Search query to find relevant memories. If empty, returns recent memories.
          default: ''
          title: Query
        description: Search query to find relevant memories. If empty, returns recent memories.
      - name: max_results
        in: query
        required: false
        schema:
          type: integer
          maximum: 50
          minimum: 1
          description: Maximum number of results to return
          default: 10
          title: Max Results
        description: Maximum number of results to return
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      responses:
        '200':
          description: Memory loaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemorySearchResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/load
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/load
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/load
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory entries not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/load
                  method: GET
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/load
                  method: GET
  /api/v1/memory/search:
    post:
      summary: Search Memory
      description: Search memory entries for a user/app
      operationId: search_memory_api_v1_memory_search_post
      parameters:
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemorySearch'
      responses:
        '200':
          description: Memory search completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemorySearchResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid input data
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/search
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/search
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/search
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory entries not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/search
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/search
                  method: POST
  /api/v1/memory/{app_name}:
    delete:
      summary: Clear App Memory
      description: Clear all memory entries for an app (all users)
      operationId: clear_app_memory_api_v1_memory__app_name__delete
      parameters:
      - name: app_name
        in: path
        required: true
        schema:
          type: string
          description: Application name (usually agent_id)
          title: App Name
        description: Application name (usually agent_id)
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      responses:
        '200':
          description: Memory cleared successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemoryClearResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}
                  method: DELETE
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}
                  method: DELETE
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}
                  method: DELETE
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory entries not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}
                  method: DELETE
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}
                  method: DELETE
  /api/v1/memory/{app_name}/{user_id}:
    delete:
      summary: Clear User Memory
      description: Clear all memory entries for a specific user/app
      operationId: clear_user_memory_api_v1_memory__app_name___user_id__delete
      parameters:
      - name: app_name
        in: path
        required: true
        schema:
          type: string
          description: Application name (usually agent_id)
          title: App Name
        description: Application name (usually agent_id)
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          description: User ID to clear memories for
          title: User Id
        description: User ID to clear memories for
      - name: x-client-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: X-Client-Id
      responses:
        '200':
          description: Memory cleared successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_MemoryClearResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}/{user_id}
                  method: DELETE
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}/{user_id}
                  method: DELETE
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}/{user_id}
                  method: DELETE
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Memory entries not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}/{user_id}
                  method: DELETE
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/memory/{app_name}/{user_id}
                  method: DELETE
components:
  schemas:
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: false
        error:
          $ref: '#/components/schemas/ErrorInfo'
        meta:
          $ref: '#/components/schemas/MetaInfoError'
          description: Metadata
      type: object
      required:
      - error
      - meta
      title: ErrorResponse
      description: 'Standard error response schema matching error_response() return format.


        This schema matches the structure returned by error_response() function,

        which always uses ErrorInfo for the error field.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MemoryCompressRequest:
      properties:
        app_name:
          type: string
          title: App Name
          description: Application name (usually agent_id)
        user_id:
          type: string
          title: User Id
          description: User ID
        force:
          type: boolean
          title: Force
          description: Force compression even if compression_interval is not reached
          default: false
      type: object
      required:
      - app_name
      - user_id
      title: MemoryCompressRequest
      description: Schema for memory compression request
    MemoryCreate:
      properties:
        app_name:
          type: string
          title: App Name
          description: Application name (usually agent_id)
        user_id:
          type: string
          title: User Id
          description: User ID
        content:
          type: string
          title: Content
          description: Memory content to store
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
          description: Optional metadata dictionary
        session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Session Id
          description: Optional session ID (will be generated if not provided)
        short_term_max_messages:
          anyOf:
          - type: integer
            maximum: 500
            minimum: 10
          - type: 'null'
          title: Short Term Max Messages
          description: Maximum messages in short-term memory before compression
        compression_interval:
          anyOf:
          - type: integer
            maximum: 100
            minimum: 5
          - type: 'null'
          title: Compression Interval
          description: Compress every N messages to medium-term memory
      type: object
      required:
      - app_name
      - user_id
      - content
      title: MemoryCreate
      description: Schema for creating memory entries
    MemoryEventCreate:
      properties:
        app_name:
          type: string
          title: App Name
          description: Application name (usually agent_id)
        user_id:
          type: string
          title: User Id
          description: User ID
        role:
          type: string
          title: Role
          description: Role of the message ('user' or 'agent')
        content:
          type: string
          title: Content
          description: Content of the message
        max_messages:
          anyOf:
          - type: integer
            maximum: 500
            minimum: 10
          - type: 'null'
          title: Max Messages
          description: Maximum messages before removing oldest (FIFO)
        compression_interval:
          anyOf:
          - type: integer
            maximum: 100
            minimum: 5
          - type: 'null'
          title: Compression Interval
          description: Compress every N messages into medium-term memory (optional)
      type: object
      required:
      - app_name
      - user_id
      - role
      - content
      title: MemoryEventCreate
      description: Schema for creating a single memory event (FIFO)
    MemorySearch:
      properties:
        app_name:
          type: string
          title: App Name
          description: Application name (usually agent_id)
        user_id:
          type: string
          title: User Id
          description: User ID to search memories for
        query:
          type: string
          title: Query
          description: Search query to find relevant memories. If empty, returns recent memories.
          default: ''
        max_results:
          type: integer
          maximum: 50
          minimum: 1
          title: Max Results
          description: Maximum number of results to return
          default: 10
      type: object
      required:
      - app_name
      - user_id
      title: MemorySearch
      description: Schema for memory search requests
    SuccessResponse_MemoryClearResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/MemoryClearResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[MemoryClearResponse]
    SuccessResponse_MemoryCompressResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/MemoryCompressResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[MemoryCompressResponse]
    SuccessResponse_MemoryCreateResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/MemoryCreateResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[MemoryCreateResponse]
    SuccessResponse_MemoryEventCreateResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/MemoryEventCreateResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[MemoryEventCreateResponse]
    SuccessResponse_MemorySearchResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/MemorySearchResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[MemorySearchResponse]
