Skip to main content
The Extract Dynamic Variables tool captures specific values spoken by the customer during a live call and stores them as named variables. Once captured, these variables are available as {{variable_name}} in any tool or prompt within the same agent — no manual mapping required.
Extract
Extracted variables are available as {{variable_name}} in any tool or prompt in this agent.

When to Use

Configure this tool when your agent needs to:
  • Capture a customer’s name, email, or phone number from conversation
  • Store a policy number, account ID, or booking reference before an API call
  • Record a preferred date, time, or department for downstream routing
  • Save any value the customer provides that another tool will need later

Steps to Add

  1. Open the Agent Builder
  2. Click + Add Tool
  3. Select Extract Dynamic Variables from the tool menu
  4. A configuration modal will appear — fill in all fields (described below)
  5. Click Add to Agent

Configuration Fields

Instruction (When this tool should be invoked)

Write a clear instruction that tells the AI agent when to trigger the extraction. The agent reads this and decides at each turn of the conversation whether the condition has been met.
Be specific about what the customer must have said before extraction happens. Vague instructions like “extract when needed” cause the tool to fire at the wrong moment.

Variables

Each variable you want to capture is defined as a row with three fields:

variable_name

The identifier you will use to reference this value everywhere else in the agent. Must be in snake_case with no spaces.
Use descriptive names that clearly state what value is stored. Avoid short or ambiguous names like val1 or x — they become confusing when used across multiple tools.

Datatype

The expected format of the captured value. Selecting the correct datatype helps the agent extract and validate the value accurately. When in doubt, use string — it is the most flexible and works for most values including phone numbers, IDs, and reference codes.

What this captures (description)

A short, plain-language description of exactly what this variable should contain. The agent uses this description to understand what to listen for in the conversation.
Write this as if you are explaining it to someone who doesn’t know the product. The clearer this is, the more accurately the agent extracts the right value.

Adding Multiple Variables

Click + Add variable to add more rows. Each row captures a different value from the conversation. You can add as many variables as needed in a single tool call. For example, an insurance renewal agent might capture all of the following in one extraction:

Variable Format

Once defined, variables are referenced using double curly braces throughout the agent:
They work anywhere inside the agent — in prompts, in tool instructions, in API endpoint URLs, in request body fields, and in header values. In a prompt:
In an API endpoint URL:
In a request body:

Extraction Timing

The agent extracts variables at the moment the instruction condition is met — not before. This means:
  • The agent listens through the conversation normally
  • When the trigger condition is satisfied (e.g., customer provides their name), the tool fires
  • Extracted values are immediately available to all subsequent tools and prompts in the agent
Configure the Instruction carefully to ensure extraction happens at the right point — after the customer has provided the value, not before.

Real-World Example

Scenario: An outbound insurance renewal agent that needs to confirm the customer’s identity and capture their renewal decision before making an API call. Instruction:
Variables: Conversation flow:

Best Practices

  • Use snake_case for all variable names — no spaces, hyphens, or capital letters
  • Write specific What this captures descriptions — the agent reads these literally to know what to listen for
  • Add all related variables in a single tool rather than creating multiple extraction tools for the same conversation segment

Troubleshooting


Combining with Other Tools