Skip to content

Commit d73bc25

Browse files
copy edits
1 parent 3b89066 commit d73bc25

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

learn/chat/conversational_search.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
22
title: What is conversational search?
3-
description: Conversational search is an AI-powered feature that allows users to ask questions in everyday language and receive answers based on the information in Meilisearch's indexes
3+
description: Conversational search allows people to make search queries using natural languages.
44
---
55

6+
Conversational search is an AI-powered search feature that allows users to ask questions in everyday language and receive answers based on the information in Meilisearch's indexes.
7+
68
## When to use conversational vs traditional search
79

810
Use conversational search when:
911

1012
- Users need easy-to-read answers to specific questions
11-
- You are handling informational-dense content, such as software documentation and knowledge bases
13+
- You are handling informational-dense content, such as knowledge bases
1214
- Natural language interaction improves user experience
1315

1416
Use traditional search when:
1517

1618
- Users need to browse multiple options, such as an ecommerce website
17-
- Approximative answers are not acceptable
19+
- Approximate answers are not acceptable
1820
- Your users need very quick responses
1921

20-
## How conversational search usage differs from traditional search
22+
<Warning>
23+
Conversational search is still in early development. Conversational agents may occasionally hallucinate inaccurate and misleading information, so it is important to closely monitor it in production environments.
24+
</Warning>
25+
26+
## Conversational search user workflow
2127

2228
### Traditional search workflow
2329

@@ -46,10 +52,6 @@ Meilisearch's chat completions API consolidates RAG creation into a single proce
4652

4753
Follow the [chat completions tutorial](/learn/chat/getting_started_with_chat) for information on how to implement a RAG with Meilisearch.
4854

49-
<Warning>
50-
Conversational search is still in early development. Conversational agents may occasionally hallucinate inaccurate and misleading information, so it is important to closely monitor it in production environments.
51-
</Warning>
52-
5355
### Model Context Protocol (MCP)
5456

5557
An alternative method is using a Model Context Protocol (MCP) server. MCPs are designed for broader uses that go beyond answering questions, but can be useful in contexts where having up-to-date data is more important than comprehensive answers.

learn/chat/getting_started_with_chat.mdx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Getting started with conversational search
33
description: This article walks you through implementing Meilisearch's chat completions feature to create conversational search experiences in your application.
44
---
55

6-
To successfully implement a conversational search interface you must follow three steps: configure indexes for chat usage, create chat workspaces targeting different use-cases, and building a chat interface.
6+
To successfully implement a conversational search interface you must follow three steps: configure indexes for chat usage, create a chat workspaces, and build a chat interface.
77

88
## Prerequisites
99

@@ -21,7 +21,7 @@ First, enable the chat completions experimental feature:
2121

2222
```bash
2323
curl \
24-
-X PATCH 'http://localhost:7700/experimental-features/' \
24+
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
2525
-H 'Authorization: Bearer MEILISEARCH_KEY' \
2626
-H 'Content-Type: application/json' \
2727
--data-binary '{
@@ -38,19 +38,19 @@ Conversational search is still in early development. Conversational agents may o
3838
When Meilisearch runs with a master key on an instance created after v1.15.1, it automatically generates a "Default Chat API Key" with `chatCompletions` and `search` permissions on all indexes. Check if you have the key using:
3939

4040
```bash
41-
curl http://localhost:7700/keys \
41+
curl MEILISEARCH_URL/keys \
4242
-H "Authorization: Bearer MEILISEARCH_KEY"
4343
```
4444

45-
Look for the key with the description "Default Chat API Key" Use this key when querying the `/chats` endpoint.
45+
Look for the key with the description "Default Chat API Key".
4646

4747
#### Troubleshooting: Missing default chat API key
4848

4949
If your instance does not have a Default Chat API Key, create one manually:
5050

5151
```bash
5252
curl \
53-
-X POST 'http://localhost:7700/keys' \
53+
-X POST 'MEILISEARCH_URL/keys' \
5454
-H 'Authorization: Bearer MEILISEARCH_KEY' \
5555
-H 'Content-Type: application/json' \
5656
--data-binary '{
@@ -68,7 +68,7 @@ After activating the `/chats` route and obtaining an API key with chat permissio
6868

6969
```bash
7070
curl \
71-
-X PATCH 'http://localhost:7700/indexes/INDEX_NAME/settings' \
71+
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings' \
7272
-H 'Authorization: Bearer MEILISEARCH_KEY' \
7373
-H 'Content-Type: application/json' \
7474
--data-binary '{
@@ -81,13 +81,14 @@ curl \
8181
```
8282

8383
- `description` gives the initial context of the conversation to the LLM. A good description improves relevance of the chat's answers
84-
- `documentTemplate` defines the document data Meilisearch sends to the AI provider. Consult the best [document template best practices](/learn/ai_powered_search/document_template_best_practices) article for more guidance
84+
- `documentTemplate` defines the document data Meilisearch sends to the AI provider. This template outputs all searchable fields in your documents, which may not be ideal if your documents have many fields. Consult the best [document template best practices](/learn/ai_powered_search/document_template_best_practices) article for more guidance
85+
- `documentTemplateMaxBytes` establishes a size limit for the document templates. Documents bigger than 400 bytes are truncated to ensure a good balance between speed and relevancy
8586

8687
## Configure a chat completions workspace
8788

8889
The next step is to create a workspace. Chat completion workspaces are isolated configurations targeting different use cases. Each workspace can:
8990

