--- title: Set up and deploy the Coveo Passage Retrieval API action slug: p5fa9004 canonical_url: https://docs.coveo.com/en/p5fa9004/ collection: coveo-for-agentforce source_format: adoc --- # Set up and deploy the Coveo Passage Retrieval API action The **Coveo Passage Retrieval API** Agentforce action is optimized for question answering (Q&A) use cases. It's used to return contextual pieces of information (passages) from [items](https://docs.coveo.com/en/210/) [indexed](https://docs.coveo.com/en/204/) in your [Coveo organization](https://docs.coveo.com/en/185/). By leveraging the [Coveo Passage Retrieval (PR) API](https://docs.coveo.com/en/o86c8334/), this Coveo-powered Agentforce action enhances the accuracy and relevance of the responses generated by your Agentforce AI agents. ![Sample flex prompt template action | Coveo for Agentforce](https://docs.coveo.com/en/assets/images/coveo-for-agentforce/sample-prapi-flex-prompt-template-action.png) This article describes how to configure and use the **Coveo Passage Retrieval API** Agentforce action in your Salesforce organization. To do so, you must: . [Configure the action](#configure-the-action). . [Deploy the action](#deploy-the-action). Once you've completed these steps, you can [test the action](#test-the-action) to confirm it's working as expected. ## Prerequisites > **Important** > > The Agentforce interface evolves quickly, and updates are added regularly. > Although we strive to keep this documentation current, you may encounter discrepancies between this content and the current state of the Agentforce interface. Before you start, make sure you've completed the following tasks: * [Installed Coveo for Agentforce](https://docs.coveo.com/en/p5fa5221/) in your Salesforce organization. * [Enabled Prompt Builder](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_enable.htm&type=5) in your Salesforce organization. > **Tip** > > Assign the **Prompt Template Manager** permission set to users who create and manage prompt templates in the Prompt Builder, regardless of whether they're System Administrator users. * Fulfilled the [prerequisites](https://docs.coveo.com/en/o86c8334#prerequisites) to use the Coveo Passage Retrieval (PR) API. * [Created an API key](https://docs.coveo.com/en/1718#create-an-api-key) using the **Anonymous search** template in the [Coveo Administration Console](https://docs.coveo.com/en/183/) to call the Coveo PR API. > **Note** > > Setting the [search hub](https://docs.coveo.com/en/1342/) in the API key isn't recommended. > To avoid any issues, we recommend setting it while [creating the custom metadata configuration](#create-a-custom-metadata-configuration) instead. ## Configure the action Configuring the **Coveo Passage Retrieval API Apex action** Agentforce action is a two-step process. It involves [setting up the external credential and API key](#set-up-the-external-credential-and-api-key) and [creating a custom metadata configuration](#create-a-custom-metadata-configuration). ### Set up the external credential and API key . From the Salesforce Setup menu, in the Quick Find box, enter `Named Credentials`, and then select **Named Credentials**. . Select the **External Credentials** tab, and then click **Coveo Passage Retrieval API Apex action**. . On the page that opens, go to the **Principals** section. . Find the entry for the **PRAPI** principal, click [down] to access the Actions menu, and then select **Edit**. > **Important** > > The **PRAPI** principal must not be deleted. > It's required for the authorization flow to work properly. ![Principal edit menu | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-principal.png]) . [[APIKeyRequirement]]On the **Edit Principal** page, under **Authentication Parameter**, click **Add** to create your authentication parameter. > **Important** > > This step assumes that you've already [created an API key](https://docs.coveo.com/en/1718#create-an-api-key) using the **Anonymous search** template in the [Coveo Administration Console](https://docs.coveo.com/en/183/) (see [Prerequisites](#prerequisites)). > If you haven't, you must complete this task before proceeding. > > We don't recommend setting the [search hub](https://docs.coveo.com/en/1342/) in the API key. Instead, set it when you [create the custom metadata configuration](#create-a-custom-metadata-configuration). .. In the **Name** field, enter `apikey`. .. [[PRAPIKey]]In the **Value** field, enter the API key that will be used to call the Coveo PR API. .. Click **Save**. . To reopen the **Edit Principal** page, find the entry for the **PRAPI** principal, click [down] to access the Actions menu, and then select **Edit**. . On the **Edit Principal** page, under **Principal Access**, right-click **CoveoPRAPI_Named_Principal_Access**, and then select **Open Link in New Tab** to open the permission set in a new tab. ![Edit principal panel | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-edit-principal.png]) > **Tip** > > This permission set is included in the Coveo for Agentforce package to simplify granting access to users who will use the **Coveo Passage Retrieval API Apex action** Agentforce action through an Agentforce AI agent. > > Granting access to this external credential is therefore required for all users who will be using this Agentforce action. > Otherwise, the Agentforce AI agent won't be able to use the API key to call the Coveo PR API. > For additional ways to set external credentials, see [Enable User External Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_user_external_credentials.htm&type=5). . Under **Permission Set** for the **Coveo Passage Retrieval Authorization Named Principal Access**, click **Manage Assignments** to grant users permission to use the PR API key specified in [step 5b](#PRAPIKey). ![Manage Assignments button | Coveo for Agentforce](pass:m[coveo-for-agentforce/manage-assignments.png]) . The setup of the external credential and API key is now complete. You must now [create a custom metadata configuration](#create-a-custom-metadata-configuration). ### Create a custom metadata configuration . From the Setup menu, in the Quick Find box, enter `Custom Metadata Types`, and then select **Custom Metadata Types**. . On the page that opens, scroll to **Coveo Passage Retrieval API Apex action Configuration**, and then click **Manage Records**. . Click **New** to create a record. This record will serve as a configuration to call the PR API. ![Record configuration page | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-config.png]) .. In the **Label** field, enter a descriptive name for your configuration (for example, `General Questions`). Where `` is the name of your product or company. .. [[config-name]]By default, the **Coveo Passage Retrieval Configuration Name** field is automatically filled by Salesforce based on the information you entered in the **Label** field. Don't modify this value. > **Tip** > > Take note of the configuration name. > Depending on your implementation, you'll need to specify it when defining the topic instructions for your [custom prompt template action](#prapi-custom-topic-instructions) or [Apex action](#prapi-default-topic-instructions), and when creating your [prompt template](#prapi-prompt-template). .. Leave the **Constant Query Filter** field empty unless you have a good reason to specify a [constant query expression (`cq`)](https://docs.coveo.com/en/179/). .. [[search-hub]]In the **SearchHub** field, enter the [search hub](https://docs.coveo.com/en/1342/) that you want to use to call the PR API, for example, `PassageRetrievalAPI`. > **Important** > > If you already set a search hub value when you created the API key to call the Coveo PR API, make sure to specify the same value here to avoid any issues. > See [Set up the external credential and API key](#set-up-the-external-credential-and-api-key) for details. .. Leave the **Locale** field empty. .. In the **Number of passages** field, keep the default value of `5`. See [Request payload](https://docs.coveo.com/en/o86c8334#request-payload) for details about the number of passages returned by the Coveo PR API. .. Click **Save** to save your configuration. ## Deploy the action To deploy the **Coveo Passage Retrieval API** action, you have the following options: * (Recommended) [Create a custom prompt template action](#create-a-custom-prompt-template-action-recommended): Choose this option for greater flexibility and control over the action's behavior. * (Out-of-the-box) [Use the Apex action](#use-the-apex-action): Choose this option to set up the action quickly without extensive customization. * (Advanced use case) Create a custom Apex class to send custom context: Choose this option to either send [additional context](https://docs.coveo.com/en/p8pb4190/) or [case record context](https://docs.coveo.com/en/p93f0222/) to the Coveo Passage Retrieval API. > **Note** > > This option requires developer skills, including knowledge of Apex and the [Coveo Platform](https://docs.coveo.com/en/186/). ### Create a custom prompt template action (Recommended) To deploy the **Coveo Passage Retrieval API** action using a custom prompt template, you must: . [Create a prompt template](#create-a-prompt-template). . [Access your Agentforce AI agent](#access-your-agentforce-ai-agent). . [Create a topic](#create-a-topic). . [Assign the Agentforce action to your topic](#assign-the-agentforce-action-to-your-topic). #### Create a prompt template . From the Salesforce Setup menu, in the Quick Find box, enter **Prompt Builder**, and then select **Prompt Builder**. . In the upper-right corner of the builder, click **New Prompt Template**. . On the **New Prompt Template** page, specify the following information: ![Create a prompt template | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-new-prompt-template.png]) .. From the **Prompt Template Type** dropdown menu, select **Flex**. .. [[prapi-prompt-template-name]][[ccapi-prompt-template-name]]In the **Prompt Template Name** field, enter a descriptive name for your prompt template (for example, `Answer Questions With Coveo`). The **API Name** field is automatically filled by Salesforce based on the information you entered in the **Prompt Template Name** field. Don't modify this value. .. (Optional) In the **Template Description** field, provide a brief description of your prompt template (for example, `Coveo Passage Retrieval API flex prompt template`). .. Under **Inputs**, click **Add**, and then specify the following data sources: ... In the **Name** field, enter `userInput` as a descriptive name for the data source containing the user's input. The **API Name** field is automatically filled by Salesforce based on the information you entered in the **Name** field. Don't modify this value. ... From the **Source Type** dropdown menu, select **Free Text**, and then click **Add**. > **Tip** > > Keep the **Require when template runs** checkbox selected for all data sources. > This ensures that the prompt template action only runs when all required data sources are provided. ... In the next **Name** field, enter `prapiConfig` as a descriptive name for the data source containing the Coveo Passage Retrieval API configuration. The **API Name** field is automatically filled by Salesforce based on the information you entered in the **Name** field. Don't modify this value. ... From the **Source Type** dropdown menu, select **Free Text**, and then click **Add**. ... In the next **Name** field, enter `additionalContext` as a descriptive name for the data source containing additional context to help the AI agent answer questions. The **API Name** field is automatically filled by Salesforce based on the information you entered in the **Name** field. Don't modify this value. ... From the **Source Type** dropdown menu, select **Free Text**. .. Click **Next** to access the **Prompt Builder**. . [[prompt-template-workspace]]In the **Prompt** section, enter your prompt template instructions and specify related resources. > **Important** > > Writing prompt template instructions is an iterative process. > The information in this section isn't exhaustive and only provides an example. > Adjust the information to fit your specific use case. > See [Best Practices for Building Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_best_practices.htm&type=5) for guidelines and recommendations. > **Warning** > > You must include the `Apex:CoveoAgentforce__InvocablePassageRetrievalFlexTemplate` Apex class in your prompt template instructions. This class invokes the Coveo Passage Retrieval API to retrieve relevant passages from [items](https://docs.coveo.com/en/210/) [indexed](https://docs.coveo.com/en/204/) in your [Coveo organization](https://docs.coveo.com/en/185/). > > All source references such as `{!$Input:userInput}` and `{!$Apex:}` in the following example are links to [resources](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_get_to_know.htm&type=5). > You must specify them by selecting **Insert Resource** in the **Prompt** section. > Don't paste them in the instructions. **Example** ```text Context: You're a service agent and knowledge expert supporting agents in answering customer questions accurately and efficiently. Your role is to synthesize clear, factual answers based only on the retrieved document passages and cite all referenced materials. Agents rely on your answer to assist users, but they validate and finalize the response. A user just asked this question ### {!$Input:userInput} ### Use the following passages in order to answer the user question: {!$Apex:CoveoAgentforce__InvocablePassageRetrievalFlex.Prompt} <1> To structure your response Use only the provided passages to generate the answer. Do not invent or infer beyond what's present. Write in concise, declarative English, using the active voice. Include all used citations at the end as a numbered list. ``` <1> The `Apex:CoveoAgentforce__InvocablePassageRetrievalFlex` is a placeholder for the Coveo Passage Retrieval API response. It contains the passages and citations returned by the API. When a user asks a question, the Agentforce AI agent essentially receives input similar to the following: ```text Context: You must answer the following question... ### ### Use the following passages to answer the question: { "passages": ["lorem ipsum", "dolor sit amet", "consectetur adipiscing elit"], "citations": ["https://www.lipsum.com/", "https://www.google.com", "https://www.coveo.com"] } To structure your response Use only the provided passages to generate the answer... ``` . [[prapi-prompt-template]]At the upper-left corner of the Prompt Builder, click **Preview Settings** (![Prompt Builder Preview Settings icon | Coveo for Agentforce](coveo-for-agentforce/prompt-builder-preview-settings-icon-button.png)) to specify your prompt template settings. .. In the **Inputs** section, specify the following information: ... In the **userInput** field, enter a question to test your template, for example: ```text What is Barca Skipper? ``` ... In the **prapiConfig** field, enter the name of the PR API configuration. Make sure it matches the name of the custom metadata configuration you created in [step 3b](#config-name). ... In the **additionalContext** field, enter additional context to help the AI agent answer the question entered by the user, for example: ```text {"product": "Barca Skipper"} ``` The field value must be a valid JSON string of key-value pairs. .. In the **Output** section: ... Ensure the **Generate Response** option is enabled. ... From the **Response Language** dropdown menu, select **English**. ... Under **On Preview**, ensure the **Expand Resolved Prompt** and **Expand Generated Response** checkboxes are selected. . Click **Save & Preview** to save your prompt template settings and preview the results. For subsequent changes, click **Preview** to see the updated results. . Once you're satisfied with the results, click **Activate** to enable your prompt template. #### Access your Agentforce AI agent . From the Salesforce Setup menu, in the Quick Find box, enter `Agentforce Agents`, and then select **Agentforce Agents**. . On the page that opens, find your Agentforce AI agent, such as Einstein Copilot or Agentforce (Default), click [down] to access the Actions menu, and then select **Open in Builder**. > **Important** > > You can't use Coveo-powered Agentforce actions in a [Service Agent](https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&type=5) at this time. > Use a different agent type to leverage your Coveo-powered actions. . If your Agentforce AI agent is currently active, click **Deactivate** in the upper-right corner of the Agentforce Builder. > **Tip** > > You must always deactivate your Agentforce AI agent to make changes to it. #### Create a topic . In the Agentforce Builder, select **Topics** from the left tab. . Click the **New** actions menu, and then select **New Topic**. . (Optional) In the **Create a Topic** modal, specify the job you want this topic to perform. > **Tip** > > You can skip this step and specify the job you want this topic to perform in the second step of the modal. . Click **Next**. . In the second step of the modal, specify the following information: ![Create a topic page | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-create-a-topic.png]) > **Important** > > Creating a topic is an iterative process. > The information in this section isn't exhaustive and is only meant to provide you with an example. > You must adjust the information to fit your specific use case. > See [Best Practices for Topic Instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_instructions.htm&type=5) for guidance on writing effective instructions for your topic. .. In the **Name** field, enter a descriptive name for your topic (for example, `Barca Product Support`). By default, the **API Name** field is automatically filled by Salesforce based on the information you entered in the **Name** field. .. In the **Classification Description** field, provide a brief topic description (one to three sentences). Enter text similar to the following: **Example** ```text When a user asks a question about Barca, a company that sells boats and related products, these questions can be to provide an answer to a support type of question or be general questions about boats and related products. ``` The description should be clear and concise, providing enough context for the topic's purpose. Agentforce uses this information to determine which topic to use when answering questions. .. In the **Scope** field, enter a job description for your topic. Enter text similar to the following: **Example** ```text Your job is to answer the questions the user asks providing useful information about products or helping the user resolve an issue. You will create a medium to short answer to the questions asked. Ensure responses are well-structured and formatted correctly to provide clarity and usefulness to the user. ``` .. [[prapi-custom-topic-instructions]]In the **Instruction** field, instruct Agentforce to use your custom prompt template action to retrieve passages as follows: **Example** ```text Always use the "" action and answer with the output of the action only. ``` Where `` is the name of the custom prompt template action you created in [step 3b](#prapi-prompt-template-name). For more information, see [Create a custom prompt template action (Recommended)](#create-a-custom-prompt-template-action-recommended). ... Click **Add Instructions**, and then enter text similar to the following: ```text If the "" action does not provide you with passages, do not attempt to answer the question and simply say that you couldn't find any relevant document to answer the question. ``` ... Click **Add Instructions**, and then enter text similar to the following: ```text Always use the following as input for the "" action {"prapiConfig": ""} ``` Where `` is the name of the configuration you created in [step 3b](#config-name). For more information, see [Create a custom metadata configuration](#create-a-custom-metadata-configuration). .. In the **Example User Input** fields, add examples of questions that users might ask. > **Tip** > > This section is only available if you're using the [Agentforce (Default)](https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&type=5) agent. > If you're using a custom agent, you can skip this step. **Examples** ```text What is Barca Skipper? ``` ```text How to update maps? ``` . Click **Next**. . Skip the **Select the actions you want to include in your topic** step. . Click **Finish** to create your topic. > **Tip** > > If a **Topic Overlap Detected** warning appears, review your topics to ensure they're distinct. > Make any necessary adjustments to avoid overlap. #### Assign the Agentforce action to your topic . In the **Topics** panel, select the topic you created. . In the **Topic Details** panel, select **This Topic's Actions**. ![Topic details panel | Coveo for Agentforce](pass:m[coveo-for-agentforce/topic-details.png]) . To add your custom prompt template action to the topic, click the **New** action menu, and then select **Create New Action**. . On the **Create an Agent Action** page, specify the following information: ![Create an agent action modal | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-create-agent-action-modal.png]) .. From the **Reference Action Type** dropdown menu, select **Prompt Template**. .. From the **Reference Action** field, select the prompt template you created (for example, **Answer Questions With Coveo**). The **Agent Action Label** and **Agent Action API Name** fields are automatically filled by Salesforce. .. Click **Next** and scroll to the **Agent Action Configuration** section. ![Agent action configuration panel | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-agent-action-configuration.png]) .. In the **Agent Action Instructions** field, enter a description for your custom action. **Example** ```text Retrieve relevant passages from the documentation to answer user questions. ``` .. Clear the **Show loading text for this action** checkbox. .. Under the **Inputs** section: ... Provide instructions for the **userInput** input. **Example** ```text The question from the user. ``` ... Provide instructions for the **prapiConfig** input. **Example** ```text The API name of the configuration to use. ``` ... Provide instructions for the **additionalContext** input. **Example** ```text Additional context to retrieve relevant documents. ``` .. Under the **Output** section: ... Under **Data Type**, select the **Show in conversation** checkbox. ... From the **Output Rendering** dropdown menu, select **Rich Text**. .. Click **Finish** to create your action. The **This Topic's Actions** tab now displays your custom action. ![PRAPI prompt template action | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-prompt-template-action.png]) > **Tip** > > If you don't see your custom action in the list, refresh the page. . Click **Activate** in the upper-right corner of the builder to enable your AI agent. . [Test your custom prompt template action](#test-the-action) to confirm it's working as expected. You've successfully set up and deployed the **Coveo Passage Retrieval API** action using a custom prompt template. Your Agentforce AI agent is now able to retrieve relevant passages from the [items](https://docs.coveo.com/en/210/) [indexed](https://docs.coveo.com/en/204/) in your [Coveo organization](https://docs.coveo.com/en/185/) to answer user questions. ### Use the Apex action To deploy the **Coveo Passage Retrieval API** action using the default Apex action, you must: . [Access your Agentforce AI agent](#access-your-agentforce-ai-agent-2). . [Create a topic](#create-a-topic-2). . [Assign the Agentforce action to your topic](#assign-the-agentforce-action-to-your-topic-2). #### Access your Agentforce AI agent . From the Salesforce Setup menu, in the Quick Find box, enter `Agentforce Agents`, and then select **Agentforce Agents**. . On the page that opens, find your Agentforce AI agent, such as Einstein Copilot or Agentforce (Default), click [down] to access the Actions menu, and then select **Open in Builder**. > **Important** > > You can't use Coveo-powered Agentforce actions in a [Service Agent](https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&type=5) at this time. > Use a different agent type to leverage your Coveo-powered actions. . If your Agentforce AI agent is currently active, click **Deactivate** in the upper-right corner of the Agentforce Builder. > **Tip** > > You must always deactivate your Agentforce AI agent to make changes to it. #### Create a topic . In the Agentforce Builder, select **Topics** from the left tab. . Click the **New** actions menu, and then select **New Topic**. . (Optional) In the **Create a Topic** modal, specify the job you want this topic to perform. > **Tip** > > You can skip this step and specify the job you want this topic to perform in the second step of the modal. . Click **Next**. . In the second step of the modal, specify the following information: ![Create a topic page | Coveo for Agentforce](pass:m[coveo-for-agentforce/prapi-create-a-topic.png]) > **Important** > > Creating a topic is an iterative process. > The information in this section isn't exhaustive and is only meant to provide you with an example. > You must adjust the information to fit your specific use case. > See [Best Practices for Topic Instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_instructions.htm&type=5) for guidance on writing effective instructions for your topic. .. In the **Name** field, enter a descriptive name for your topic. **Example** ```text Answer related questions ``` Where `` is the name of your company or product. By default, the **API Name** field is automatically filled by Salesforce based on the information you entered in the **Name** field. .. In the **Classification Description** field, enter text similar to the following: **Example** ```text When a user asks a question about a that . These questions can provide answers to support-related questions or general questions such as ``. ``` Where: * `` is the name of your company or product. * `` is the type of entity you're providing information about. * `` is a brief description of your company or product. * `` is a list of topics that users can ask about. .. In the **Scope** field, enter text similar to the following: **Example** ```text Your job is to answer the user's questions by providing useful information about products or help the user resolve an issue. Create a short to medium-size answer to the questions asked. ``` .. [[prapi-default-topic-instructions]]In the **Instructions** fields, enter text similar to the following: **Examples** * **Instruction 1** ```text Always use the Coveo Passage Retrieval API action. Write an answer to the question that was asked using only the passages that are returned by the Coveo Passage Retrieval API. Don't answer with any other information than the passages returned by the action. ``` * **Instruction 2** ```text Use the citations returned by the Coveo Passage Retrieval API action to display numbered URL links under your answer as the reference documents. ``` * **Instruction 3** ```text Always use the following as input for the Coveo Passage Retrieval API action: {"prapiConfig": ""} ``` Where `` is the name of the configuration you created in [step 3b](#config-name). * **Instruction 4** (Guardrail) ```text If the Coveo Passage Retrieval API action doesn't return a passage, don't attempt to answer the question. Simply say that you couldn't find relevant information to answer the question. ``` .. In the **Example User Input** fields, add examples of questions that users might ask. **Example** * **Example User Input**: ```text What's error code 22? ``` * **Example User Input**: ```text What products does `` offer? ``` * **Example User Input**: ```text Which GPS is the best for sailing? ``` * **Example User Input**: ```text How do I update my maps on my GPS? ``` . Click **Next** and then **Finish** to create your topic. #### Assign the Agentforce action to your topic . In the **Topics** panel, select the topic you created. . In the **Topic Details** panel, select **This Topic's Actions**. ![Topic details panel | Coveo for Agentforce](pass:m[coveo-for-agentforce/topic-details.png]) . Click the **New** action menu, and then select **Create New Action**. . On the **Create an Agent Action** page, specify the following information: ![Create an action page | Coveo for Agentforce](https://docs.coveo.com/en/assets/images/coveo-for-agentforce/prapi-create-an-action-v2.png) .. From the **Reference Action Type** dropdown menu, select **Apex**. .. From the **Reference Action Category** dropdown menu, select **Invocable Method**. .. In the **Reference Action** field, select **Coveo Passage Retrieval API Apex**. The **Agent Action Label** and **Agent Action API Name** fields are automatically filled by Salesforce based on the action you selected in the **Reference Action** field. > **Tip** > > The name of the action you're creating must match the name of the action you specified in the [topic instructions](#prapi-default-topic-instructions). .. Click **Next** and then scroll to the **Agent Action Configuration** section. The instructions for your action and each input and output are displayed. ![Input and output instructions | Coveo for Agentforce](https://docs.coveo.com/en/assets/images/coveo-for-agentforce/prapi-input-output-instructions.png) .. Clear the **Show loading text for this action** checkbox. .. In the **Outputs** section: ... Select the **Show in conversation** checkbox under **Citations** and **Passages**. ... Select **Rich Text** from the **Output Rendering** dropdown menu under **Citations** and **Passages**. .. Click **Finish**. . In the upper-right corner of the Agentforce Builder, click **Activate** to reactivate your AI agent. . [Test your action](#test-the-action) to confirm it's working as expected. You've successfully set up and deployed the **Coveo Passage Retrieval API** Apex action. Your Agentforce AI agent is now ready to provide accurate and relevant responses to your users' questions. ## Test the action . Launch the [Agentforce Builder](https://help.salesforce.com/s/articleView?id=ai.agent_builder_explore.htm&type=5). . Enter a question related to your topic in the **Conversation Preview** panel on the right side of the screen. . Review the information displayed on the **Plan Canvas** (center screen) to verify expected behavior. .. Confirm your AI agent selects the correct topic. .. Confirm the generated response matches the passages returned by the **Coveo Passage Retrieval API** action.