Source: https://vaultcrmhelp.veeva.com/doc/Content/CRM_topics/VeevaAI/TextMonitoringAgent/HomeOffice/Configuration.htm

## Configuring Agentic Text Monitoring for Home Office

### Configuring Agentic Text Monitoring for Home Office for

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)Compliance Administrators](#)

To configure this agent:

1. Ensure [Configuring Vault AI in CRM](../../Configuration.htm) is complete.
2. Navigate to **Admin > Users & Groups > Permission Sets**.
3. Select the appropriate permission set.
4. Select the **Agents** tab.
5. Select the Execute checkbox for the **Text Monitoring for Home Office Agent** (text\_monitoring\_for\_home\_office\_agent\_\_v).
6. Select the **Objects** tab.
7. Grant the following permissions:

   | Object | Object Permission | Object Types | Fields | Field Permission |
   | --- | --- | --- | --- | --- |
   | agent\_rule\_\_v | CRE | text\_monitoring\_agent\_rule\_\_v | * acceptable\_example\_\_v * applicable\_countries\_\_v * applicable\_fields\_\_v * applicable\_user\_types\_\_v * display\_order\_\_v * instruction\_\_v * name\_\_v * unacceptable\_example\_\_v | Edit |
   | monitored\_text\_\_v | CRE | * agent\_monitored\_text\_\_v * agent\_flagged\_phrase\_\_v | * issues\_found\_\_v * reviewer\_determination\_\_v * reviewer\_notes\_\_v | Edit |
   | * agent\_flagged\_phrase\_\_v * agent\_reasoning\_\_v * agent\_rule\_\_v * agent\_rule\_instruction\_\_v * application\_profile\_\_v * assignee\_\_v * category\_\_v * complete\_agent\_request\_\_v * complete\_agent\_response\_\_v * country\_\_v * created\_by\_\_v * created\_date\_\_v * detail\_group\_\_v * external\_id\_\_v * flagged\_phrase\_\_v * global\_id\_\_sys * id * is\_parent\_\_v * feedback\_\_v * job\_id\_\_v * modified\_by\_\_v * modified\_date\_\_v * legacy\_crm\_id\_\_v * lifecycle\_\_v * stage\_\_sys * state\_\_v * state\_stage\_id\_\_sys * link\_\_sys * vault\_id\_link\_\_v * monitored\_date\_\_v * monitored\_field\_\_v * monitored\_object\_\_v * name\_\_v * monitored\_text\_status\_\_v * object\_type\_\_v * monitoring\_rule\_name\_\_v * ownerid\_\_v * parent\_monitored\_text\_\_v * product\_\_v * security\_profile\_\_v * status\_\_v * text\_\_v * text\_created\_by\_\_v * text\_last\_modified\_by\_\_v * text\_last\_modified\_date\_\_v * text\_owner\_\_v * user\_profile\_\_v * user\_type\_\_v * vault\_id\_\_v | Read |
   | call2\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | call2\_discussion\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | commercial\_insight\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | medical\_insight\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
8. Navigate to **Admin > Configuration > Objects > ai\_settings\_\_v**.
9. Select the **Layouts** tab.
10. Place the **home\_office\_text\_monitoring\_\_v** field on the appropriate layouts.

#### Creating Agent Rule Layouts

To customize the information displayed to compliance admins, create layouts for agent rules:

1. Navigate to **Admin > Configuration > Objects > agent\_rule\_\_v**.
2. Select the **Layouts** tab.
3. Create a layout for the **text\_monitoring\_agent\_rule\_\_v** object type.
4. Place the appropriate fields on the layout, in the desired order:

* acceptable\_example\_\_v
* applicable\_countries\_\_v
* applicable\_fields\_\_v
* applicable\_user\_types\_\_v
* display\_order\_\_v
* instruction\_\_v
* name\_\_v
* unacceptable\_example\_\_v

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)Compliance Monitors](#)

To configure this agent:

1. Ensure [Configuring Vault AI in CRM](../../Configuration.htm) is complete.
2. Navigate to **Admin > Users & Groups > Permission Sets**.
3. Select the appropriate permission set.
4. Select the **Agents** tab.
5. Select the Execute checkbox for the **Text Monitoring for Home Office Agent** (text\_monitoring\_for\_home\_office\_agent\_\_v).
6. Select the **Objects** tab.
7. Grant the following permissions:

   | Object | Object Permission | Object Types | Fields | Field Permission |
   | --- | --- | --- | --- | --- |
   | monitored\_text\_\_v | CRE | * agent\_monitored\_text\_\_v * agent\_flagged\_phrase\_\_v | * issues\_found\_\_v * reviewer\_determination\_\_v * reviewer\_notes\_\_v | Edit |
   | * agent\_flagged\_phrase\_\_v * agent\_reasoning\_\_v * agent\_rule\_\_v * agent\_rule\_instruction\_\_v * application\_profile\_\_v * assignee\_\_v * category\_\_v * complete\_agent\_request\_\_v * complete\_agent\_response\_\_v * country\_\_v * created\_by\_\_v * created\_date\_\_v * detail\_group\_\_v * external\_id\_\_v * flagged\_phrase\_\_v * global\_id\_\_sys * id * is\_parent\_\_v * feedback\_\_v * job\_id\_\_v * modified\_by\_\_v * modified\_date\_\_v * legacy\_crm\_id\_\_v * lifecycle\_\_v * stage\_\_sys * state\_\_v * state\_stage\_id\_\_sys * link\_\_sys * vault\_id\_link\_\_v * monitored\_date\_\_v * monitored\_field\_\_v * monitored\_object\_\_v * name\_\_v * monitored\_text\_status\_\_v * object\_type\_\_v * monitoring\_rule\_name\_\_v * ownerid\_\_v * parent\_monitored\_text\_\_v * product\_\_v * security\_profile\_\_v * status\_\_v * text\_\_v * text\_created\_by\_\_v * text\_last\_modified\_by\_\_v * text\_last\_modified\_date\_\_v * text\_owner\_\_v * user\_profile\_\_v * user\_type\_\_v * vault\_id\_\_v | Read |
   | call2\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | call2\_discussion\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | commercial\_insight\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |
   | medical\_insight\_\_v | CRE | All applicable object types | flagged\_text\_\_v | Edit |

#### Creating Monitored Text Layouts

To customize the information displayed to compliance monitors, create layouts for Agent Monitored Text and Agent Flagged Phrase object types.

##### Agent Monitored Text

To create this layout:

1. Navigate to **Admin > Configuration > Objects > monitored\_text\_\_v**.
2. Select the **Layouts** tab.
3. Create a new layout for the **agent\_monitored\_text\_\_v** object type.
4. Create the following **Detail Form** sections:

   * Review Assignment (two-column layout)
   * Monitored Record Details (two-column layout)
   * Agent Request and Response (two-column layout)
   * Workflow Timeline, if not already on the layout (one-column layout)
5. Create a **Related Object** section for Agent Flagged Phrase (s).
6. Include the following columns in the **Agent Flagged Phrase (s)** section:

   * Monitored Text Name (name\_\_v)
   * Agent Rule (agent\_rule\_\_v)
   * Agent Reasoning (agent\_reasoning\_\_v)
   * Text (text\_\_v)
   * Reviewer Determination (reviewer\_determination\_\_v)
7. Place the following fields in the Detail Form sections:

   * Review Assignment:
   * ID (id)
   * Created By (created\_by\_\_v)
   * Created Date (created\_date\_\_v)
   * Last Modified By (modified\_by\_\_v)
   * Last Modified Date (modified\_date\_\_v)
   * Assignee (assignee\_\_v)
   * Issues Found (issues\_found\_\_v)
   * Status (status\_\_v)
   * Lifecycle (lifecycle\_\_v)
   * Lifecycle Stage (stage\_\_sys)
   * Lifecycle State (state\_\_v)
   * Owner (ownerid\_\_v)
   * Monitored Record Details:
   * Link to Flagged Record (vault\_id\_link\_\_v)
   * Monitored Date (monitored\_date\_\_v)
   * Monitored Object (monitored\_object\_\_v)
   * Monitored Field (monitored\_field\_\_v)
   * Text Owner (text\_owner\_\_v)
   * Text Last Modified Date (text\_last\_modified\_date\_\_v)
   * User Country (country\_\_v)
   * User Profile (user\_profile\_\_v)
   * User Type (user\_type\_\_v)
   * Agent Request and Response:
   * Complete Agent Request (complete\_agent\_request\_\_v)
   * Complete Agent Response (complete\_agent\_response\_\_v)

   Fields do not need to be placed in the Workflow Timeline section.
8. Select **Save**.

##### Agent Flagged Phrase

To create this layout:

1. Navigate to **Admin > Configuration > Objects > monitored\_text\_\_v**.
2. Select the **Layouts** tab.
3. Create a new layout for the **agent\_flagged\_phrase\_\_v** object type.
4. Create the following **Detail Form** sections:

   * Flagged Phrase (two-column layout)
   * Agent Rule (two-column layout)
   * Review (two-column layout)
   * Workflow Timeline, if not already on the layout (one-column layout)
5. Place the following fields in the Detail Form sections:

   * Flagged Phrase:
   * Parent Monitored Text (parent\_monitored\_text\_\_v)
   * Text (text\_\_v)
   * Flagged Phrase (flagged\_phrase\_\_v)
   * Text Owner (text\_owner\_\_v)
   * Text Created By (text\_created\_by\_\_v)
   * Text Last Modified By (text\_last\_modified\_by\_\_v)
   * Text Last Modified Date (text\_last\_modified\_date\_\_v)
   * Agent Rule:
   * Agent Flagged Phrase (agent\_flagged\_phrase\_\_v)
   * Agent Rule (agent\_rule\_\_v)
   * Agent Rule Instruction (agent\_rule\_instruction\_\_v)
   * Agent Reasoning (agent\_reasoning\_\_v)
   * Review:
   * Reviewer Determination (reviewer\_determination\_\_v)
   * Reviewer Notes (reviewer\_notes\_\_v)

Fields do not need to be placed in the Workflow Timeline section.

#### Creating an Agent Monitored Text Tab

To provide a dedicated tab for compliance monitors to access Agent Monitored Text records:

1. Navigate to **Admin > Configuration > Tabs**.
2. Select **Create**.
3. Populate the following fields:

   * Tab Type - Object
   * Object - monitored\_text\_\_v
   * Object Type - agent\_monitored\_text\_\_v
4. Select **Save**.
5. Navigate to **Admin > Users and Groups > Permission Sets**.
6. Select the appropriate permission set.
7. Select the **Tabs** tab.
8. Grant **View** permission to the newly created tab.

#### Creating a Monitored Text Workflow

Admins can create custom lifecycles and workflows on the Monitored Text object to reflect their organization’s compliance monitoring processes. These lifecycles and workflows vary depending on the organization. For more information, see [Lifecycles & Workflows](https://platform.veevavault.help/en/gr/70436/) on the Vault platform help site.

When building a custom lifecycle and workflow on the Monitored Text object, ensure it works for all functionality relying on this object: [Agentic Text Monitoring](../EndUser/TMOverview.htm), [Agentic Text Monitoring for Home Office](HomeOfficeOverview.htm), and [Approved Notes](../../../ApprovedNotes/Overview.htm), if enabled in the Vault.

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)End Users](#)

To configure this agent:

1. Ensure [Configuring Vault AI in CRM](../../Configuration.htm) is complete.
2. Navigate to **Admin > Users & Groups > Permission Sets**.
3. Select the appropriate permission set.
4. Select the **Agents** tab.
5. Select the Execute checkbox for the **Text Monitoring for Home Office Agent** (text\_monitoring\_for\_home\_office\_agent\_\_v).
6. Navigate to **Business Admin > Objects > AI Settings**.
7. Select the **home\_office\_text\_monitoring\_\_v** AI setting to On Submit, to enable the feature for the applicable users. These are the users whose submitted records will be monitored by the agent.
8. Activate the **Text Monitoring for Home Office Agent**:

* Navigate to **Admin > Configuration > Vault AI Setup > Agents**
* Select the **Text Monitoring for Home Office Agent** (text\_monitoring\_for\_home\_office\_agent\_\_v)
* Select **Edit**
* Select **Active** in the Status picklist
* Select **Save**
* Expand the **Actions** section
* Verify the appropriate agent actions are Active for the agent:
* Home Office Text Monitoring - Apply Agent Rules for Home Office Text Monitoring

### Creating Custom Rules as

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)Compliance Administrators](#)

Admins create Agent Rule records to determine how records are reviewed for home office monitoring. Admins must create their own custom rules via Agent Rule records and ensure that they are updated as needed.

At least one active custom rule is required to use Text Monitoring for Home Office.

To create custom rules:

1. Navigate to **Business Admin > Objects > Agent Rules**.
2. Copy an existing rule, or create a new one. The object type must be Agentic Text Monitoring Rule.
3. Populate the following fields:

* Rule Name - Name of the custom rule
* Instruction - Text description of the rule and how the agent should apply the rule. The agent can be instructed to call two tools to support monitoring if necessary for the agent’s context. To call a tool, include the API name of the tool in the plain language instruction:
* is\_product - This tool retrieves the user’s My Setup Products and allows the agent to determine if a product mentioned in the user’s text corresponds to a Company Detail product. This tool is useful in cases where the agent needs to apply different brand guidance for company products.
* query\_prescribing\_information - This tool retrieves PI (Prescribing Information) documents from the vector database for the user’s Company Detail products. This tool is useful when the agent needs to perform off-label analysis. See [Configuring Agentic Text Monitoring](../EndUser/Configuration.htm#Providin) for information on uploading PI documents.

  Using the query\_prescribing\_information tool can increase token consumption and latency due to retrieval and parsing of PI documents.
* Acceptable Example - Example of text acceptable under the rule
* Unacceptable Example - Example of text not acceptable under the rule
* Applicable Fields - Field and object combinations to be monitored, in a semicolon-delimited list using dot notation. For example, to monitor the Call Text field, enter the text: call2\_\_v.call\_notes\_\_v. Text fields on the following objects are supported:
* call2\_\_v
* call2\_discussion\_\_v
* commercial\_insight\_\_v
* medical\_insight\_\_v

  Only fields with data type Text, Rich Text, or Long Text are supported for monitoring.
* Display Order (optional) - Relative order in which rules are evaluated. For example, if there are four rules with display order values of 1, 2, 7, and 1, they are inserted into the prompt in the order of 1, 1, 2, 7. When two rules have the same display order, their order is determined by which rule is returned first.
* Applicable User Types (optional) - User types the rule applies to. For example, Sales. If left blank, the rule applies to all user types.
* Applicable Countries (optional) - Countries where the rule applies. This is matched to the User Country. If left blank, the rule applies to all countries.

1. Ensure the record status is **Active**.
2. Select **Save**.

![](../../../../Resources/Images/VeevaAI/FreeText/HomeOffice/RuleExampleSaved.png)

It may take up to 15 minutes for changes to Agent Rules - including added, deleted, or edited rules - to be reflected in the agent's monitoring results.

### Related Topics

[Monitoring Submitted Records](Monitoring.htm)

[Agentic Text Monitoring for Home Office Overview](HomeOfficeOverview.htm)

[Flightpath: Agentic Text Monitoring for Home Office](https://vaultcrmflightpath.veeva.com/doc/Content/VeevaAI/HomeOfficeAgent/1.Intro.htm)
