> ## Documentation Index
> Fetch the complete documentation index at: https://memos-api.openmem.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Search memories

> Search for memories across MemCubes.



## OpenAPI

````yaml POST /search
openapi: 3.1.0
info:
  title: MemOS REST APIs
  description: A REST API for managing and searching memories using MemOS.
  version: 1.0.0
servers: []
security: []
paths:
  /search:
    post:
      summary: Search memories
      description: Search for memories across MemCubes.
      operationId: search_memories_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SearchRequest:
      properties:
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: User ID for the request
          example: user123
        query:
          type: string
          title: Query
          description: Search query.
          example: How to implement a feature?
        install_cube_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Install Cube Ids
          description: List of cube IDs to search in
          example:
            - cube123
            - cube456
      type: object
      required:
        - query
      title: SearchRequest
    SearchResponse:
      properties:
        code:
          type: integer
          title: Code
          description: Response status code
          default: 200
          example: 200
        message:
          type: string
          title: Message
          description: Response message
          example: Operation successful
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Data
          description: Response data
      type: object
      required:
        - message
      title: SearchResponse
      description: Response model for search operations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````