kb

Upload and ingest a document into the knowledge base.

Args: collection: Target collection name. If not provided, uses file name. file: The document file to upload and process. parse_method: Parser used during ingestion. chunk_strategy: Strategy for chunking the document. chunk_size: Target chunk size in characters. chunk_overlap: Overlap between consecutive chunks. separators: Optional JSON array of custom chunk separators (recursive only). embedding_model_id: Embedding model ID from model hub. embedding_batch_size: Batch size for embedding operations. max_retries: Maximum retry attempts for failures. retry_delay: Delay between retry attempts in seconds.

post/api/kb/ingest

Request

Request body multipart/form-data

collectionstring
filestring binary required
parse_method'default' | 'pypdf' | 'pdfplumber' | 'unstructured' | 'pymupdf' | 'deepdoc'

Available parsing methods

chunk_strategy'recursive' | 'fixed_size' | 'markdown'

Available chunk strategies

chunk_sizeinteger nullable

Chunk size in characters (default: 1000)

chunk_overlapinteger nullable

Chunk overlap in characters (default: 200)

separatorsstring nullable

Custom chunk separators as JSON array of strings, e.g. ["\n\n", "\n", "。"]. Only used when chunk_strategy is recursive. Omit or empty to use default separators.

embedding_model_idstring

Embedding model ID (default: text-embedding-v4)

embedding_batch_sizeinteger nullable

Batch size for embedding (default: 10)

max_retriesinteger nullable

Maximum retries for embedding failures (default: 3)

retry_delaynumber nullable

Delay between retries in seconds (default: 1.0)

Response

Successful Response

statusstring required

Pipeline status: success|error|partial

doc_idstring nullable

Document identifier produced by register_document

parse_hashstring nullable

Parse hash produced during parse_document step

chunk_countinteger

Number of chunks created; must be non-negative

embedding_countinteger

Number of embeddings generated; must be non-negative

vector_countinteger

Number of vectors written to storage; must be non-negative

failed_stepstring nullable

Pipeline step where failure occurred, if any

messagestring required

Human-readable summary of pipeline result

warningsstring[]

Non-fatal warnings encountered

file_idstring nullable

Uploaded file ID for preview/download via /api/files (when ingest registers the file)

Changes

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status