Create Knowledge Base
This method allows you to create a new knowledge base.
A knowledge base can be created using one of two types: a knowledge base can either
be linked to data sources (by using data_origin_type=DATA_SOURCES
), or it can be
maintained independently of data sources (by using data_origin_type=LOCAL_FILES
).
If a knowledge base is linked to one or more data sources, it is automatically
filled with data by crawling and retrieving documents from the linked data sources.
If documents are added or removed from a data source, the indexes of the
knowledge base are updated automatically when an indexing is triggered.
An indexing can be triggered explicitly via the API, or it can be configured to
happen periodically using an index_refresh_policy
.
Otherwise, if a knowledge base not linked, you can maintain the knowledge base contents yourself. You can add documents by uploading them via the API, and uploaded documents can be removed using the API.
Note that the type of knowledge base cannot be changed after the creation, and it is not possible to mix the two types (e.g., link a knowledge base to a set of data sources and also upload files via the API).
Show optional properties
{
"data_origin_type": "string"
}
{
"name": "string",
"description": "string",
"data_origin_type": "string"
}
Name of the knowledge base.
Description of the knowledge base.
Policy defining when to refresh the index of the knowledge base.
data_origin_type
Successful Response
"KnowledgeBase Object"
ID of the knowledge base.
Name of the knowledge base.
Description of the knowledge base.
Policy defining when to refresh the index of the knowledge base.
data_origin_type
Object type, which is always knowledge_base
.
Unix timestamp (in seconds) when the knowledge base was created.
Unix timestamp (in seconds) when the knowledge base was last updated.
Unix timestamp (in seconds) of the next scheduled indexing.
Unsupported configuration of knowledge base.
Validation Error
"HTTPValidationError Object"
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"index_refresh_policy":"{}","data_origin_type:"string"}' https://{api_host}/api/v1/control/knowledge-bases