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

# Search Memories

> Perform a search for relevant memories within a specified memory space.



## OpenAPI

````yaml https://api.crosmos.dev/openapi.json post /api/v1/search
openapi: 3.1.0
info:
  title: Crosmos Memory API
  description: Agent memory system with hybrid retrieval
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/search:
    post:
      tags:
        - search
      summary: Search Memories
      description: Perform a search for relevant memories within a specified memory space.
      operationId: search_memories_api_v1_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'
      security:
        - HTTPBearer: []
components:
  schemas:
    SearchRequest:
      properties:
        query:
          type: string
          maxLength: 3000
          minLength: 1
          title: Query
          description: The search query text
        space_id:
          type: string
          format: uuid
          title: Space Id
          description: The memory space to search within
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          description: Max number of results to return
          default: 10
        recency_bias:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Recency Bias
          description: >-
            Override recency weighting. 0.0 disables recency, higher values
            favor recent memories.
        rerank:
          type: boolean
          title: Rerank
          description: Apply cross-encoder reranking. Disable for lower latency.
          default: true
        graph:
          type: boolean
          title: Graph
          description: Include graph traversal signal. Disable for semantic + keyword only.
          default: true
        diversify:
          type: boolean
          title: Diversify
          description: >-
            Apply MMR diversity post-rerank. Enable for broad/summarization
            intents.
          default: false
        include_source:
          type: boolean
          title: Include Source
          description: Include original source text in results.
          default: true
      type: object
      required:
        - query
        - space_id
      title: SearchRequest
    SearchResponse:
      properties:
        query:
          type: string
          title: Query
        candidates:
          items:
            $ref: '#/components/schemas/MemoryCandidate'
          type: array
          title: Candidates
        total:
          type: integer
          title: Total
          description: Total number of candidates returned
        took_ms:
          type: number
          title: Took Ms
          description: Search execution time in milliseconds
      type: object
      required:
        - query
        - candidates
        - total
        - took_ms
      title: SearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MemoryCandidate:
      properties:
        memory_id:
          type: string
          format: uuid
          title: Memory Id
        content:
          type: string
          title: Content
        memory_type:
          type: string
          title: Memory Type
        score:
          type: number
          title: Score
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          description: Original source text the memory was extracted from
        created_at:
          type: string
          format: date-time
          title: Created At
        recorded_at:
          type: string
          format: date-time
          title: Recorded At
        event_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Event Time
      type: object
      required:
        - memory_id
        - content
        - memory_type
        - score
        - created_at
        - recorded_at
        - event_time
      title: MemoryCandidate
    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
  securitySchemes:
    HTTPBearer:
      type: http
      description: JWT access token or API key (csk_…)
      scheme: bearer

````