Skip to main content

Overview

Effective data collection is essential for voice agents that need to gather information from callers. Hamsa provides multiple methods to collect, validate, and use data throughout conversations, from simple name collection to complex multi-field forms.
Data Collection Methods:
  • Natural Language Extraction - AI extracts data from spoken conversation
  • DTMF Input Capture - Collect digits via keypad
  • Structured Prompting - Guide users to provide specific information
  • Variables - Store and reference collected data

Collection Methods

1. Natural Language Extraction

The most natural method - AI extracts information from conversation. How It Works:
  1. User speaks naturally
  2. AI identifies and extracts specific data
  3. Data stored in variables
  4. Available for use throughout the flow
Example: Collecting Customer Information
Best For:
  • Names, addresses, email addresses
  • Dates and times (flexible formats)
  • Free-form descriptions
  • Complex multi-field responses
  • Natural conversation flow
Advantages:
  • Natural user experience
  • Flexible input formats
  • Handles variations well
  • No learning curve for users
Disadvantages:
  • Potential transcription errors
  • Format inconsistencies
  • Requires validation
  • May need clarification

2. DTMF Input Capture

Collect precise numeric data via keypad. How It Works:
  1. Agent prompts for numeric input
  2. User enters digits on keypad
  3. System captures key presses
  4. Stores in variable
Example: Account Number Collection
Best For:
  • Account numbers
  • Phone numbers
  • ZIP codes
  • PINs and passwords
  • Social security numbers (last 4 digits)
  • Confirmation codes
  • Numeric IDs
Advantages:
  • 100% accurate (no transcription errors)
  • Works in noisy environments
  • Familiar to users
  • Secure for sensitive data
Disadvantages:
  • Numbers only (0-9)
  • Slower than speaking
  • Requires hands-free device awareness
  • Not accessible to all users

3. Guided Prompting

Ask specific questions to collect structured data. How It Works:
  1. Ask focused, single questions
  2. Extract one piece of information
  3. Confirm understanding
  4. Move to next question
Example: Appointment Scheduling
Best For:
  • Multi-step forms
  • Complex data collection
  • Situations requiring validation
  • When precision matters
Advantages:
  • Clear expectations
  • Easy to validate
  • Reduces errors
  • Good user experience
Disadvantages:
  • Takes more time
  • Multiple conversational turns
  • Can feel rigid
  • Requires good flow design

Variable System

Defining Variables

1

Choose Variable Type

Extracted Variables: Collected during conversation Custom Variables: Passed via API when call starts System Variables: Built-in (time, caller ID, etc.)
2

Name Your Variable

Use snake_case format:
  • customer_name
  • phone_number
  • appointment_date
  • order_number
3

Configure Extraction

Provide clear extraction instructions:
  • What to extract
  • Expected format
  • Examples if helpful
4

Use Throughout Flow

Reference variable anywhere:
  • Prompts: {{customer_name}}
  • Tool parameters
  • Routing conditions

Variable Naming Best Practices

Good Names:
Bad Names:

Extraction Instructions

Clear Instructions:
With Examples:

Complete Collection Workflows

Example 1: Customer Registration

Collect comprehensive customer information.

Example 2: Secure Authentication

Collect sensitive information securely.

Example 3: Hybrid Collection (DTMF + NL)

Combine DTMF and natural language for optimal UX.

Example 4: Survey Data Collection

Structured survey with validation.

Validation Strategies

Format Validation

Ensure data meets expected format. Email Validation:
Phone Number Validation:
Date Validation:

Range Validation

Ensure values fall within acceptable ranges.

Existence Validation

Verify data exists in system.

Handling Collection Errors

Transcription Errors

Speech recognition isn’t perfect. Strategy: Confirmation
Strategy: Phonetic Spelling

Ambiguous Input

User provides unclear information.

Incomplete Information

User doesn’t provide all needed data.

Advanced Techniques

Multi-Slot Extraction

Extract multiple fields from one response.

Conditional Collection

Collect different data based on context.

Progressive Profiling

Collect more data over multiple interactions.

Context-Aware Collection

Use available context to skip collection.

Data Storage & Usage

Storing Collected Data

During Call:
After Call:

Using Collected Data

In Prompts:
In Tools:
In Routing:
In Webhooks:

Troubleshooting

Check:
  • Extraction instructions are clear
  • User actually provided the information
  • Variable name is correct (snake_case)
  • Extraction is enabled on the node
Solutions:
  • Make instructions more specific
  • Add examples to instructions
  • Ask more directly for the information
Check:
  • Transcription accuracy
  • Extraction instructions specificity
  • User response clarity
Solutions:
  • Add format specifications to instructions
  • Confirm what was heard
  • Use DTMF for critical data
Check:
  • DTMF Input Capture is enabled
  • Variable name is set
  • At least one completion condition configured
  • Testing with actual phone (not browser)
Solutions:
  • Enable DTMF Input Capture toggle
  • Set variable name
  • Add termination key or digit limit

Next Steps

Variables System

Learn more about the variable system

DTMF Features

Deep dive into DTMF input capture

API Integration

Send collected data to your systems

Call Routing

Route calls based on collected data