KAITO Index Management API

Create, list, and delete RAG indexes and their documents.

OpenAPI Specification

kaito-index-management-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: KAITO RAGEngine REST Chat Index Management API
  description: REST API for the KAITO RAGEngine, used to manage indexes, ingest and retrieve documents, persist or reload indexes from storage, and run OpenAI-compatible chat completions grounded in indexed content. The API is exposed by a self-hosted RAGEngine service running in a Kubernetes cluster.
  version: 1.0.0
  contact:
    name: KAITO Project
    url: https://kaito-project.github.io/kaito/
  license:
    name: MIT
    url: https://github.com/kaito-project/kaito/blob/main/LICENSE
servers:
- url: http://localhost:8080
  description: Self-hosted KAITO RAGEngine endpoint (replace with the in-cluster service URL).
tags:
- name: Index Management
  description: Create, list, and delete RAG indexes and their documents.
paths:
  /index:
    post:
      operationId: createIndex
      summary: Create or append documents to an index
      description: Create a RAG index (or append to it) with the supplied documents.
      tags:
      - Index Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                index_name:
                  type: string
                documents:
                  type: array
                  items:
                    type: object
              required:
              - index_name
              - documents
      responses:
        '200':
          description: Index created or updated.
          content:
            application/json:
              schema:
                type: object
  /indexes/{index_name}/documents:
    get:
      operationId: listIndexDocuments
      summary: List documents in an index
      description: Return documents stored in the named index with optional pagination and filters.
      tags:
      - Index Management
      parameters:
      - name: index_name
        in: path
        required: true
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
      - name: offset
        in: query
        schema:
          type: integer
      - name: max_text_length
        in: query
        schema:
          type: integer
      - name: metadata_filter
        in: query
        schema:
          type: string
      responses:
        '200':
          description: A list of documents.
          content:
            application/json:
              schema:
                type: object
    post:
      operationId: appendIndexDocuments
      summary: Append documents to an index
      description: Append additional documents (each with a doc_id) to an existing index.
      tags:
      - Index Management
      parameters:
      - name: index_name
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documents:
                  type: array
                  items:
                    type: object
              required:
              - documents
      responses:
        '200':
          description: Documents appended.
          content:
            application/json:
              schema:
                type: object
  /indexes/{index_name}/documents/delete:
    post:
      operationId: deleteIndexDocuments
      summary: Delete documents from an index
      description: Delete documents from the named index by doc_id.
      tags:
      - Index Management
      parameters:
      - name: index_name
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                doc_ids:
                  type: array
                  items:
                    type: string
              required:
              - doc_ids
      responses:
        '200':
          description: Documents deleted.
          content:
            application/json:
              schema:
                type: object
  /indexes/{index_name}:
    delete:
      operationId: deleteIndex
      summary: Delete an index
      description: Delete the entire named index.
      tags:
      - Index Management
      parameters:
      - name: index_name
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Index deleted.