Skip to main content
PATCH
/
v1
/
knowledge-bases
/
{knowledge_base_id}
Update Knowledge Base V2
curl --request PATCH \
  --url https://api.example.com/v1/knowledge-bases/{knowledge_base_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "status": "created",
  "document_types": [
    "<string>"
  ],
  "kb_type": "temporary",
  "error": {},
  "summary": "<string>",
  "summary_embedding": [
    123
  ],
  "needs_summary_update": true,
  "settings_": {
    "allowed_sources": [
      "Document",
      "Google Drive",
      "OneDrive",
      "Website"
    ],
    "ingestion": {
      "batch_size": 8,
      "default_chunk_size": 1024,
      "default_chunk_overlap": 256,
      "enrich_chunks_mode": "inject_summary",
      "enrich_pre_made_qa": false,
      "methods": {
        "application/csv": {
          "auto_detect_delimiter": true,
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "encoding": "utf-8",
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "include_headers": true,
          "row_as_document": true,
          "supported_mime_types": [
            "text/csv",
            "application/csv"
          ],
          "type": "csv"
        },
        "application/pdf": {
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "enrich_chunks_mode": "inject_summary",
          "extract_images": true,
          "extract_qa_pairs": false,
          "supported_mime_types": [
            "application/pdf",
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
            "application/vnd.openxmlformats-officedocument.presentationml.presentation",
            "application/msword",
            "application/vnd.ms-powerpoint"
          ],
          "type": "pdf"
        },
        "default": {
          "chunk_size": 1024,
          "chunk_overlap": 256,
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "type": "default",
          "supported_mime_types": [
            "text/plain",
            "text/html",
            "text/markdown",
            "application/json",
            "application/xml",
            "text/xml",
            "application/rtf"
          ]
        },
        "image/*": {
          "supported_mime_types": [
            "image/jpeg",
            "image/png",
            "image/tiff",
            "image/bmp"
          ],
          "type": "image"
        },
        "message/rfc822": {
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "extract_text_only": true,
          "include_images": false,
          "include_tables": true,
          "supported_mime_types": [
            "message/rfc822"
          ],
          "type": "email"
        },
        "text/csv": {
          "auto_detect_delimiter": true,
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "encoding": "utf-8",
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "include_headers": true,
          "row_as_document": true,
          "supported_mime_types": [
            "text/csv",
            "application/csv"
          ],
          "type": "csv"
        },
        "text/html": {
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "extract_text_only": true,
          "include_images": false,
          "include_tables": true,
          "supported_mime_types": [
            "text/html"
          ],
          "type": "html"
        },
        "text/plain": {
          "chunk_overlap": 256,
          "chunk_size": 1024,
          "chunking": true,
          "enrich_chunks_mode": "inject_summary",
          "extract_qa_pairs": false,
          "preserve_formatting": true,
          "supported_mime_types": [
            "text/plain",
            "text/html",
            "text/markdown",
            "application/json",
            "application/xml",
            "text/xml",
            "application/rtf"
          ],
          "type": "text"
        }
      }
    },
    "retrieval": {
      "type": "hybrid_reranking",
      "hybrid_settings": {
        "fts_weight": 0.7,
        "full_text_search": {
          "top_k": 25,
          "type": "full_text_search"
        },
        "semantic_search": {
          "sets_threshold": false,
          "threshold": 0,
          "top_k": 25,
          "type": "semantic"
        },
        "semantic_weight": 0.3,
        "threshold": 0,
        "type": "hybrid_relative_score"
      },
      "reranker_settings": {
        "model_name": "semantic-ranker-512@latest",
        "ranking_config": "default_ranking_config",
        "sets_threshold": false,
        "threshold": 0,
        "top_k": 10,
        "type": "vertex"
      }
    },
    "embeddings": {
      "text_model": "vertexai/text-multilingual-embedding-002",
      "mm_model": "vertexai/multimodalembedding@001"
    }
  },
  "version": "<string>",
  "meta": {}
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "status": "created",
  "description": "<string>",
  "document_types": [
    "<string>"
  ],
  "kb_type": "temporary",
  "size": 123,
  "num_docs": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "error": {},
  "version": "v2",
  "total_documents": 123,
  "training_documents": 123,
  "trained_documents": 123,
  "error_documents": 123,
  "uploaded_documents": 123,
  "source_types": {},
  "training_source_types": [
    "Document"
  ],
  "meta": {},
  "settings_": {
    "retrieval_info": "",
    "retrieval_method": "hybrid_relative_score",
    "retrieval_top_k": 25,
    "fts_weight": 0.7,
    "semantic_weight": 0.3,
    "rrf_k": 60,
    "threshold_enabled": false,
    "threshold": 0,
    "reranker_type": "vertex",
    "reranker_top_k": 10,
    "reranker_threshold_enabled": false,
    "reranker_threshold": 0,
    "vertex_model": "semantic-ranker-512@latest",
    "ingestion_info": "",
    "embedding_model": [
      "vertexai/text-multilingual-embedding-002"
    ],
    "mm_embedding_model": [
      "vertexai/multimodalembedding"
    ],
    "batch_size": 8,
    "default_chunk_size": 2048,
    "default_chunk_overlap": 512,
    "enrich_chunks_mode": "inject_summary",
    "enrich_pre_made_qa": false,
    "pdf_info": "",
    "pdf_extract_images": true,
    "pdf_chunk_size": 1024,
    "pdf_chunk_overlap": 256,
    "pdf_ocr_enabled": false,
    "pdf_ocr_confidence": 0.7,
    "pdf_ocr_language": "auto",
    "text_info": "",
    "text_chunking_enabled": true,
    "text_chunk_size": 1024,
    "text_chunk_overlap": 256,
    "text_preserve_formatting": true,
    "html_info": "",
    "html_extract_text_only": true,
    "html_include_tables": true,
    "html_include_images": false,
    "image_info": "",
    "image_ocr_enabled": false,
    "image_ocr_confidence": 0.7,
    "csv_row_as_document": true,
    "csv_include_headers": true,
    "csv_auto_detect_delimiter": true,
    "csv_delimiter": ",",
    "csv_encoding": "utf-8"
  }
}

Authorizations

X-API-Key
string
header
required

Path Parameters

knowledge_base_id
string
required

Body

application/json
name
string | null
description
string | null
status
enum<string> | null
Available options:
created,
trained,
training,
error
document_types
string[] | null
kb_type
enum<string> | null
Available options:
temporary,
entity
error
Error · object
summary
string | null
summary_embedding
number[] | null
needs_summary_update
boolean | null
settings_
KnowledgeBaseSettings · object
version
string | null
meta
Meta · object

Response

Successful Response

id
string<uuid>
required
group_id
string<uuid>
required
name
string
required
status
enum<string>
required
Available options:
created,
trained,
training,
error
description
string
required
document_types
string[]
required
kb_type
enum<string>
required
Available options:
temporary,
entity
size
number
required
num_docs
integer
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
error
Error · object
required
version
enum<string>
required
Available options:
v2,
v3
total_documents
integer
required
training_documents
integer
required
trained_documents
integer
required
error_documents
integer
required
uploaded_documents
integer
required
source_types
Source Types · object
required
training_source_types
enum<string>[]
required
Available options:
Document,
Google Drive,
Notion,
Website,
OneDrive,
Slack,
Linear,
Github,
Teams,
Sharepoint,
ServiceNow,
Custom
meta
Meta · object
settings_
KBConfig · object