> ## 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.

# Search Memory

> Hybrid retrieval across the configured memory backends.



## OpenAPI

````yaml /api-reference/openapi-oss.json post /api/v1/memory/search
openapi: 3.1.0
info:
  title: everos
  description: md-first memory extraction framework
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/memory/search:
    post:
      tags:
        - memory
      summary: Search Memory
      description: Hybrid retrieval across the configured memory backends.
      operationId: post_search_api_v1_memory_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
              minLength: 1
            - type: 'null'
          title: User Id
        agent_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Agent Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        query:
          type: string
          minLength: 1
          title: Query
        method:
          $ref: '#/components/schemas/SearchMethod'
          default: hybrid
        top_k:
          type: integer
          title: Top K
          default: -1
        radius:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Radius
        min_score:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Min Score
        include_profile:
          type: boolean
          title: Include Profile
          default: false
        enable_llm_rerank:
          type: boolean
          title: Enable Llm Rerank
          description: >-
            Opt-in LLM rerank pass for HYBRID. Applies to agent_case and
            agent_skill fusion only; the episode hierarchy path has built-in
            fact eviction and ignores this flag. Ignored by keyword / vector /
            agentic.
          default: false
        filters:
          anyOf:
            - $ref: '#/components/schemas/FilterNode'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - query
      title: SearchRequest
      description: |-
        Request body for ``POST /api/v1/memory/search``.

        Callers identify the memory owner via ``user_id`` XOR ``agent_id`` —
        exactly one must be set. Internally the manager + compile_filters keep
        using ``owner_id`` / ``owner_type`` (the storage tables' columns);
        those are exposed as derived properties so the rename only affects
        the wire contract, not the internal recall plumbing.
    SearchResponse:
      properties:
        request_id:
          type: string
          title: Request Id
        data:
          $ref: '#/components/schemas/SearchData'
      additionalProperties: false
      type: object
      required:
        - request_id
        - data
      title: SearchResponse
      description: Top-level response envelope.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchMethod:
      type: string
      enum:
        - keyword
        - vector
        - hybrid
        - agentic
      title: SearchMethod
      description: Public method enum. RRF / LR / vector_anchored are hidden under HYBRID.
    FilterNode:
      properties:
        AND:
          anyOf:
            - items:
                $ref: '#/components/schemas/FilterNode'
              type: array
            - type: 'null'
          title: And
        OR:
          anyOf:
            - items:
                $ref: '#/components/schemas/FilterNode'
              type: array
            - type: 'null'
          title: Or
      additionalProperties: true
      type: object
      title: FilterNode
      description: |-
        One Filters DSL node.

        Recursive ``AND`` / ``OR`` arrays mix with arbitrary scalar fields at
        the same level. Pydantic only checks the combinators; field-level
        safety is enforced when compiling the node to a LanceDB ``where``
        string in :mod:`everos.memory.search.filters`.
    SearchData:
      properties:
        episodes:
          items:
            $ref: '#/components/schemas/SearchEpisodeItem'
          type: array
          title: Episodes
        profiles:
          items:
            $ref: '#/components/schemas/SearchProfileItem'
          type: array
          title: Profiles
        agent_cases:
          items:
            $ref: '#/components/schemas/SearchAgentCaseItem'
          type: array
          title: Agent Cases
        agent_skills:
          items:
            $ref: '#/components/schemas/SearchAgentSkillItem'
          type: array
          title: Agent Skills
        unprocessed_messages:
          items:
            $ref: '#/components/schemas/UnprocessedMessageDTO'
          type: array
          title: Unprocessed Messages
      additionalProperties: false
      type: object
      title: SearchData
      description: |-
        Body of ``response.data``.

        All five arrays are always present so client code can iterate without
        branching on ``owner_type``. Routes not applicable to the request's
        owner type stay as ``[]``. ``unprocessed_messages`` is filled only
        when ``filters.session_id`` is present as a top-level eq scalar —
        in-flight buffer rows are scope-tagged but unattributed (no
        ``user_id``), so session is the only meaningful query dimension.
    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
    SearchEpisodeItem:
      properties:
        id:
          type: string
          title: Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        sender_ids:
          items:
            type: string
          type: array
          title: Sender Ids
        summary:
          type: string
          title: Summary
        subject:
          type: string
          title: Subject
        episode:
          type: string
          title: Episode
        type:
          type: string
          const: Conversation
          title: Type
        score:
          type: number
          title: Score
        atomic_facts:
          items:
            $ref: '#/components/schemas/SearchAtomicFactItem'
          type: array
          title: Atomic Facts
      additionalProperties: false
      type: object
      required:
        - id
        - user_id
        - timestamp
        - summary
        - subject
        - episode
        - type
        - score
      title: SearchEpisodeItem
      description: |-
        Episode hit — always user-scoped in the current emission contract.

        ``type`` is narrowed to ``"Conversation"`` because the only emitted
        episode shape today is conversation-derived; widen when other
        sources ship. Item kind is encoded by class name (no ``owner_type``
        field on the wire), so episode results never carry ambiguity.
    SearchProfileItem:
      properties:
        id:
          type: string
          title: Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        profile_data:
          additionalProperties: true
          type: object
          title: Profile Data
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
      additionalProperties: false
      type: object
      required:
        - id
        - user_id
        - profile_data
      title: SearchProfileItem
      description: |-
        Owner profile — at most one per response, only for user owners.

        ``score`` is ``None`` for direct fetches (``include_profile=true``
        on its own does no ranking); a future query-aware lookup may fill
        it in.
    SearchAgentCaseItem:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        session_id:
          type: string
          title: Session Id
        task_intent:
          type: string
          title: Task Intent
        approach:
          type: string
          title: Approach
        quality_score:
          type: number
          title: Quality Score
        key_insight:
          anyOf:
            - type: string
            - type: 'null'
          title: Key Insight
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        score:
          type: number
          title: Score
      additionalProperties: false
      type: object
      required:
        - id
        - agent_id
        - session_id
        - task_intent
        - approach
        - quality_score
        - timestamp
        - score
      title: SearchAgentCaseItem
      description: Agent case hit — always agent-scoped.
    SearchAgentSkillItem:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        content:
          type: string
          title: Content
        confidence:
          type: number
          title: Confidence
        maturity_score:
          type: number
          title: Maturity Score
        source_case_ids:
          items:
            type: string
          type: array
          title: Source Case Ids
        score:
          type: number
          title: Score
      additionalProperties: false
      type: object
      required:
        - id
        - agent_id
        - name
        - description
        - content
        - confidence
        - maturity_score
        - score
      title: SearchAgentSkillItem
      description: Agent skill hit — always agent-scoped.
    UnprocessedMessageDTO:
      properties:
        id:
          type: string
          title: Id
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        session_id:
          type: string
          title: Session Id
        sender_id:
          type: string
          title: Sender Id
        sender_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Sender Name
        role:
          type: string
          enum:
            - user
            - assistant
            - tool
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Content
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        tool_calls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tool Calls
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
      additionalProperties: false
      type: object
      required:
        - id
        - session_id
        - sender_id
        - role
        - content
        - timestamp
      title: UnprocessedMessageDTO
      description: |-
        A raw message still in the boundary-detection buffer.

        No extracted memcell yet, no owner inference yet (attribution
        happens at boundary detection). Returned by ``/search`` **only when**
        ``filters.session_id`` is present as a top-level eq predicate —
        unprocessed messages have no ``user_id`` / ``agent_id`` to filter
        on, so session is the only meaningful query dimension.
    SearchAtomicFactItem:
      properties:
        id:
          type: string
          title: Id
        content:
          type: string
          title: Content
        score:
          type: number
          title: Score
      additionalProperties: false
      type: object
      required:
        - id
        - content
        - score
      title: SearchAtomicFactItem
      description: A single atomic fact nested inside its parent episode.

````