> ## Documentation Index
> Fetch the complete documentation index at: https://www.algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate prompt suggestions for your pages

> Create prompt configurations in Agent Studio to generate AI prompt suggestions for product, search results, or custom pages.

Prompt suggestions are AI-generated prompts, displayed as clickable chips on your pages.
An Agent Studio agent generates them from the page context, such as a product record or the current search results.
When users click a suggestion, it starts a conversation with the agent.

Prompt configurations control how the suggestions are generated.
Each configuration defines the context, the goal, the model, and the length of the suggestions for one integration.

These suggestions differ from [follow-up prompt suggestions](/doc/guides/algolia-ai/agent-studio/how-to/agent-configuration#follow-up-prompt-suggestions), which appear inside the chat after each agent response.

## Before you begin

* You need an Algolia application with the Agent Studio feature enabled.
* To preview PDP or PLP configurations, you need an agent with an [Algolia Search tool](/doc/guides/algolia-ai/agent-studio/how-to/tools/algolia-search) connected to an index.

## Create a prompt configuration

<Steps>
  <Step title="Open the prompt configurations list">
    In the [Agent Studio dashboard](https://dashboard.algolia.com/generativeAi/agent-studio/agents), open your agent, go to the **Components** section, and select the **Prompt suggestions** component.

    <img src="https://mintcdn.com/algolia/tSOmDBWfilXFH7JI/images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configurations-list.png?fit=max&auto=format&n=tSOmDBWfilXFH7JI&q=85&s=ff0eac524849304edefc126a32475fb2" alt="Screenshot of the Prompt configurations list in the Components section of the Agent Studio dashboard." width="2000" height="1560" data-path="images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configurations-list.png" />
  </Step>

  <Step title="Create a configuration">
    Select **Create** and fill in:

    * **Name**. An internal label. It's not used in the integration.
    * **Context mode**. The page context the agent uses to generate suggestions.
    * **Goal**. What the generated suggestions should help users do.

    | Context mode         | Suggestions are generated from                                      |
    | -------------------- | ------------------------------------------------------------------- |
    | PDP (Single record)  | A single record in focus on the page, such as a product detail page |
    | PLP (Search results) | The current query, filters, and visible search results              |
    | Custom               | A context payload your integration defines, such as a guide page    |
  </Step>

  <Step title="Choose a goal">
    Pick one of the built-in goals, such as comparing options or narrowing results, or select **Custom** and write your own instructions.

    Choosing a goal replaces the **Instructions** text.
    Editing the instructions switches the goal to **Custom**.
  </Step>
</Steps>

## Configure the generated suggestions

In the configuration editor, adjust how the agent generates suggestions:

* **Number of suggestions**. The number of suggestion chips to generate.
* **Maximum words per suggestion**. Keeps chips short enough to scan.
* **Provider override** and **Model override**. Leave as **Agent default** to use the agent's provider and model.
* **Base system prompt**. The prompt sent to the model. It's updated from the number of suggestions and maximum words. Select **Customize** to edit it.

<img src="https://mintcdn.com/algolia/tSOmDBWfilXFH7JI/images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configuration-editor.png?fit=max&auto=format&n=tSOmDBWfilXFH7JI&q=85&s=a72ee36c0908612939759bb44048db0b" alt="Screenshot of the prompt configuration editor in the Agent Studio dashboard, showing the Prompt and Generation sections." width="2000" height="1560" data-path="images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configuration-editor.png" />

## Preview suggestions

Use the live preview to test a configuration before you enable it.
The test inputs depend on the context mode:

* **PDP**. Select an index and search for a record.
* **PLP**. Select an index and enter a preview query.
* **Custom**. Enter a JSON context payload of 64 KiB or less.

Select **Generate preview** to see the output as suggestion chips, or switch to the **Raw output** view to inspect the generated strings.
Click a suggestion to preview the chat hand-off.

<img src="https://mintcdn.com/algolia/tSOmDBWfilXFH7JI/images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configuration-preview.png?fit=max&auto=format&n=tSOmDBWfilXFH7JI&q=85&s=3e08c039a2ae8b91b51709c107a5900e" alt="Screenshot of the live preview in the prompt configuration editor, showing test inputs and generated suggestion chips." width="2000" height="1800" data-path="images/generative-ai/agent-studio/dashboard/agent-studio-prompt-configuration-preview.png" />

## Enable and integrate a configuration

<Steps>
  <Step title="Enable the configuration">
    Turn on the **Enabled** toggle and save.
    The integration endpoint only responds once the configuration is enabled and saved.
  </Step>

  <Step title="Copy the configuration ID">
    Copy the **Configuration ID** from the editor.
    Configuration IDs are stable: you can change the configuration's behavior without updating your integration.
  </Step>

  <Step title="Add the widget to your frontend">
    Select **Integrate**, choose an integration option, and copy the generated code.
    In InstantSearch, pass the configuration ID to the `promptSuggestions` widget:

    <CodeGroup>
      ```jsx React theme={"system"}
      <PromptSuggestions
        agentId="AGENT_ID"
        configurationId="CONFIGURATION_ID"
      />
      ```

      ```js JavaScript theme={"system"}
      promptSuggestions({
        container: '#prompt-suggestions',
        agentId: 'AGENT_ID',
        configurationId: 'CONFIGURATION_ID',
      });
      ```
    </CodeGroup>

    For all widget options, see the `PromptSuggestions` widget reference for [React](/doc/api-reference/widgets/prompt-suggestions/react) or [JavaScript](/doc/api-reference/widgets/prompt-suggestions/js).
  </Step>
</Steps>

## Manage configurations

From the configurations list, you can:

* Search configurations by name and filter them by context mode.
* Duplicate a configuration to use it as a starting point.
* Delete a configuration. Disable it first: you can't delete an enabled configuration.

You can create a limited number of configurations per agent.
The **Create** button shows the limit when you reach it.
