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

# Search knowledge base

> Search for relevant sections in the knowledge base using semantic search



## OpenAPI

````yaml /swagger.yml post /public/knowledge-base/search
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/knowledge-base/search:
    post:
      tags:
        - Knowledge Base
      summary: Search knowledge base
      description: Search for relevant sections in the knowledge base using semantic search
      operationId: PublicKnowledgeBaseController_search
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchKnowledgeBaseRequest'
      responses:
        '200':
          description: Search completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchKnowledgeBaseResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    SearchKnowledgeBaseRequest:
      type: object
      properties:
        query:
          type: string
          description: The search query
          example: What is RCS?
        sourceIds:
          description: Optional list of source IDs to search within
          type: array
          items:
            type: number
        limit:
          type: number
          default: 10
          minimum: 1
          maximum: 50
          description: Maximum number of sections to return (1-50)
          example: 10
        similarity:
          type: number
          default: 0.77
          minimum: 0
          maximum: 1
          description: Minimum similarity threshold (0-1)
          example: 0.77
      required:
        - query
    SearchKnowledgeBaseResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SectionResult'
        total:
          type: number
          description: The total number of sections returned
          example: 5
        query:
          type: string
          description: The original search query
          example: What is RCS?
      required:
        - data
        - total
        - query
    SectionResult:
      type: object
      properties:
        id:
          type: number
          description: The ID of the knowledge section
        content:
          type: string
          description: The content of the section
        similarity:
          type: number
          description: The similarity score (0-1)
          example: 0.85
      required:
        - id
        - content
        - similarity
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````