Skip to content

Support agentStudio flag in theme-search-algolia askAi config #11950

Open

Description

@brtkwr

Have you read the Contributing Guidelines on issues?

Yes.

Prerequisites

  • Using Docusaurus 3.10.0
  • DocSearch v4 (@docsearch/react@4.6.2) is installed
  • Algolia DocSearch has shipped experimental Agent Studio support via an agentStudio: true flag on the askAi config

Description

@docsearch/react@4.6.x exposes an experimental agentStudio flag on the askAi prop, which routes Ask AI through Algolia's Agent Studio backend (as advertised in the current Algolia docs / integration guides shared with customers). The underlying modal accepts it and it works end-to-end.

However, the theme's Joi schema in packages/docusaurus-theme-search-algolia/src/validateThemeConfig.ts does not currently accept agentStudio on themeConfig.algolia.askAi, so the config is rejected before reaching the modal:

"algolia.askAi.agentStudio" is not allowed

Reproducible demo

// docusaurus.config.js
themeConfig: {
  algolia: {
    appId: '…',
    apiKey: '…',
    indexName: '…',
    askAi: {
      assistantId: '…',
      agentStudio: true, // ← rejected by Joi schema
    },
  },
},

Expected behavior

Schema accepts agentStudio: boolean on askAi and passes it through to the DocSearch v4 modal.

Additional notes

  • Per the DocSearch v4 types, when agentStudio: true the searchParameters object is keyed by index name ({ "INDEX_NAME": { distinct: false } }) rather than the flat shape — so the schema should either accept both shapes or at least not reject the flag.
  • Currently there's an additional gotcha: when contextualSearch: true, the theme auto-injects facetFilters into askAi.searchParameters, which agentStudio rejects (invalid searchParameters for index 'facetFilters'). Users have to disable contextualSearch as a workaround.

Happy to open a PR if this would be accepted — the minimal change is extending the Joi schema; the fuller change is handling the index-keyed searchParameters shape when agentStudio: true.

Activity

  1. slorber commented on Jun 19, 2026

    @slorber
    Collaborator

    Hey

    We are in the process of changing the way we integrate Algolia DocSearch changes.

    To reduce DocSearch dev and Docusaurus integration friction, the DocSearch team has created a fork of our plugin here: https://github.com/algolia/docsearch/tree/main/adapters/docusaurus-theme-search-algolia

    In the future, we'll likely rebase our official plugin based on their fork

    It already has agentStudio support, apparently, so rebasing on their fork will likely bring support automatically.

    I'll keep this issue open until we add support.
    In the meantime, one option you have is to try using their forked plugin instead of the official one: it may have breaking changes but is ahead in terms of DocSearch feature support.

    cc @dylantientcheu @NatanTechofNY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions