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

# Similar Search

> Find products similar to a set of anchor products.

User-triggered Find-Similar (Theme 4 / ADR-026): caller passes
one or more anchor product IDs, gets back products closest to
the centroid of their vectors.

Anchors must belong to the caller's tenant (visibility filter
is applied via tenant_id; the centroid is meaningless across
tenants anyway).



## OpenAPI

````yaml /api-reference/openapi.json post /api/knowledge/search/similar
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/similar:
    post:
      tags:
        - Search
      summary: Similar Search
      description: |-
        Find products similar to a set of anchor products.

        User-triggered Find-Similar (Theme 4 / ADR-026): caller passes
        one or more anchor product IDs, gets back products closest to
        the centroid of their vectors.

        Anchors must belong to the caller's tenant (visibility filter
        is applied via tenant_id; the centroid is meaningless across
        tenants anyway).
      operationId: similar_search_search_similar_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/SimilarSearchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimilarSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SimilarSearchRequest:
      properties:
        anchor_product_ids:
          items:
            type: string
          type: array
          maxItems: 10
          minItems: 1
          title: Anchor Product Ids
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          default: 8
        vector_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Vector Field
          description: >-
            description / properties / attributes / hybrid; default from tenant
            settings
        site_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Site Id
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        exclude_product_ids:
          items:
            type: string
          type: array
          title: Exclude Product Ids
          description: IDs to exclude from the result (e.g. already shown)
      type: object
      required:
        - anchor_product_ids
      title: SimilarSearchRequest
      description: |-
        Find products similar to a set of anchor products.

        User-triggered Find-Similar action (Theme 4) — caller passes
        anchor product IDs, gets back products closest to the centroid
        of their vectors in the configured anchor-vector space.
    SimilarSearchResponse:
      properties:
        anchor_product_ids:
          items:
            type: string
          type: array
          title: Anchor Product Ids
        products:
          items:
            $ref: '#/components/schemas/ProductSearchHit-Output'
          type: array
          title: Products
        vector_field:
          type: string
          title: Vector Field
      type: object
      required:
        - anchor_product_ids
        - vector_field
      title: SimilarSearchResponse
      description: Result of a centroid-based similar search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    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>`.

````