90-
- Use different embedding providers (openAi, azureOpenAi, mistral, gemini, vLlm)
91+
- Use different embedding providers (OpenAI, Azure OpenAI, Mistral, Gemini, vLLM)
9192
- Establish separate conversation contexts via baseline prompts
9293
- Access a specific set of indexes
9394

@@ -99,7 +100,7 @@ Create a workspace setting your LLM provider as its `source`:
99100

100101
```bash OpenAI
101102
curl \
102-
-X PATCH 'http://localhost:7700/chats/WORKSPACE_NAME/settings' \
103+
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
103104
-H 'Authorization: Bearer MEILISEARCH_KEY' \
104105
-H 'Content-Type: application/json' \
105106
--data-binary '{
@@ -114,7 +115,7 @@ curl \
114115

115116
```bash Azure OpenAI
116117
curl \
117-
-X PATCH 'http://localhost:7700/chats/WORKSPACE_NAME/settings' \
118+
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
118119
-H 'Authorization: Bearer MEILISEARCH_KEY' \
119120
-H 'Content-Type: application/json' \
120121
--data-binary '{
@@ -129,7 +130,7 @@ curl \
129130

130131
```bash Mistral
131132
curl \
132-
-X PATCH 'http://localhost:7700/chats/WORKSPACE_NAME/settings' \
133+
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
133134
-H 'Authorization: Bearer MEILISEARCH_KEY' \
134135
-H 'Content-Type: application/json' \
135136
--data-binary '{
@@ -143,7 +144,7 @@ curl \
143144

144145
```bash Gemini
145146
curl \
146-
-X PATCH 'http://localhost:7700/chats/WORKSPACE_NAME/settings' \
147+
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
147148
-H 'Authorization: Bearer MEILISEARCH_KEY' \
148149
-H 'Content-Type: application/json' \
149150
--data-binary '{
@@ -157,7 +158,7 @@ curl \
157158

158159
```bash vLLM
159160
curl \
160-
-X PATCH 'http://localhost:7700/chats/WORKSPACE_NAME/settings' \
161+
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
161162
-H 'Authorization: Bearer MEILISEARCH_KEY' \
162163
-H 'Content-Type: application/json' \
163164
--data-binary '{
@@ -173,17 +174,17 @@ curl \
173174

174175
Which fields are mandatory will depend on your chosen provider `source`. In most cases, you will have to provide an `apiKey` to access the provider.
175176

176-
`baseUrl` indicates the URL Meilisearch queries when users submit questions to your chat interface.
177+
`baseUrl` indicates the URL Meilisearch queries when users submit questions to your chat interface. This is only mandatory for Azure OpenAI and vLLM sources.
177178

178-
`prompts.system` gives the conversational search bot the baseline context of your users and their questions. The `prompts` object accepts a few other fields that provide more information to improve how the agent uses the information it finds via Meilisearch. In real-life scenarios filling these fields would improve the quality of conversational search results.
179+
`prompts.system` gives the conversational search bot the baseline context of your users and their questions. [The `prompts` object accepts a few other fields](/reference/api/chats#prompts) that provide more information to improve how the agent uses the information it finds via Meilisearch. In real-life scenarios filling these fields would improve the quality of conversational search results.
179180

180181
## Send your first chat completions request
181182

182183
You have finished configuring your conversational search agent. To test everything is working as expected, send a streaming `curl` query to the chat completions API route:
183184

184185
```bash
185186
curl -N \
186-
-X POST 'http://localhost:7700/chats/WORKSPACE_NAME/chat/completions' \
187+
-X POST 'MEILISEARCH_URL/chats/WORKSPACE_NAME/chat/completions' \
187188
-H 'Authorization: Bearer MEILISEARCH_API_KEY' \
188189
-H 'Content-Type: application/json' \
189190
--data-binary '{
@@ -243,7 +244,7 @@ Integrating Meiliearch and the OpenAI SDK with JavaScript would look lik this:
243244
import OpenAI from 'openai';
244245

245246
const client = new OpenAI({
246-
baseURL: 'http://localhost:7700/chats/WORKSPACE_NAME',
247+
baseURL: 'MEILISEARCH_URL/chats/WORKSPACE_NAME',
247248
apiKey: 'PROVIDER_API_KEY',
248249
});
249250

@@ -287,7 +288,7 @@ Take particular note of the last lines, which output the streamed responses to t
287288
288289
- Use either the master key or the "Default Chat API Key"
289290
- Don't use search or admin API keys for chat endpoints
290-
- Find your chat key: `curl http://localhost:7700/keys -H "Authorization: Bearer MEILISEARCH_KEY"`
291+
- Find your chat key: `curl MEILISEARCH_URL/keys -H "Authorization: Bearer MEILISEARCH_KEY"`
291292
292293
#### "Socket connection closed unexpectedly"
293294
@@ -298,14 +299,14 @@ Take particular note of the last lines, which output the streamed responses to t
298299
1. Check workspace configuration:
299300
300301
```bash
301-
curl http://localhost:7700/chats/WORKSPACE_NAME/settings \
302+
curl MEILISEARCH_URL/chats/WORKSPACE_NAME/settings \
302303
-H "Authorization: Bearer MEILISEARCH_KEY"
303304
```
304305
305306
2. Update with valid API key:
306307
307308
```bash
308-
curl -X PATCH http://localhost:7700/chats/WORKSPACE_NAME/settings \
309+
curl -X PATCH MEILISEARCH_URL/chats/WORKSPACE_NAME/settings \
309310
-H "Authorization: Bearer MEILISEARCH_KEY" \
310311
-H "Content-Type: application/json" \
311312
-d '{"apiKey": "your-valid-api-key"}'

0 commit comments

Comments
 (0)