Create Index
This method allows you to create an index for a knowledge base.
The index defines how document contents are embedded. For example, it allows you
to define the embeddings model to use by specifying the routing_name
of the
Model Endpoint to use. Additionally, you can specify how to divide the contents
of each document into smaller "chunks"; bigger chunks may provide better context
when they are sent to an LLM for answering questions, but smaller chunks may help
identify and select relevant document parts.
Choosing the right embedding model and best chunking strategy depends on your data
and use-case and may require some experimentation.
Note that you cannot modify an index after its creation. The reason is that all documents in an index must be embedded in the same way. If core properties of the index (such as the embeddings model in use) are changed after the initial insert, it would no longer be possible to meaningfully search, compare, or rank embeddings in the index.
knowledge_base_id
Show optional properties
{
"embeddings_model_endpoint": "string",
"text_splitting": "string",
"chunk_size": 0
}
{
"name": "string",
"description": "string",
"embeddings_model_endpoint": "string",
"text_splitting": "string",
"chunk_size": 0,
"chunk_overlap": 0
}
Name of the index.
Description of the index.
ID of the model to be used by the index for generating embeddings.
Method for chunking text for embedding
Maximum size (in tokens) of the text chunks. This must be at least 100 to accomodate for content metadata embedded alongside each chunk of text.
Size of the chunk overlap (in tokens) when splitting text.
Successful Response
"Index Object"
ID of the index.
Name of the index.
Description of the index.
ID of the model to be used by the index for generating embeddings.
Method for chunking text for embedding
Maximum size (in tokens) of the text chunks. This must be at least 100 to accomodate for content metadata embedded alongside each chunk of text.
Size of the chunk overlap (in tokens) when splitting text.
ID of the knowledge base of the index.
Object type, which is always index
.
Unix timestamp (in seconds) when the index was created.
Unix timestamp (in seconds) when the index contents were last indexed.
ID of the most recent indexing job that affected this index.
Total number of documents in the index.
Availability status of the index.
Details of the index error status, if the index is not available.
Unexpected embeddings model endpoint.
Invalid knowledge base ID.
Index already created for the given knowledge base.
Validation Error
"HTTPValidationError Object"
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"embeddings_model_endpoint:"string","text_splitting:"string","chunk_size:"integer"}' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes