Skip to main content
Ask AI is part of Agent Studio and isn’t available as a standalone feature for new applications. Use these docs for existing Ask AI implementations. To move an existing assistant, see Migrate Ask AI to Agent Studio.
To provide the most accurate answers, Ask AI relies on cleanly structured content. To achieve this, it’s best to create a separate text-only for Ask AI. This is especially important for documentation sites where layout elements, such as navigation components, might dilute your content. To split plain text into chunks, you can use the helpers.splitTextIntoRecords helper in your crawler configuration. This works with many plain-text formats, but Markdown is especially well-suited for this purpose.

Update your crawler configuration

Add the following code to the actions array in your crawler configuration:
JavaScript
Update the index settings:
JavaScript

Run the crawler

After updating the crawler configuration:
  1. Publish the configuration in the Crawler dashboard to save and activate it.
  2. Run the crawler to index your Markdown content.

Integrate the Markdown index with Ask AI

Once your Crawler and index are configured, set up your frontend to use both your main keyword index and your markdown index for AskAI. Here’s how you might configure DocSearch to use your main keyword index for search and your markdown index for AskAI:
JavaScript
  • indexName refers to your main DocSearch index
  • askAi.indexName refers to the dedicated Markdown index

Best practices

  • Use clear consistent titles and headings to make content more discoverable
  • Structure your content with headings and lists for better chunking
  • Add facets to support filtering in your search UI or the Ask AI assistant. For example, you can add attributes like lang, version, tags to your and declare them as attributesForFaceting.
  • Adjust record size by changing maxRecordBytes.
    • If your answers seem too broad or fragmented, increase maxRecordBytes to create fewer, larger records. This might increase the token count for LLMs, which can affect the size of the context window and the cost of each Ask AI response.
  • If you have large Markdown files, decrease maxRecordBytes to create smaller, more focused records.

Example configuration

JavaScript

See also

Last modified on August 28, 2026