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

# Search Knowledge

> Search the knowledge base for relevant documents using query, filters and search type.



## OpenAPI

````yaml post /knowledge/search
openapi: 3.1.0
info:
  title: Agno AgentOS
  description: An agent operating system.
  version: 1.0.0
servers: []
security: []
paths:
  /knowledge/search:
    post:
      tags:
        - Knowledge
      summary: Search Knowledge
      description: >-
        Search the knowledge base for relevant documents using query, filters
        and search type.
      operationId: search_knowledge
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VectorSearchRequestSchema'
        required: true
      responses:
        '200':
          description: Search results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_VectorSearchResult_'
              example:
                data:
                  - id: doc_123
                    content: >-
                      Jordan Mitchell - Software Engineer with skills in
                      JavaScript, React, Python
                    name: cv_1
                    meta_data:
                      page: 1
                      chunk: 1
                    usage:
                      total_tokens: 14
                    reranking_score: 0.95
                    content_id: content_456
                meta:
                  page: 1
                  limit: 20
                  total_pages: 2
                  total_count: 35
        '400':
          description: Invalid search parameters
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '404':
          description: No documents found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    VectorSearchRequestSchema:
      properties:
        query:
          type: string
          title: Query
          description: The search query
        db_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Db Id
          description: The content database id
        vector_db_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Vector Db Ids
          description: List of vector database ids to search in
        search_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Type
          description: The type of search to perform
        max_results:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Results
          description: The maximum number of results to return
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
          description: The filters to apply to the search
        meta:
          anyOf:
            - $ref: '#/components/schemas/Meta'
            - type: 'null'
          description: >-
            Pagination metadata. Limit and page number to return a subset of
            results.
      type: object
      required:
        - query
      title: VectorSearchRequestSchema
      description: Schema for vector search request.
    PaginatedResponse_VectorSearchResult_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/VectorSearchResult'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/PaginationInfo'
      type: object
      required:
        - data
        - meta
      title: PaginatedResponse[VectorSearchResult]
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
        error_code: UNAUTHENTICATED
    ValidationErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: ValidationErrorResponse
      example:
        detail: Validation error
        error_code: VALIDATION_ERROR
    InternalServerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - detail
      title: InternalServerErrorResponse
      example:
        detail: Internal server error
        error_code: INTERNAL_SERVER_ERROR
    Meta:
      properties:
        limit:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 1
            - type: 'null'
          title: Limit
          description: Number of results per page
          default: 20
        page:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Page
          description: Page number
          default: 1
      type: object
      title: Meta
      description: Inline metadata schema for pagination.
    VectorSearchResult:
      properties:
        id:
          type: string
          title: Id
        content:
          type: string
          title: Content
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        meta_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta Data
        usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage
        reranking_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Reranking Score
        content_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Id
        content_origin:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Origin
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
      type: object
      required:
        - id
        - content
      title: VectorSearchResult
      description: Schema for search result documents.
    PaginationInfo:
      properties:
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
          default: 0
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
          default: 20
        total_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Pages
          default: 0
        total_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Count
          default: 0
        search_time_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Search Time Ms
          default: 0
      type: object
      title: PaginationInfo
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````