Stored search configurations
Nuclia allows you to store search configurations, which are a set of parameters that define how a search should be performed. You can create, update and delete these configurations.
A configuration is either for a find
or an ask
search. The parameters that can be configured are the same as those used in the /find
and /ask
endpoints, such as filter_expression
, prompt
, rag_strategies
, security
, etc.
For example, you can create a search configuration called my_search_config
with the following parameters:
POST https://{region-x}.nuclia.cloud/api/v1/kb/{YOUR-KB-ID}/search_configurations/my_search_config
{
"kind": "ask",
"config": {
"filter_expression": {
"field": {"prop": "language", "language": "en"},
"paragraph": {"not": {"prop": "kind", "kind": "OCR"}},
"operator": "and"
},
"security": {
"groups": ["group1", "group2"]
}
}
}
Then, they can be used either in the /find
or the /ask
endpoints (according their kind
) through the search_configuration
parameter. When using this parameter, you do not need to pass the individual parameters for the search, as they will be automatically loaded from the stored configuration, you just pass the query
parameter containing the user question:
POST https://{region-x}.nuclia.cloud/api/v1/kb/{YOUR-KB-ID}/ask
{
"query": "What is the capital of Belize?",
"search_configuration": "my_search_config"
}
It can be useful in different scenarios, such as:
- Centralizing the search configuration in a single place, making it easier to manage and update.
- Switching between different search configurations without having to modify your code.