This is an experimental feature. Use the Meilisearch Cloud UI or the experimental features endpoint to activate it:
Meilisearch chat tools
For the best user experience, configure all following tools.- Handle progress updates by displaying search status to users during streaming
- Append conversation messages as requested to maintain context for future requests
- Display source documents to users for transparency and verification
- Use
call_idto associate progress updates with their corresponding source results
These special tools are handled internally by Meilisearch and are not forwarded to the LLM provider. They serve as a communication mechanism between Meilisearch and your application to provide enhanced user experience features.
_meiliSearchProgress
This tool reports real-time progress of internal search operations. When declared, Meilisearch will call this function whenever search operations are performed in the background.
Purpose: Provides transparency about search operations and reduces perceived latency by showing users what’s happening behind the scenes.
Arguments:
call_id: Unique identifier to track the search operationfunction_name: Name of the internal function being executed (e.g., “_meiliSearchInIndex”)function_parameters: JSON-encoded string containing search parameters likeq(query) andindex_uid
_meiliAppendConversationMessage
Since the /chats/{workspace}/chat/completions endpoint is stateless, this tool helps maintain conversation context by requesting the client to append internal messages to the conversation history.
Purpose: Maintains conversation context for better response quality in subsequent requests by preserving tool calls and results.
Arguments:
role: Message author role (“user” or “assistant”)content: Message content (for tool results)tool_calls: Array of tool calls made by the assistanttool_call_id: ID of the tool call this message responds to
_meiliSearchSources
This tool provides the source documents that were used by the LLM to generate responses, enabling transparency and allowing users to verify information sources.
Purpose: Shows users which documents were used to generate responses, improving trust and enabling source verification.
Arguments:
call_id: Matches thecall_idfrom_meiliSearchProgressto associate queries with resultsdocuments: JSON object containing the source documents with only displayed attributes
Sample OpenAI tool declaration
Include these tools in your request’stools array to enable enhanced functionality: