@@ -97,6 +97,44 @@ to give the AI context on possible values in a categorical dimension:
9797 - completed
9898` ` `
9999
100+ ### Value search
101+
102+ By default, the AI Assistant has no ability to see the contents of your data (for privacy reasons).
103+ However, this makes it difficult for the AI Assistant to generate correct filters for some queries.
104+
105+ Imagine you have a categorical ` order_status` dimension with the possible values "shipped",
106+ " processing" , and "completed". Without value search, asking "how many complete orders did
107+ we have today" might get you a query filtering on `order_status = 'Complete'` instead of
108+ the correct `order_status = 'completed'`.
109+
110+ To solve this, the AI Assistant can perform "value searches" where it introspects the values in
111+ selected categorical dimensions before running a query. Value search is opt-in and dimensions
112+ must be enabled for it individually. Currently, the AI Assistant performs value search by running
113+ Cube queries using the `contains` filter operator against one or more chosen dimensions.
114+ The LLM will select dimensions from among those you have based on the question asked and
115+ generate possible values dynamically.
116+
117+ <InfoBox>
118+ When running value search queries, the AI Assistant passes through the security context used
119+ for the AI Assistant request, so security is maintained and only dimensions the end user has
120+ access to are able to be searched.
121+ </InfoBox>
122+
123+ To enable value search on a dimension, set the `searchable` field to true under the `ai`
124+ meta tag, as shown below :
125+ ` ` ` yaml
126+ - name: order_status
127+ sql: order_status
128+ type: string
129+ meta:
130+ ai:
131+ searchable: true
132+ ` ` `
133+
134+ Note that enabling Value Search may lead to slightly longer AI Assistant response times when it
135+ is used but should result in significantly more accurate queries in many situations. Value
136+ Search can only be used on string dimensions.
137+
100138# ## Other LLM providers
101139
102140See the [AI API's documentation][ref-ai-api-providers] for information on how to "bring your own" LLM.
0 commit comments