Dynamic Chunking

Get File Chunks

get

Endpoint to get chunks by file id from a specified knowledge base with pagination.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

Query parameters
pageintegerOptional

Page number (0-based)

Default: 0
sizeinteger · min: 1 · max: 1000Optional

Number of chunks per page

Default: 20
Responses
get
/{knowledge_base_id}/files/{file_id}/chunks

Create Chunk

post

Endpoint to create a new chunk based on the file id to a specified knowledge base.

This endpoint will:

  1. Generate chunk metadata: chunk ID, relationships with adjacent chunks.

  2. Process the chunk through the Data Generator and Indexer.

  3. Update the metadata of neighboring chunks to maintain proper relationships.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

Body

The body of the request

next_chunkany ofRequired

The ID of the chunk that should follow the created chunk in the sequence.

stringOptional
or
nullOptional
previous_chunkany ofRequired

The ID of the chunk that should precede the created chunk in the sequence.

stringOptional
or
nullOptional
Responses
post
/{knowledge_base_id}/files/{file_id}/chunks

Delete File Chunks

delete

Endpoint to delete all file chunks by file id from a knowledge base.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

Responses
delete
/{knowledge_base_id}/files/{file_id}/chunks

Get Chunk

get

Endpoint to get a chunk based on the chunk id from a file in a specified knowledge base.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

chunk_idstringRequired

The ID of the chunk

Responses
get
/{knowledge_base_id}/files/{file_id}/chunks/{chunk_id}

Update Chunk

put

Endpoint to update a chunk based on the chunk id from a file in a specified knowledge base.

This endpoint will:

  1. Update the chunk's text content and/or metadata, but ignoring the system-managed metadata fields (file_id, chunk_id, previous_chunk, next_chunk, parent_chunk, children_chunk, order)

  2. When updating text content:

  • Triggers re-processing of the chunk using the data generator

  • Re-indexes the chunk with updated vector embeddings based on the new text

  1. When only updating metadata:

  • Can only add or modify existing metadata fields

  • Cannot remove existing metadata keys

  • System-managed metadata fields (file_id, chunk_id, etc.) are preserved

  1. Return the updated chunk information

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

chunk_idstringRequired

The ID of the chunk

Body

The body of the request

textstringRequired

The text content of the chunk.

structurestringOptional

The structure of the chunk.

Default: uncategorized
Responses
put
/{knowledge_base_id}/files/{file_id}/chunks/{chunk_id}

Delete Chunk

delete

Endpoint to delete a chunk based on the chunk id from a file in a specified knowledge base.

This endpoint will:

  1. Delete the chunk from the vector database.

  2. Update the metadata of the next and previous chunks to reflect the deletion.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

chunk_idstringRequired

The ID of the chunk

Responses
delete
/{knowledge_base_id}/files/{file_id}/chunks/{chunk_id}

Update Chunk Metadata

patch

Endpoint to update a chunk metadata based on the chunk id from a file in a specified knowledge base.

This endpoint will:

  1. Update only the chunk's metadata fields, but ignoring the system-managed metadata fields (file_id, chunk_id, previous_chunk, next_chunk, parent_chunk, children_chunk, order)

  2. When updating metadata:

  • Can only add or modify existing metadata fields (source, source_type, loaded_datetime, etc.)

  • Cannot remove existing metadata keys

  1. Return the updated chunk information with the modified metadata

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

chunk_idstringRequired

The ID of the chunk

Body

The chunk metadata to update

Other propertiesanyOptional
Responses
patch
/{knowledge_base_id}/files/{file_id}/chunks/{chunk_id}

Merge Chunks

post

Endpoint to merge multiple chunks based on the chunk ids from the request body.

This endpoint will:

  1. Merge the chunks (text and metadata) based on the chunk ids.

  2. Process the merged chunk through DPO pipeline (from Data Generator component).

  3. Delete the original chunks that are merged.

  4. Update the metadata of next chunk to maintain proper relationships.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

Body

The list of chunk IDs to merge

chunk_idsstring[]Required

The IDs of the chunks to merge.

Responses
post
/{knowledge_base_id}/files/{file_id}/chunks/merge

Process File

post

Endpoint to process a file to a specified knowledge base.

⚠️ WARNING: This endpoint is not implemented yet.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

Body
input_typestring · enumRequired

The type of the file. File type could be FILE or URL.

Possible values:
file_idany ofOptional

The ID of the file. If not provided, the file id will be generated.

stringOptional
or
nullOptional
fileany ofOptional

The file to be processed.

string · binaryOptional
or
nullOptional
urlany ofOptional

The url of the file to be processed.

stringOptional
or
nullOptional
Responses
post
/{knowledge_base_id}/files

No content

Process File to Chunks

post

This endpoint accept POST request to process a file to chunks with configuration specified in the request. If no configuration is specified, the default configuration in the knowledge base will be used. The input to be processed can be a file upload or a URL.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

Body
inputany ofRequired

The input to be processed. Can be a file upload or a URL.

string · binaryOptional
or
stringOptional
input_typestring · enumRequired

The type of the input. Can be FILE or URL.

Possible values:
input_file_nameany ofOptional

The name of the input file. Required for non-UploadFile inputs when type is FILE.

stringOptional
or
nullOptional
processing_configany ofOptional

The DPO processing configuration.

stringOptional
or
nullOptional
Responses
post
/{knowledge_base_id}/chunks

Split Chunk

post

Endpoint to split a chunk based on the chunk id, and the split indices from the request body.

This endpoint will:

  1. Split the existing chunk into two new chunks at the specified split index.

  2. Maintain proper ordering and relationships between chunks.

  3. Process the new chunks through the Data Generator and Indexer.

  4. Update the metadata of next chunk to maintain proper relationships.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

file_idstringRequired

The ID of the file

chunk_idstringRequired

The ID of the chunk

Body

The split indices

split_indexintegerRequired

The index of the split point. Valid range: 1 to length-1

Responses
post
/{knowledge_base_id}/files/{file_id}/chunks/{chunk_id}/split

Get Processing Configuration

get

Endpoint to get the processing configuration for specified knowledge base.

Path parameters
knowledge_base_idstringRequired

The ID of the knowledge base

Responses
get
/{knowledge_base_id}/processing-config

Last updated