DocSearchAskAi Configuration
TheDocSearchAskAi type defines configuration options for enabling AI-powered conversational search in DocSearch. This feature allows users to ask questions and receive AI-generated answers based on your documentation.
Required Properties
The assistant ID to use for the Ask AI feature. This identifies your configured AI assistant.
Optional Algolia Configuration
By default, Ask AI uses the same Algolia credentials (appId, apiKey, indexName) as the main search. You can override these for Ask AI if needed.
The index name to use for the Ask AI feature. Your assistant will search this index for relevant documents.If not provided, the main
indexName from DocSearchProps will be used.The API key to use for the Ask AI feature. Your assistant will use this API key to search the index.If not provided, the main
apiKey from DocSearchProps will be used.The app ID to use for the Ask AI feature. Your assistant will use this app ID to search the index.If not provided, the main
appId from DocSearchProps will be used.Features
Enables displaying suggested questions on Ask AI’s new conversation screen.Default:
falseWhen enabled, users will see suggested questions they can click to start a conversation.Search Parameters
ThesearchParameters configuration varies based on whether you’re using the standard Ask AI backend or the experimental Agent Studio backend.
Standard Configuration (Default)
The search parameters to use for the Ask AI feature when
agentStudio is not enabled or is false.Agent Studio Configuration (Experimental)
Experimental: Whether to use Agent Studio as the chat backend.This is an experimental feature and its API may change without notice in future releases. Use with caution in production environments.Default:
falseWhen set to true, the searchParameters structure changes to be keyed by index name.When
agentStudio: true, search parameters must be keyed by index name.Internal/Testing Properties
Internal testing property. Do not use in production.Note: This is a temporary hack for testing staging environments and will be removed before release.
Type Variants
TheDocSearchAskAi type uses TypeScript discriminated unions to ensure type safety based on the agentStudio setting:
Simple String Configuration
In addition to the fullDocSearchAskAi configuration object, you can pass a simple string assistant ID:
