In Vaults using Veeva AI for Quality, Veeva QMS provides a Deviation Agent that can generate a narrative summary of the investigation or CAPA plan for a Deviation. The summary includes information from key related records, such as Investigations and Root Causes for an investigation summary, and CAPA Actions for a CAPA plan summary. The Deviation Agent can also answer questions about a Deviation record and its related records via Veeva AI Chat.
See below for definitions of terms used in this article:
- Agent: Defines a set of Agent Actions that can be performed on a document or object record in your Vault.
- Agent Objective: A description of the Agent’s roles and responsibilities, similar to a job description.
- Agent Context: Defines the information an Agent knows about your Vault, allowing the Agent Action to summarize this information in a response. Agent Context can include data from an object record such as fields and object relationships.
- Agent Actions: The actions that the Agent can perform. Agents perform Agent Actions based on the provided Objective, Context, and instructions.
- Agent Tools: Tools are assigned to Agent Actions, and provide the structure for the Agent’s response in order to ensure a consistent output format. Agent Tools are not editable.
Supported Objects & Object Types
The Deviation Agent supports the following objects and object types:
- Deviation: All object types
- Quality Event: Deviation and GCP Deviation object types
The Agents do not support custom objects and object types.
Your Vault may process deviations using either a standalone Deviation object or a Quality Event object of the Deviation or GCP Deviation object type. In this article, these objects are collectively referred to as Deviations. All configuration steps in this article also apply to the Deviation and GCP Deviation object types of the Quality Event object.
Supported Agent Actions
The following Agent Actions are available for the Deviation Agent on supported objects and object types:
- Ask Questions about the Deviation: Lets users ask the Deviation Agent questions about a Deviation record via the Veeva AI Chat interface.
- Generate Investigation Summary: Lets users summarize an investigation by clicking the Generate Summary (
) icon next to the Investigation Summary & Conclusion field on a Deviation record. - Generate CAPA Summary: Lets users summarize a CAPA plan by clicking the Generate Summary (
) icon next to the CAPA Plan Summary field on a Deviation record.
Configuration Overview
To configure the Deviation Agent, complete the following steps:
- Activate the Deviation Agent
- Configure summary fields on the Deviation object
- Optional: Configure Agent Actions
- Optional: Configure custom Agent Context
- Configure user permissions
Activating Agents
You must activate the Agents in order to make them available for use. To activate, navigate to Admin > Configuration > Agents > Deviation Agent, and set the Status of the Agent to Active.
Configuring Object Fields
Activate the following Rich Text fields on the Deviation object and add them to the relevant object types and layouts:
- CAPA Plan Summary (
capa_plan_summary_rt__v) - Investigation Summary & Conclusion (
investigation_summary_conclusion_rt__v)
We recommend hiding these fields via Atomic Security or layout rules in earlier lifecycle states and exposing them only during the later stages of the lifecycle, when your data is expected to be most complete for summary generation.
Note: The Rich Text fields listed above are distinct from the similarly labelled CAPA Plan Summary (capa_plan_summary__v) and Investigation Summary & Conclusion (investigation_summary_conclusion__v) Text fields on the Deviation object. These fields are not supported for narrative summary generation.
Configuring Agent Actions
You can optionally configure standard Agent Actions by adding custom context and corresponding Supplemental Instructions to let that action know that custom context exists for the action. See Configuring Context for more information about creating custom context.
You can also optionally configure new custom Agent Actions in order to extend the capabilities of the Deviation Agent to address your business needs.
Configuring Agent Context
You can optionally configure custom Agent Context in order to define additional related records and fields for the Agents to summarize. If using custom context, we recommend including similar objects, fields, and relationships as the standard context for optimal results.
- Navigate to Admin > Configuration > Agents > Deviation Agent.
- Expand the Context section and click Create.
- From the Type drop-down, select Object Data.
- Enter a Label.
- Enter a Name.
- Optional: Enter a Description.
- Select an option for Always Include. This determines if the Agent always summarizes the information specified in this context.
- In the Configuration section, click Generate Default to populate the Object Fields box with the default context for the Agent. You can modify the related objects and fields referenced in the generated context to suit your business needs. You can also write your own context using the same syntax as in Word formatted output templates.
- Click Save.
- Navigate back to the Agent and select an Action from the Actions section.
- In the Available Context section, click Add.
- In the dialog, select the context you created.
- Click OK.
- On the Action, click Edit.
- Optional: Add Supplemental Instructions to let the Agent know that custom context exists for this Action.
- Click Save.
If you wish to only use a custom context for any of the available Agent Actions, you can inactivate the standard context by navigating to the context and setting the Status to Inactive.
Data Model Migration Considerations for Custom Context
When migrating to a standalone quality event data model, any custom context configured for the Deviation Agent must be deleted, and recreated after migration is complete. Vault automatically updates the object and field references for standard context. If you are not using custom context, no action is required to reconfigure the Agents after transitioning to a standalone data model.
Limitations
The following limitations affect the Deviation Agent:
- Summarize up to 10 related records per object relationship. For instance, the summary of an Investigation can include up to 10 related Root Cause records.
- A summary cannot be generated in a custom target field. You must use the standard Investigation Summary & Conclusion and CAPA Plan Summary fields.
- Generated summaries can contain up to 5,000 characters.
- Agents cannot summarize field values on the Deviation record that have been edited without saving the record. Edits to related records made while editing the primary Deviation are included in the summary.
User Permissions
To interact with the Deviation Agent, users must have the following permissions:
| Type | Permission Label | Controls |
|---|---|---|
| Security Profile | Agents: Deviation Agent: Execute | Ability to generate a narrative summary using the Deviation Agent. |
| Security Profile | Application: Vault Actions: Veeva AI Chat: Use Chat | Ability to view and interact with Veeva AI Chat. |
| Security Profile | Agents: Super Agent: Execute | Ability to ask questions via Veeva AI Chat about a Deviation record. |
| Security Profile | Objects: Deviation: [object type]: Edit | Ability to edit Deviation records of the relevant object type. |
| Security Profile | Objects: Deviation: Object Field Permissions: CAPA Plan Summary, Investigation Summary & Conclusion: Edit | Ability to edit relevant fields on Deviation records. |
| Atomic Security | Deviation Lifecycle: [state] Atomic Security: Fields: CAPA Plan Summary, Investigation Summary & Conclusion: Edit | Ability to edit relevant fields in applicable lifecycle states of the Deviation Lifecycle. |
Related Permissions
The following permissions control your ability to configure Agents:
| Type | Permission | Access Details |
|---|---|---|
| Security Profile | Admin: Agents: Edit | Ability to edit and configure Agents. |
| Security Profile | Admin: Tools: Edit | Ability to edit Agent Tools. |
| Security Profile | Agent Instance: Read | Ability to view the Agent Instance object. |
| Security Profile | Agent Action Execution: Read | Ability to view the Agent Action Execution object. |
| Security Profile | Admin: Objects: Edit | Ability to edit and configure Vault objects. |
| Security Profile | Admin: Permission Sets: Edit | Ability to edit and configure permission sets. |