Enable the chat completions feature
If you are using Meilisearch Cloud, enable chat completions from your project’s settings page under “Experimental features”. For self-hosted instances, enable the feature through the experimental features endpoint:Find your chat API key
Meilisearch automatically generates a “Default Chat API Key” withchatCompletions and search permissions on all indexes. Check if you have the key using:
Troubleshooting: Missing default chat API key
If your instance does not have a Default Chat API Key, create one manually:Configure your indexes
Configure thechat settings for each index you want to make available to the conversational search agent:
descriptiontells the LLM what the index contains. A good description helps the agent decide which index to search and improves answer relevancedocumentTemplatedefines 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 document template best practices article for more guidancedocumentTemplateMaxBytesestablishes a size limit for the document templates. Documents bigger than 400 bytes are truncated to ensure a good balance between speed and relevancy
searchParameters to control how the LLM searches the index (hybrid search, result limits, sorting, etc.). See configure index chat settings for all available options.
Create a workspace
Chat completion workspaces are isolated configurations targeting different use cases. Each workspace can:- Use different LLM providers (OpenAI, Azure OpenAI, Mistral, vLLM)
- Establish separate conversation contexts via system prompts
- Access a specific set of indexes
source:
apiKey. baseUrl is only mandatory for Azure OpenAI and vLLM.
The prompts.system field gives the agent its baseline instructions. The prompts object accepts additional fields that help the agent formulate better searches.
Next steps
Your conversational search setup is complete. Choose how you want to use it:Build a chat interface
Create a multi-turn conversational interface where users ask follow-up questions.
Generate summarized answers
Display concise AI-generated answers alongside traditional search results.