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

> Retrieves knowledge base records for the application. Use this endpoint to browse all knowledge base sources including files, text entries, and websites.

# List Knowledge Base Records

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml get /ai-agents/agent-builder/knowledge-base
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/knowledge-base:
    get:
      tags:
        - knowledge-base
      summary: List Knowledge Base Records
      description: >-
        Retrieves knowledge base records for the application. Use this endpoint
        to browse all knowledge base sources including files, text entries, and
        websites.
      operationId: RagController_getKnowledgeBase
      parameters:
        - name: cursor
          required: false
          in: query
          description: To be used with affix for pagination.
          schema:
            example: '1732492800000.12345'
            type: string
        - name: limit
          required: false
          in: query
          description: Maximum number of results to return per page.
          schema:
            example: 20
            type: number
        - name: affix
          required: false
          in: query
          description: >-
            To paginate over results, use the value of affix as prepend or
            append.
          schema:
            enum:
              - append
              - prepend
            type: string
        - name: start
          required: true
          in: query
          schema:
            type: number
        - name: end
          required: true
          in: query
          schema:
            type: number
        - name: endTime
          required: false
          in: query
          description: >-
            End timestamp (Unix timestamp in milliseconds) to filter records
            created before this time
          schema:
            example: 1732579200000
            type: number
        - name: startTime
          required: false
          in: query
          description: >-
            Start timestamp (Unix timestamp in milliseconds) to filter records
            created after this time
          schema:
            example: 1732492800000
            type: number
      responses:
        '200':
          description: >-
            Knowledge base records retrieved successfully with pagination
            metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: >-
                      Array of knowledge base records (excludes _id, __v,
                      paginationKey)
                    items:
                      type: object
                      properties:
                        uniqueId:
                          type: string
                          description: Unique identifier for the record
                        appId:
                          type: string
                          description: Application ID
                        sourceName:
                          type: string
                          description: Name of the source file or text detail
                        type:
                          type: string
                          description: Type of source (uploads, text-details)
                        status:
                          type: string
                          description: Current status (inSync, indexing, indexed, failed)
                        lastSynced:
                          type: number
                          description: Timestamp of last synchronization
                        createdAt:
                          type: number
                          description: Creation timestamp
                        updatedAt:
                          type: number
                          description: Last update timestamp
                  meta:
                    type: object
                    description: Pagination metadata for navigation
                    properties:
                      current:
                        type: object
                        properties:
                          limit:
                            type: number
                            description: Requested page limit
                          count:
                            type: number
                            description: Actual number of records returned
                      previous:
                        type: object
                        description: >-
                          Previous page navigation (only present if previous
                          page exists)
                        properties:
                          affix:
                            type: string
                            enum:
                              - prepend
                            description: Direction for previous page
                          cursor:
                            type: string
                            description: Cursor for previous page
                      next:
                        type: object
                        description: >-
                          Next page navigation (only present if next page
                          exists)
                        properties:
                          affix:
                            type: string
                            enum:
                              - append
                            description: Direction for next page
                          cursor:
                            type: string
                            description: Cursor for next page
              example:
                data:
                  - uniqueId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    appId: my-app-id
                    sourceName: document.pdf
                    type: uploads
                    status: indexed
                    lastSynced: 1700000000000
                    createdAt: 1700000000000
                    updatedAt: 1700000000000
                meta:
                  current:
                    limit: 10
                    count: 1
                  previous:
                    affix: prepend
                    cursor: '1700000000000.12345'
                  next:
                    affix: append
                    cursor: '1700000000000.12345'
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````