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

# Unified Search

> Hybrid search across knowledge entries and/or products.

Product results come back in four sections (treffer / ergebnisse /
aehnliche / vielleicht) plus the legacy flat lists for backward
compatibility with consumers that haven't migrated yet.

Pipeline (Block C strategy):
    Pre-Filter → parallel(Exact, BM25, Semantic) →
    RRF-Fusion → Cross-Encoder Reranker → Section Split →
    optional Auto-Similar (Centroid-KNN)



## OpenAPI

````yaml /api-reference/openapi.json post /api/knowledge/search
openapi: 3.1.0
info:
  title: Big Panda — Public API
  description: >-
    Externe REST-API für Connector-Plugins (JTL, Shopware), n8n-Integrationen
    und Custom-Clients. Tenant-Routing über Subdomain, Auth über Bearer-Token.
  version: 0.1.0
servers:
  - url: https://{tenant}.app.big-panda.ai
    description: Big Panda — Tenant-Subdomain. Ersetze {tenant} durch deinen Tenant-Slug.
    variables:
      tenant:
        default: demo
        description: Dein Big-Panda-Tenant-Slug (z.B. 'acme').
security:
  - BearerAuth: []
tags:
  - name: Products
  - name: Knowledge Entries
  - name: Categories
  - name: Sites
  - name: Search
  - name: OAuth
    description: >-
      OAuth-2.1-Authentifizierung — Discovery, Dynamic Client Registration,
      Authorize, Token, Revoke.
paths:
  /api/knowledge/search:
    post:
      tags:
        - Search
      summary: Unified Search
      description: |-
        Hybrid search across knowledge entries and/or products.

        Product results come back in four sections (treffer / ergebnisse /
        aehnliche / vielleicht) plus the legacy flat lists for backward
        compatibility with consumers that haven't migrated yet.

        Pipeline (Block C strategy):
            Pre-Filter → parallel(Exact, BM25, Semantic) →
            RRF-Fusion → Cross-Encoder Reranker → Section Split →
            optional Auto-Similar (Centroid-KNN)
      operationId: unified_search_search_post
      parameters:
        - name: X-Scopes
          in: header
          required: false
          schema:
            type: string
            description: Space-separated scope set from the token (ADR-015)
            default: ''
            title: X-Scopes
          description: Space-separated scope set from the token (ADR-015)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnifiedSearchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnifiedSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UnifiedSearchRequest:
      properties:
        query:
          type: string
          maxLength: 2000
          minLength: 1
          title: Query
        sources:
          items:
            type: string
          type: array
          title: Sources
          description: 'Which sources to search: ''knowledge'', ''products'', or both'
          default:
            - knowledge
            - products
        limit:
          type: integer
          maximum: 100
          minimum: 1
          title: Limit
          default: 10
        min_similarity:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Min Similarity
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Filter by language
        site_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Site Id
          description: Filter products by site (UUID or slug)
        knowledge:
          anyOf:
            - $ref: '#/components/schemas/KnowledgeSearchOptions'
            - type: 'null'
      type: object
      required:
        - query
      title: UnifiedSearchRequest
      description: |-
        Unified search across knowledge entries and/or products.

        The `sources` parameter controls which data pools are searched.
        Per-source tuning lives in `knowledge` (and later `products`)
        sub-objects so consumer-types can scope each pool separately.
    UnifiedSearchResponse:
      properties:
        search_log_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Log Id
        treffer:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Treffer
        ergebnisse:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Ergebnisse
        aehnliche:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Aehnliche
        vielleicht:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Vielleicht
        layer_results:
          additionalProperties: true
          type: object
          title: Layer Results
        latency_breakdown:
          additionalProperties:
            type: integer
          type: object
          title: Latency Breakdown
        latency_ms:
          type: integer
          title: Latency Ms
          default: 0
        exact_matches:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Exact Matches
        knowledge:
          items:
            $ref: '#/components/schemas/KnowledgeSearchHit'
          type: array
          title: Knowledge
        products:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Products
        query:
          type: string
          title: Query
        sources_searched:
          items:
            type: string
          type: array
          title: Sources Searched
      type: object
      required:
        - query
        - sources_searched
      title: UnifiedSearchResponse
      description: |-
        Combined search results.

        Two views on the same data:
        - **Sectioned view** (Block C strategy): treffer/ergebnisse/
          aehnliche/vielleicht — what the new widget renders.
        - **Legacy flat view**: exact_matches + products + knowledge —
          kept filled for backward-compat with the RAG-Engine and the
          pre-refactor widget. Removed once all consumers migrated.

        Plus `search_log_id` — the row-id of the persisted SearchLog,
        so the widget can later POST click events tied to this search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KnowledgeSearchOptions:
      properties:
        type_filter:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Type Filter
          description: >-
            Restrict to these entry types (knowledge / skill / process /
            glossary / memory). Used by widget vs MCP vs internal-chat to scope
            to relevant entry types.
        tags_filter:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags Filter
          description: Restrict to entries whose tags overlap with this list.
      type: object
      title: KnowledgeSearchOptions
      description: |-
        Optional per-source configuration for knowledge entries.

        Sprint 7.3 — caller can scope the knowledge results without
        changing the rest of the search request. Empty/None means "no
        constraint on this axis".
    ProductSearchHit-Output:
      properties:
        id:
          type: string
          title: Id
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        short_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Short Description
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        gtin:
          anyOf:
            - type: string
            - type: 'null'
          title: Gtin
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        price_current:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Current
        price_msrp:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Msrp
        price_special:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Special
        price_on_request:
          type: boolean
          title: Price On Request
        currency:
          type: string
          title: Currency
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        product_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Url
        availability:
          anyOf:
            - type: string
            - type: 'null'
          title: Availability
        rating_average:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Rating Average
        rating_count:
          type: integer
          title: Rating Count
        language:
          type: string
          title: Language
        score:
          type: number
          title: Score
        score_sources:
          additionalProperties: true
          type: object
          title: Score Sources
      type: object
      required:
        - id
        - external_id
        - title
        - description
        - short_description
        - sku
        - gtin
        - brand
        - category
        - price_current
        - price_msrp
        - price_special
        - price_on_request
        - currency
        - image_url
        - product_url
        - availability
        - rating_average
        - rating_count
        - language
        - score
        - score_sources
      title: ProductSearchHit
      description: A product hit from semantic vector search.
    KnowledgeSearchHit:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        content:
          type: string
          title: Content
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        category_id:
          type: string
          title: Category Id
        language:
          type: string
          title: Language
        visibility:
          type: string
          title: Visibility
        tags:
          items:
            type: string
          type: array
          title: Tags
        similarity:
          type: number
          title: Similarity
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
        score_sources:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Score Sources
        section:
          anyOf:
            - type: string
            - type: 'null'
          title: Section
      type: object
      required:
        - id
        - title
        - content
        - summary
        - category_id
        - language
        - visibility
        - tags
        - similarity
      title: KnowledgeSearchHit
      description: A knowledge entry hit in search results.
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API-Token aus dem Big-Panda-Admin-UI unter Einstellungen → API-Keys.
        Header: `Authorization: Bearer <token>`.

````