Before you begin
- You need an Algolia app with Agent Studio enabled.
- You need a connected LLM provider.
- Publish your agent.
Set up searchable prompt suggestions
1
Go to the search box component
In the Agent Studio dashboard, open your agent, go to the Components section, and select Search Box.
In the Searchable prompt suggestions row, click Set up.
2
Choose the source index, LLM provider, and model
Fill in:
- Source index.
- Provider. The provider profile that generates the suggestions.
- Model.
3
Optional: choose how suggestions refresh
To rebuild suggestions on a schedule, in Refresh, select Daily, Weekly, or Monthly.
For more information, see Refresh suggestions on a schedule.
4
Optional: split suggestions by category
To generate a separate set of suggestions for each value of an attribute, in Split by category, select an attribute.
For more information, see Split suggestions by category.
5
Generate the suggestions
Click Generate suggestions.
Generation can take a few minutes.
When it finishes, the dashboard shows a link to the suggestions index.
6
Show the suggestions on your site
Suggestions appear on your site only after you add the
showPromptSuggestions option to your autocomplete widget.
The searchBox widget doesn’t support this option, so if you use searchBox, switch to autocomplete.
Selecting a suggestion opens a conversation only if the same index also has a chat widget.
To copy the code, in the Searchable prompt suggestions row, click View implementation code.
For more information, see the JavaScript and React widget references.Refresh suggestions on a schedule
With On demand, suggestions don’t refresh automatically. To regenerate them, click Edit, then click Run now. If you change a setting, click Save and regenerate instead. With Daily, Weekly, or Monthly, Algolia regenerates suggestions on the selected schedule using your source index and its search analytics. Scheduled runs use UTC, and the setup shows the next run time in UTC. You can’t choose the time of day. To stop scheduled runs, click Edit, then click Cancel schedule. If a run fails, the dashboard shows Generation failed with a Retry button. A failed run doesn’t replace your existing suggestions.Split suggestions by category
By default, Algolia generates suggestions for the whole index. When you select an attribute in Split by category, Algolia also generates suggestions for up to Max values of that attribute, such as the most common brands. The suggestions for the whole index remain available. Keep these points in mind:- The attribute must appear in
attributesForFaceting. - Attributes declared as
filterOnlyaren’t available. - Max values sets how many attribute values get their own suggestions. Algolia picks the values that appear in the most records. It defaults to 20 and accepts values from 1 to 50.
- More values mean longer runs and higher token use. The dashboard warns you when Max values is above 10.
Check the token estimate
The setup shows an Estimated cost for each run. The estimate is a range in tokens, not a price, and it includes the values from Split by category. For daily and weekly schedules, it also shows the expected monthly total. You can view the token estimate before publishing your agent. To generate suggestions, publish the agent first.Add a schedule to an existing setup
If the Searchable prompt suggestions row shows Add a schedule, your setup doesn’t include refresh and split options. To add a schedule:- Click Add a schedule.
- Select Daily, Weekly, or Monthly.
- Click Save and regenerate.