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

# Create Knowledge Base



## OpenAPI

````yaml https://originshq.b-cdn.net/openapi_sayna.json post /api/knowledge_bases
openapi: 3.1.0
info:
  title: core
  version: 0.1.0
servers: []
security: []
paths:
  /api/knowledge_bases:
    post:
      tags:
        - knowledge_bases
      summary: Create Knowledge Base
      operationId: create_knowledge_base_api_knowledge_bases_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeBaseRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    KnowledgeBaseRequest:
      properties:
        knowledge_base_name:
          type: string
          title: Knowledge Base Name
        agent_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Id
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
        context_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Context Url
        vector_db_name_space:
          anyOf:
            - type: string
            - type: 'null'
          title: Vector Db Name Space
        embedding_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Model
        embedding_dimension:
          anyOf:
            - type: integer
            - type: 'null'
          title: Embedding Dimension
          default: 1536
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - knowledge_base_name
      title: KnowledgeBaseRequest
    KnowledgeBaseResponse:
      properties:
        id:
          type: integer
          title: Id
        knowledge_base_name:
          type: string
          title: Knowledge Base Name
        agent_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Id
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
        context_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Context Url
        vector_db_name_space:
          anyOf:
            - type: string
            - type: 'null'
          title: Vector Db Name Space
        embedding_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Model
        embedding_dimension:
          anyOf:
            - type: integer
            - type: 'null'
          title: Embedding Dimension
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - knowledge_base_name
        - created_at
        - updated_at
      title: KnowledgeBaseResponse
    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

````