--- title: Configure a Coveo Insight Panel Lightning Component for Chat (Live Agent) slug: '3165' canonical_url: https://docs.coveo.com/en/3165/ collection: coveo-for-salesforce source_format: adoc --- # Configure a Coveo Insight Panel Lightning Component for Chat (Live Agent) [.version.c4sf.c4sf-edition.c4sf-pro-enterprise] [Pro and Enterprise editions](https://docs.coveo.com/en/l2590456#salesforce) This article describes how to configure the Coveo Insight Panel Lightning Component for Chat (formerly Live Agent). ## Step 1: Add the Coveo Insight Panel Lightning Component to a Chat page in Salesforce . Make sure you've [enabled Chat](https://help.salesforce.com/s/articleView?id=sf.live_agent_enable.htm&type=5) in your Salesforce organization. . Access the [Lightning Service Console](https://help.salesforce.com/s/articleView?id=sf.console_lex_service_intro.htm&type=5), and then open an existing Chat session. . In the upper-right corner of the page, click ![Settings icon in Salesforce](coveo-for-salesforce/attachments/40501329/40632443.png), and then select **Edit Page**. . In the **Lightning App Builder**, on the **Live Chat Transcript Record Page**, drag the **Coveo Insight Panel** component to the panel on the right, and then click **Save**. . If the new page isn't already activated, activate it. .. Click **Assign as Org Default**. > **Note** > > You can make these changes available as the default or edit the assignment rules to activate this page only for specific users or profiles. .. Once you're done with the assignment rules, click **Save**. . In the upper-right corner of the page, click **Back**. . In the **Coveo Insight Panel** component, click **Set Up a Search Page**. . Select the tabs that you want to include in your panel, and then click **Create Page**. You can always modify the tabs later. ## Step 2: Configure the Coveo Insight Panel Lightning Component for Chat . [Create a Coveo Machine Learning (Coveo ML) Automatic Relevance Tuning (ART) model](https://docs.coveo.com/en/3397#create-an-art-model). > **Note** > > If you don't use a Coveo ML ART model, you can configure the [partial match feature](https://docs.coveo.com/en/414/) as a fallback solution. . [Associate the ART model](https://docs.coveo.com/en/l1ca1038/) with the [query pipeline](https://docs.coveo.com/en/180/) used by your Coveo Insight Panel Lightning Component. You must associate the model twice. The first association aims at optimizing the model when a [large query expression (`lq`)](https://docs.coveo.com/en/214/) is populated, while the second aims at optimizing the model when a [basic query expression (`q`)](https://docs.coveo.com/en/178/) is populated. .. For the first association, enable the [**Comply with Intelligent Term Detection (ITD)**](https://docs.coveo.com/en/l1ca1038#comply-with-intelligent-term-detection-itd) option, and then add the following [condition](https://docs.coveo.com/en/1959/): `Large Query Is populated`. .. For the second association, disable the [**Comply with Intelligent Term Detection (ITD)**](https://docs.coveo.com/en/l1ca1038#comply-with-intelligent-term-detection-itd) option, and then add the following [condition](https://docs.coveo.com/en/1959/): `Large Query Is not populated`. > **Tip** > > By default, the Coveo Insight Panel Lightning Component uses the **Default** query pipeline. > However, we recommend [creating a specific pipeline](https://docs.coveo.com/en/1791#create-a-query-pipeline) for this audience and using a [condition](https://docs.coveo.com/en/2793/) based on the Coveo Insight Panel Lightning Component [searchHub](https://docs.coveo.com/en/1342/) (see [Set the search hub](https://docs.coveo.com/en/365#set-the-search-hub)). . On the [**Query Pipelines**](https://platform.cloud.coveo.com/admin/#/orgid/search/pipelines/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/pipelines/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/pipelines/)) page, click the query pipeline used by your Coveo Insight Panel Lightning Component, and then click **Edit components** in the Action bar. . On the subpage that opens, select the **Advanced** tab, and then click **Query parameters** on the left side of the page. . On the **Query Parameters** tab, add a rule overriding the [large query expression (lq)](https://docs.coveo.com/en/13#operation/searchUsingPost-lq) parameter value with the [`context`](https://docs.coveo.com/en/13#operation/searchUsingPost-context) object. This rule lets the Coveo Insight Panel Lightning Component display items relevant to the current Salesforce object before a query is sent. .. Click **Add a query parameters rule**. .. On the **Add a query parameter rule** subpage, select **lq (large query expression)**, and then click **Next**. .. Under **lq (large query expression)**, enter `<@+ $context.LiveAgent_AllVisitorMessages +@>`. > **Note** > > The context can either be `LiveAgent_LastVisitorMessage`, `LiveAgent_LastAgentMessage`, `LiveAgent_AllVisitorMessages`, or `LiveAgent_AllAgentMessages`. > > The `LiveAgent_AllVisitorMessages` context value provides all the customer messages and context, allowing Coveo Machine Learning to identify relevant keywords. > With `LiveAgent_LastVisitorMessage`, the context values of previous messages are excluded. > The `LiveAgent_LastAgentMessage` and `LiveAgent_AllAgentMessages` context values show only agent results. .. Under **Condition**, select or [create](https://docs.coveo.com/en/1959#create-a-condition) a `Query is empty` condition. It ensures that the [`context`](https://docs.coveo.com/en/13#operation/searchUsingPost-context) of the current Salesforce object will only apply to the automatic queries made by the Coveo Insight Panel Lightning Component. > **Leading practice** > > You can use the same query pipeline for both of your Case and Chat pages, but you have to enter different `SearchHub` names, typically `AgentCase` and `AgentChat`. > > When adding the overriding rules in your **Query Parameters** for each Coveo Insight Panel Lightning Component, create a condition `Search hub is [SearchHub name]` for each search hub. .. Click **Add rule**. Your **Query Parameters** rule should now look like this: ![Query parameter rule | Coveo for Salesforce](https://docs.coveo.com/en/assets/images/coveo-for-salesforce/query-parameter-rule.png) > **Note** > > Depending on your use case, you may need to add custom dimensions to make the search and click events metadata available in your usage analytics reports (see [Manage dimensions on custom metadata](https://docs.coveo.com/en/1522/)). > > For a Chat Page, add `context_liveagent_allvisitormessages`, `context_liveagent_allagentmessages`, `context_liveagent_lastvisitormessage`, or `context_liveagent_lastagentmessage`.