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

# Create Knowledge Base

> Create a knowledge base that your agent can use for retrieval augmented generation (RAG).



## OpenAPI

````yaml /docs/openapi.json post /api/v1/knowledge-base/
openapi: 3.1.0
info:
  title: Voice AI Developer API
  description: >-
    Generate realistic speech and clone voices. AI voice agents with retrieval
    augmented generation (RAG) and model context protocol (MCP) included.
  version: 1.5.0
  contact: {}
servers:
  - url: https://dev.voice.ai
    description: HTTP API endpoints
security:
  - BearerAuth: []
tags:
  - name: Text To Speech
    description: Text-to-speech endpoints for voice cloning and speech generation.
  - name: Pronunciation Dictionaries
    description: Manage versioned pronunciation dictionaries for TTS and voice agents.
  - name: Agent Management
    description: Create, update, deploy, and manage voice agents.
  - name: Models
    description: Discover supported LLM and TTS model options.
  - name: Agent Connection
    description: Connect to agents and manage active calls.
  - name: Agent Analytics
    description: >-
      Analytics and reporting for agent performance, call history, and
      statistics.
  - name: Agent Knowledge Base
    description: >-
      Manage knowledge bases for retrieval augmented generation (RAG) with your
      agents.
  - name: Phone Number Management
    description: >-
      Search, select, and manage phone numbers from your plan allocation.
      Release numbers to free up slots.
  - name: Managed Tools
    description: >-
      Connect Google Calendar, Sheets, and Gmail to agents and inspect
      connection state.
paths:
  /api/v1/knowledge-base/:
    post:
      tags:
        - Agent Knowledge Base
      summary: Create Knowledge Base
      description: >-
        Create a knowledge base that your agent can use for retrieval augmented
        generation (RAG).
      operationId: create_knowledge_base_api_v1_knowledge_base__post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeBaseRequest'
        required: true
      responses:
        '200':
          description: Existing knowledge base with identical content found and returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '201':
          description: Knowledge base created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateKnowledgeBaseRequest:
      properties:
        name:
          type: string
          title: Name
          description: Knowledge base name
        description:
          type: string
          title: Description
          description: Knowledge base description
        documents:
          items:
            type: object
            properties:
              content:
                type: string
                title: Content
                description: Document text content (required)
              metadata:
                type: object
                additionalProperties: true
                title: Metadata
                description: Optional metadata dictionary
            required:
              - content
            additionalProperties: false
          type: array
          title: Documents
          description: List of documents. At least one document required.
          minItems: 1
      type: object
      required:
        - documents
      title: CreateKnowledgeBaseRequest
    KnowledgeBaseResponse:
      properties:
        kb_id:
          type: integer
          title: Kb Id
        name:
          type: string
          title: Name
          nullable: true
        description:
          type: string
          title: Description
          nullable: true
        document_count:
          type: integer
          title: Document Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        message:
          type: string
          title: Message
          nullable: true
      type: object
      required:
        - kb_id
        - document_count
        - created_at
        - updated_at
      title: KnowledgeBaseResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Error message
        detail:
          type: string
          title: Detail
          description: Detailed error information
          nullable: true
        code:
          type: string
          title: Code
          description: Error code
          nullable: true
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Use your API key as the bearer token.
        Format: Authorization: Bearer <your-api-key>

````