ALTER KNOWLEDGE_BASE command enables users to modify the configuration of the existing knowledge base without the need to recreate it.
This document lists parameters that can be altered, explains the process and the effect on the existing knowledge base.
ALTER KNOWLEDGE_BASE Syntax
Here is the syntax used to alter the existing knowledge base.
-
embedding_modelUsers can alter only the API key of the provider used for the embedding model, while users cannot alter the provider and the model itself because it would be incompatible with the already embedded content that is stored in a knowledge base.Upon altering the API key of the embedding model’s provider, ensure that the new API key has access to the same embedding model so that the knowledge base can continue to function without issues. -
reranking_modelUsers can turn off reranking by settingreranking_model = false, or change the provider, API key, and model used for reranking.Upon updating the reranking model, the knowledge base will use the newly defined reranking model when reranking results, provided that reranking is turned on. -
content_columnsUsers can change the content columns.Upon changing the content columns, all the previously inserted content stays unchanged. Now the knowledge base will be embedding content from columns defined in the most recent call toALTER KNOWLEDGE_BASE. -
metadata_columnsUsers can change the metadata columns, overriding the existing metadata columns.Upon changing the metadata columns:- All metadata fields are stored in the knowledge base. No data is removed.
-
Users can filter only by metadata fields defined in the most recent call to
ALTER KNOWLEDGE_BASE. -
To be able to filter by all metadata fields, include them in the list as below.
-
id_columnUsers can change the ID column.Upon changing the ID column, users must keep in mind that inserting data with an already existing ID value will update the existing row and not create a new one. -
storageUsers cannot update the underlying vector database of the existing knowledge base. -
preprocessingUsers can modify thepreprocessingparameters as defined here.