Skip to main content

Create Knowledge Bases

Knowledge Bases are the fundamental next step to build a chatbot, which is required to bundle with one or more Source Data. The steps will be list in following session.

Create knowledge base

Knowledge Bases can be composed with many sources, thus first is to create a knowledge base frame then to make a bundle with certain source data which can form a specific topic of knowledge. Knowledge Base can be created by sending a POST request to the following API: POST bv/aisk/v1/knowledge-bases Configure the schedule request body with the following options:

ParameterRequiredDescription
nameyesNaming knowledge base.

A successful response will contain an `id`, which is the identifier of the knowledge base. Here is an example of the response :
{
"knowledge_base" {
"id": "string",
"name": "string",
"status": "KNOWLEDGE_BASE_STATUS_PROCESSING",
"character_count": "string",
"created_at": "2024-02-04T10:09:39.362Z",
"updated_at": "2024-02-04T10:09:39.362Z",
"error_infos": [
{
"reason": "string",
"domain": "string",
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
}
]
}
}

Knowledge Base status mainly depends on Source Data status, if Source Data is not process ready, Knowledge Base will remain in KNOWLEDGE_BASE_STATUS_PROCESSING. Possible status are: KNOWLEDGE_BASE_STATUS_PROCESSING,KNOWLEDGE_BASE_STATUS_READY,KNOWLEDGE_BASE_STATUS_FAILED,KNOWLEDGE_BASE_STATUS_DELETING


Add Source Data to Knowledge Base

Once a Knowledge Base has been created, the next step is to create a relationship among source data which has been created and ingested with data. by sending request to API: POST bv/aisk/v1/knowledge-bases/{id}/sources/{source_id} Configure the request body with the following options:

ParameterRequiredDescription
idyesThe uuid of the knowledge base
source_idyesThe uuid of the source that will be added to the knowledge base