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:- User speaks naturally
- AI identifies and extracts specific data
- Data stored in variables
- Available for use throughout the flow
- Names, addresses, email addresses
- Dates and times (flexible formats)
- Free-form descriptions
- Complex multi-field responses
- Natural conversation flow
- Natural user experience
- Flexible input formats
- Handles variations well
- No learning curve for users
- Potential transcription errors
- Format inconsistencies
- Requires validation
- May need clarification
2. DTMF Input Capture
Collect precise numeric data via keypad. How It Works:- Agent prompts for numeric input
- User enters digits on keypad
- System captures key presses
- Stores in variable
- Account numbers
- Phone numbers
- ZIP codes
- PINs and passwords
- Social security numbers (last 4 digits)
- Confirmation codes
- Numeric IDs
- 100% accurate (no transcription errors)
- Works in noisy environments
- Familiar to users
- Secure for sensitive data
- 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:- Ask focused, single questions
- Extract one piece of information
- Confirm understanding
- Move to next question
- Multi-step forms
- Complex data collection
- Situations requiring validation
- When precision matters
- Clear expectations
- Easy to validate
- Reduces errors
- Good user experience
- Takes more time
- Multiple conversational turns
- Can feel rigid
- Requires good flow design
Variable System
Defining Variables
Choose Variable Type
Extracted Variables: Collected during conversation
Custom Variables: Passed via API when call starts
System Variables: Built-in (time, caller ID, etc.)
Configure Extraction
Provide clear extraction instructions:
- What to extract
- Expected format
- Examples if helpful
Variable Naming Best Practices
Good Names:Extraction Instructions
Clear Instructions: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: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: ConfirmationAmbiguous 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:Using Collected Data
In Prompts:Best Practices
Ask One Question at a Time
Don’t overwhelm users with multiple questions
Confirm Critical Data
Always confirm important information like emails, addresses
Use Appropriate Method
DTMF for numbers, NL for text, prompting for precision
Validate Early
Check format and validity immediately after collection
Provide Examples
Show users what format you expect
Handle Errors Gracefully
Give clear guidance when collection fails
Skip When Possible
Don’t ask for data you already have
Explain Why
Tell users why you need their information
Troubleshooting
Variable Not Extracting
Variable Not Extracting
Check:
- Extraction instructions are clear
- User actually provided the information
- Variable name is correct (snake_case)
- Extraction is enabled on the node
- Make instructions more specific
- Add examples to instructions
- Ask more directly for the information
Wrong Data Extracted
Wrong Data Extracted
Check:
- Transcription accuracy
- Extraction instructions specificity
- User response clarity
- Add format specifications to instructions
- Confirm what was heard
- Use DTMF for critical data
DTMF Not Capturing
DTMF Not Capturing
Check:
- DTMF Input Capture is enabled
- Variable name is set
- At least one completion condition configured
- Testing with actual phone (not browser)
- Enable DTMF Input Capture toggle
- Set variable name
- Add termination key or digit limit