Skip to content

Commit da7cdce

Browse files
authored
Obs AI Assistant supports other models than ELSER when field type semantic_text is used (#4754)
1 parent 20b43cb commit da7cdce

File tree

1 file changed

+41
-14
lines changed

1 file changed

+41
-14
lines changed

docs/en/observability/observability-ai-assistant.asciidoc

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Search connectors are only needed when importing external data into the Knowledg
152152

153153
{ref}/es-connectors.html[Connectors] allow you to index content from external sources thereby making it available for the AI Assistant. This can greatly improve the relevance of the AI Assistant’s responses. Data can be integrated from sources such as GitHub, Confluence, Google Drive, Jira, AWS S3, Microsoft Teams, Slack, and more.
154154

155-
UI affordances for creating and managing search connectors are available in the Search Solution in {kib}.
155+
UI affordances for creating and managing search connectors are available in the Search Solution in {kib}.
156156
You can also use the {es} {ref}/connector-apis.html[Connector APIs] to create and manage search connectors.
157157

158158
The infrastructure for deploying connectors can be managed by Elastic or self-managed. Managed connectors require an {enterprise-search-ref}/server.html[Enterprise Search] server connected to the Elastic Stack. Self-managed connectors are run on your own infrastructure and don't require the Enterprise Search service.
@@ -172,27 +172,54 @@ If your {kib} Space doesn't include the Search solution you will have to create
172172
For example, if you create a {ref}/es-connectors-github.html[GitHub connector] you have to set a `name`, attach it to a new or existing `index`, add your `personal access token` and include the `list of repositories` to synchronize.
173173
+
174174
Learn more about configuring and {ref}/es-connectors-usage.html[using connectors] in the Elasticsearch documentation.
175-
+
176-
. Create a pipeline and process the data with ELSER.
177-
+
178-
To create the embeddings needed by the AI Assistant (weights and tokens into a sparse vector field), you have to create an *ML Inference Pipeline*:
179-
+
180-
.. Open the previously created connector and select the *Pipelines* tab.
181-
.. Select *Copy and customize* button at the `Unlock your custom pipelines` box.
182-
.. Select *Add Inference Pipeline* button at the `Machine Learning Inference Pipelines` box.
183-
.. Select *ELSER (Elastic Learned Sparse EncodeR)* ML model to add the necessary embeddings to the data.
184-
.. Select the fields that need to be evaluated as part of the inference pipeline.
185-
.. Test and save the inference pipeline and the overall pipeline.
175+
176+
After creating your connector, create the embeddings needed by the AI Assistant. You can do this using either:
177+
178+
* <<obs-ai-search-connectors-ml-embeddings, a machine learning (ML) pipeline>>: requires the ELSER ML model.
179+
* <<obs-ai-search-connectors-semantic-text, a `semantic_text` field type>>: can use any available ML model (ELSER, E5, or a custom model).
180+
181+
[discrete]
182+
[[obs-ai-search-connectors-ml-embeddings]]
183+
==== Use machine learning pipelines to create AI Assistant embeddings
184+
185+
To create the embeddings needed by the AI Assistant (weights and tokens into a sparse vector field) using an *ML Inference Pipeline*:
186+
187+
. Open the previously created connector, and select the *Pipelines* tab.
188+
. Select *Copy and customize* under `Unlock your custom pipelines`.
189+
. Select *Add Inference Pipeline* under `Machine Learning Inference Pipelines`.
190+
. Select the *ELSER (Elastic Learned Sparse EncodeR)* ML model to add the necessary embeddings to the data.
191+
. Select the fields that need to be evaluated as part of the inference pipeline.
192+
. Test and save the inference pipeline and the overall pipeline.
193+
194+
After creating the pipeline, complete the following steps:
195+
186196
. Sync the data.
187197
+
188198
Once the pipeline is set up, perform a *Full Content Sync* of the connector. The inference pipeline will process the data as follows:
189199
+
190-
* As data comes in, ELSER is applied to the data, and embeddings (weights and tokens into a sparse vector field) are added to capture semantic meaning and context of the data.
191-
* When you look at the documents that are ingested, you can see how the weights and token are added to the `predicted_value` field in the documents.
200+
* As data comes in, ELSER is applied to the data, and embeddings (weights and tokens into a {ref}/query-dsl-sparse-vector-query.html[sparse vector field]) are added to capture semantic meaning and context of the data.
201+
* When you look at the ingested documents, you can see the embeddings are added to the `predicted_value` field in the documents.
192202
. Check if AI Assistant can use the index (optional).
193203
+
194204
Ask something to the AI Assistant related with the indexed data.
195205

206+
[discrete]
207+
[[obs-ai-search-connectors-semantic-text]]
208+
==== Use a `semantic_text` field type to create AI Assistant embeddings
209+
210+
To create the embeddings needed by the AI Assistant using a {ref}/semantic-text.html[`semantic_text`] field type:
211+
212+
. Open the previously created connector, and select the *Mappings* tab.
213+
. Select *Add field*.
214+
. Under *Field type*, select *Semantic text*.
215+
. Under *Reference field*, select the field you want to use for model inference.
216+
. Under *Select an inference endpoint*, select the model you want to use to add the embeddings to the data.
217+
. Add the field to your mapping by selecting *Add field*.
218+
. Sync the data by selecting *Full Content* from the *Sync* menu.
219+
220+
The AI Assistant will now query the connector you've set up using the model you've selected.
221+
Check that the AI Assistant is using the index by asking it something related to the indexed data.
222+
196223
[discrete]
197224
[[obs-ai-interact]]
198225
== Interact with the AI Assistant

0 commit comments

Comments
 (0)