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

# Create Knowledge Base

> Creates a new non-deterministic knowledge base. Rate limit: 10 requests per hour per workspace. File size limit: 2 MB per file, 5 MB total. Maximum 10 files and 20 URLs per request.

## Create Knowledge Base

Create a new non-deterministic knowledge base that can be used to provide context and information to your AI agents. Knowledge bases support multiple content types including files, URLs, and FAQs.

<Warning>
  **Rate Limits**:

  * Maximum 10 requests per hour per workspace
  * File size limit: 2 MB per file, 5 MB total
  * Maximum 10 files and 20 URLs per request
</Warning>

## Content Types

### Files

Upload documents (PDF, TXT, DOCX, etc.) to provide structured information to your knowledge base.

* Max 10 files per request
* 2 MB per file limit
* 5 MB total size limit

### URLs

Index web pages to automatically extract and store their content.

* Max 20 URLs per request
* URLs are crawled and indexed automatically
* Content is refreshed periodically

### FAQs

Provide question-answer pairs for deterministic responses to common queries.

```json theme={null}
{
  "faqs": "[{\"question\": \"What is your return policy?\", \"answer\": \"30-day money back guarantee\"}]"
}
```

## Processing Status

Knowledge base creation is asynchronous. The response includes:

* `kb_id`: Unique identifier for the knowledge base
* `processing_status`: Current status (`pending`, `processing`, `completed`)
* `files_queued`: Number of files being processed

Use the [Get Knowledge Base by ID](/api-reference/endpoint/kb/get-knowledge-base-by-id) endpoint to check processing status.

## Important Notes

* **Asynchronous Processing**: Files and URLs are processed in the background
* **Content Updates**: Use the [Edit Knowledge Base](/api-reference/endpoint/kb/edit-knowledge-base) endpoint to update content
* **Agent Integration**: Link knowledge bases to agents via the assistant configuration


## OpenAPI

````yaml post /external/kb
openapi: 3.0.0
info:
  title: Ringg AI API Documentation
  description: >-
    This is the documentation for the Ringg AI APIs. The Ringg AI API follows
    RESTful principles, making it intuitive and easy to integrate with your
    applications. All API requests should be made to the base URL. The API
    accepts and returns data in JSON format. Ensure your requests include the
    appropriate Content-Type header for POST and PATCH requests.
  version: 2.0.0
servers:
  - url: https://prod-api.ringg.ai/ca/api/v0
security: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing assistants (agents).
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: Endpoints for accessing call analytics and performance metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /external/kb:
    post:
      tags:
        - knowledgebase
      summary: Create Knowledge Base
      description: >-
        Creates a new non-deterministic knowledge base. Rate limit: 10 requests
        per hour per workspace. File size limit: 2 MB per file, 5 MB total.
        Maximum 10 files and 20 URLs per request.
      operationId: createKnowledgeBase
      parameters:
        - name: X-API-KEY
          in: header
          description: (Required) Your Ringg AI API key.
          required: true
          schema:
            type: string
            example: 7251cb4b-3373-43a4-844c-b27a1d45e0c9
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - kb_name
              properties:
                kb_name:
                  type: string
                  description: (Required) Name of the knowledge base
                  example: Product Documentation
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    (Optional) Array of files to upload (max 10 files, 2 MB
                    each, 5 MB total)
                urls:
                  type: string
                  description: (Optional) JSON string array of URLs to index (max 20 URLs)
                  example: '["https://example.com/docs", "https://example.com/faq"]'
                faqs:
                  type: string
                  description: (Optional) JSON string array of FAQ objects
                  example: >-
                    [{"question": "What is your return policy?", "answer":
                    "30-day money back guarantee"}]
      responses:
        '200':
          description: Knowledge base created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Knowledge Base creation initiated
                  kb_id:
                    type: string
                    example: 550e8400-e29b-41d4-a716-446655440000
                  processing_status:
                    type: string
                    example: pending
                  files_queued:
                    type: integer
                    example: 3
        '400':
          description: Bad Request - Invalid parameters or file size exceeded.
        '401':
          description: Unauthorized - Invalid or missing API key.
        '429':
          description: Rate limit exceeded - Maximum 10 requests per hour.

````