Skip to content

Commit 59dc373

Browse files
mjirvMichael Irvine
andauthored
docs(ai): adds value search section (#9020)
* docs(ai): adds value search section * deduplicates value search --------- Co-authored-by: Michael Irvine <[email protected]>
1 parent 64104c5 commit 59dc373

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/pages/product/apis-integrations/ai-api.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,44 @@ to give the AI context on possible values in a categorical dimension:
181181
- completed
182182
```
183183
184+
### Value search
185+
186+
By default, the AI API has no ability to see the contents of your data (for privacy reasons).
187+
However, this makes it difficult for the AI API to generate correct filters for some queries.
188+
189+
Imagine you have a categorical `order_status` dimension with the possible values "shipped",
190+
"processing", and "completed". Without value search, asking "how many complete orders did
191+
we have today" might get you a query filtering on `order_status = 'Complete'` instead of
192+
the correct `order_status = 'completed'`.
193+
194+
To solve this, the AI API can perform "value searches" where it introspects the values in
195+
selected categorical dimensions before running a query. Value search is opt-in and dimensions
196+
must be enabled for it individually. Currently, the AI API performs value search by running
197+
Cube queries using the `contains` filter operator against one or more chosen dimensions.
198+
The LLM will select dimensions from among those you have based on the question asked and
199+
generate possible values dynamically.
200+
201+
<InfoBox>
202+
When running value search queries, the AI API passes through the security context used
203+
for the AI API request, so security is maintained and only dimensions the end user has
204+
access to are able to be searched.
205+
</InfoBox>
206+
207+
To enable value search on a dimension, set the `searchable` field to true under the `ai`
208+
meta tag, as shown below:
209+
```yaml
210+
- name: order_status
211+
sql: order_status
212+
type: string
213+
meta:
214+
ai:
215+
searchable: true
216+
```
217+
218+
Note that enabling Value Search may lead to slightly longer AI API response times when it
219+
is used but should result in significantly more accurate queries in many situations. Value
220+
Search can only be used on string dimensions.
221+
184222
### Other LLM providers
185223

186224
<InfoBox>

docs/pages/product/workspace/ai-assistant.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ to give the AI context on possible values in a categorical dimension:
9797
- completed
9898
```
9999
100+
### Value search
101+
102+
Value Search can be enabled for AI Assistant in the same way as for the AI API. See the
103+
[AI API's documentation][ref-ai-api-value-search] for details and instructions.
104+
100105
### Other LLM providers
101106
102107
See the [AI API's documentation][ref-ai-api-providers] for information on how to "bring your own" LLM.
@@ -127,3 +132,4 @@ See the [AI API's documentation][ref-ai-api-providers] for information on how to
127132
[ref-playground]: /product/workspace/playground
128133
[ref-catalog-downstream]: /product/workspace/semantic-catalog#connecting-downstream-tools
129134
[ref-ai-api-providers]: /product/apis-integrations/ai-api#other-llm-providers
135+
[ref-ai-api-value-search]: /product/apis-integrations/ai-api#value-search

0 commit comments

Comments
 (0)