Skip to main content
Your agent can search across up to 10 indices in parallel or sequentially to answer questions with real-time data from your product catalog, content library, or any indexed data.
  • Natural language queries (when Algolia NeuralSearch is enabled): users ask questions in plain language, agent performs the search
  • Keyword search: agent performs traditional keyword-based searches
  • Faceted filtering: agent applies filters with AND/OR logic based on user requests
  • Multiple indices: agent can query up to 10 indices per request, chosen either in the configuration or per request. For more information, see Control which indices the agent can search
  • Automatic enrichment: index metadata (facets, searchable attributes) is automatically discovered
  • Analytics tracking: all agent-performed queries tagged with the alg#agent-studio analytics tag
  • Search API parameters: supports a curated subset of query-time Algolia Search parameters. For more information, see Search parameters
  • Suggested refinements: agent can suggest follow-up search refinements based on facet values, using a deterministic (facet-count heuristic) or agentic (LLM-driven) strategy
  • Configurable AI behavior: control what the AI can change at query time, such as bounds on results per page, which attributes to retrieve, or a fixed set of facets
  • User-restricted access: works with secure API keys for record-level access control
  • Simplest integration: no external APIs required, uses existing Algolia Search configuration
Use a Search API key (never an Admin API key). For more information, see Algolia Search tool security.

Configure the Search tool

From the Agent Studio agent edit view in the Algolia dashboard:
  1. Click Add tool > Algolia Search
  2. Select your (for example, products)
  3. Add a description: “Product catalog with titles, descriptions, prices, and availability”
  4. Click Add tool
Use the Other tools option when you need to configure tools with settings not supported by the Algolia dashboard, or when a dedicated interface isn’t available.

Advanced usage

Search parameters

Set Algolia Search API parameters per index with searchParameters. The tool accepts only a subset of the query-time parameters. The tool doesn’t expose attributesToHighlight, highlightPreTag, or highlightPostTag. responseFields should be set in searchControls.
JSON
To apply the same parameter across indices, repeat it in each indices[] entry. Agent Studio forwards searchParameters to the search tool so values outrank the agent’s own choices and the searchControls defaults below. For anything the agent should be able to vary, use searchControls instead.

Control what the AI can change per index

searchControls sets, for each index, which search parameters the agent can change at query time, what value applies when it doesn’t, and the bounds it must stay within. It accepts query, hitsPerPage, page, attributesToRetrieve, responseFields, distinct, facets, and custom. Every field defaults to exposed: false, so the agent can’t change any of them until you allow it.
Click AI Search Settings on an index entry in the Agent Studio agent edit view.

Query-time search parameter overrides

You can override specific search parameters per request by passing algolia.searchParameters in the completions API request body. Use this when some values vary by user or session, without changing the tool configuration. The tool honors only the indices it is already configured to search. For how it resolves that set, see Control which indices the agent can search. This is useful when you want to:
  • Apply user-specific filters
  • Return fewer attributes
  • Restrict which attributes are searchable for a specific request
  • Change distinct dynamically
  • Pass personalization settings such as userToken
Pass overrides as an object with the index name as key:
JSON
These eight fields are the only ones the API accepts. A request carrying any other field gets a validation error. For the request schema for POST /agent-studio/1/agents/{agentId}/completions, see the Agent Studio API reference. Whether an override reaches Algolia depends on what else sets the same parameter. For the full resolution order, see Search parameter precedence.

Search parameter precedence

Several sources can set the same search parameter. From lowest to highest priority:
  1. The search tool’s own defaults
  2. The default value in searchControls
  3. The value the agent chooses for this call, for any field you set to exposed: true
  4. Per-index searchParameters, which Agent Studio forwards into custom
  5. Query-time algolia.searchParameters for this index, also forwarded into custom
  6. searchControls.custom
  7. The index name, which the tool reapplies last
The custom field values override the agent’s choices, and they skip the bounds in constraint. The tool’s mode decides whether a completions request can change the index list.

Static mode (default)

The configured indices is the only set the tool can search. A request that sends algolia.indices anyway gets a 422 with the code static_tool_rejects_per_request_indices. Setting allowUnlistedIndices: true under static mode is a validation error.

Dynamic mode

Use dynamic mode when your application, rather than the agent configuration, decides which indices a request should search:
  • Multi-region catalogs: a shopper browsing the US site asks about availability in Germany, so that turn searches products_eu instead of products_us
  • Multi-tenant data: each customer owns a separate index, and the request names the index for the signed-in tenant
  • More indices than one tool holds: a configuration takes at most 10 indices, so route across a larger set one request at a time
A request can send algolia.indices, a list of up to 10 index names, which replaces indices for that request only. Omit algolia.indices and the configured indices apply as usual. Send the list under algolia at the top level of the completions request body:
JSON
Each entry is a bare index name. Descriptions and per-index search parameters stay in the tool configuration, and Agent Studio looks them up for every listed name the request sends. The field takes at most 10 entries and rejects duplicates. It also rejects an empty array, so omit algolia.indices instead of sending []. With allowUnlistedIndices left at false, the request’s list must be a subset of the configured indices. A name you haven’t configured gets a 422 with the code index_not_listed_on_tool.
JSON
With allowUnlistedIndices: true, the configured indices can also be empty, so every index arrives per request. Such a tool doesn’t have any fallback: a request that omits algolia.indices leaves the agent with nothing to search. On the search tool’s index configuration, two toggles control this:
Setting both mode: "dynamic" and allowUnlistedIndices: true accepts any index name a request asks for, including indices you never configured. The Algolia API key’s own ACL becomes the only limit on what the agent can read.Unconfigured names get a minimal description and none of your per-index parameters, so a filters you rely on doesn’t apply to them.Scope the key with restrictIndices before turning this on. Agent Studio matches the resolved index list against the key’s restrictions before it runs any search and rejects the request when a name falls outside them. A key with no index restrictions passes every name, so the agent reads whatever that key can reach. For more information, see Algolia Search tool security.

Example filters for configuration

JSON

Analytics tracking

All queries made by the Algolia Search tool are automatically tagged with:
You can:
  • Track agent-generated queries separately in your Algolia analytics
  • Identify popular search patterns from conversational interactions
  • Optimize your index based on agent usage
Find the agent analytics data in the Algolia dashboard:
  1. Go to Algolia Analytics
  2. Filter by tag: alg#agent-studio
  3. Review top queries, click-through rates, and conversion metrics
For more information about user-restricted access with secured API keys, see Security and credentials.

See also

Last modified on August 28, 2026