Add a Context Capture Tool

Updated 

The Context Capture Tool lets you capture and store variable values during a conversation. Use it to retain information collected from users, manage dynamic variables throughout a workflow, and update custom fields when needed.

What You Can Do

  • Capture user input and store it as an internal variable.
  • Update Sprinklr custom fields with captured information.
  • Reuse captured values across tools, tasks, and workflow steps.

Steps to Add a Context Capture Tool

For instructions on adding a tool to an AI Agent.

  1. In the Tools window, click + Add Tool.
  2. Select Context Capture from the Select Tool window.
  3. Click Next.
  4. Enter a Name and Description.
  5. In Setup Function, choose one of the following:

    • Create an Internal Variable
    • Select an existing Custom Field

Configure Internal Variables

Internal variables store conversation data temporarily and make it available throughout the workflow.

  1. In Select inputs to capture, enter:

    • Name
    • Description
    • Type
    • Required (Yes or No)
  2. Select a data type:

    • String
    • Integer
    • Number
    • Boolean

Internal Variable Characteristics

  • Store data temporarily within AI Agent workflows.
  • Support multiple data types.
  • Remain available only during the current conversation or session.

Reference an Internal Variable

To use a captured value in another tool or task, reference it using:

${variable}

Unsupported Variable Names

Do not use the following reserved variable names when configuring internal variables. Using these names may result in unexpected behaviour.

id, entityId, anyEntityId, name, image, type, detail, globalUniques, lookupRecords, shares, importId, scorecard, entityMetadata, tags

For example, use customerName instead of name.

Configure Custom Fields

Custom fields store data persistently in Sprinklr and can be used for reporting and analytics.

  1. In Select custom fields to be tagged, select the custom field from the Name drop-down.
  2. Set Required to Yes or No.
  3. Save the configuration.

After the tool runs, the selected custom field is automatically updated.

Custom Field Characteristics

  • Store data permanently in the Sprinklr database.
  • Support reporting, analytics, and downstream processes.

Note: GenAI maps captured values to custom fields based on the custom field description.

To learn more about custom fields, see Custom Fields | Sprinklr Help Center.

Important: Always provide a description when creating a custom field. Clear descriptions improve tagging accuracy and help GenAI map values correctly

Save the Tool

After completing the configuration, click Save.

Note:

  • If Required is set to Yes, the AI Agent continues prompting the user until a value is provided.

  • If Required is set to No, the AI Agent does not request the information and either leaves the field empty or attempts to extract the value from the conversation

Example Use Case

A customer requests a point of view (POV) on a company such as Nike or HDFC. The AI Agent captures details such as the company name and stock ticker, stores them in custom fields, and uses the information for reporting, analysis, and follow-up actions.