Agentic Response Generation¶
This document describes the Campaign Simulation feature that uses AI agents to generate synthetic survey responses based on persona profiles, enabling testing of hypothetical campaigns before real deployment.
Overview¶
Campaign Simulation allows users to test hypothetical campaign scenarios with synthetic data. AI agents complete surveys as virtual respondents, generating realistic responses based on demographic profiles and behavioral traits.
Use Cases¶
- Validate questionnaire flow and logic before real deployment
- Test data analysis pipelines with realistic synthetic data
- Train interviewers with simulated survey sessions
- Estimate resource requirements for campaign execution
- Generate demo data for stakeholder presentations
Simulation Modes¶
1. Single Survey Simulation¶
Test a single survey completion with a specific persona.
Input:
- Questionnaire to test
- Persona profile (demographics, behavioral traits)
Output:
- Completed survey with realistic responses
- Response patterns matching persona characteristics
Example:
User: "Complete the customer satisfaction survey as a young professional"
AI: Completing survey as Young Professional persona...
Q1: Age group → "25-34"
Q2: Employment → "Full-time"
Q3: Overall satisfaction → 4/5 (Satisfied)
Q4: Most valued feature → "Mobile app" (tech-savvy preference)
Q5: Improvement suggestion → "Faster checkout process"
(brief, time-conscious response)
Survey completed in simulated 3m 42s
2. Campaign Simulation (Three-Phase)¶
Simulate a complete campaign lifecycle with multiple respondents.
flowchart LR
subgraph phase1["Phase 1: Preparation"]
p1a[Create Project] --> p1b[Create Campaign]
p1b --> p1c[Generate Respondents]
p1c --> p1d[Create Strategy & Pool]
p1d --> p1e[Bulk Create Surveys]
end
subgraph phase2["Phase 2: Execution"]
p2a[Assign Personas] --> p2b[Complete Surveys]
p2b --> p2c[Handle Branching]
end
subgraph phase3["Phase 3: Analysis"]
p3a[Create Bronze Dataset] --> p3b[Apply Raking]
p3b --> p3c[Export Data]
end
phase1 --> phase2
phase2 --> phase3
Phase 1: Preparation¶
- Creates project, questionnaire, campaign
- Generates synthetic respondents with realistic demographics
- Creates sampling strategy and respondent pool
- Bulk creates surveys for all respondents
Phase 2: Execution¶
- Completes surveys using persona-based response generation
- Simulates realistic response patterns based on demographics
- Handles questionnaire branching and skip logic
Phase 3: Analysis¶
- Extracts responses into Bronze dataset
- Applies post-stratification weighting (raking)
- Creates Silver/Gold datasets
- Exports in multiple formats (CSV, XLSX, SPSS, Parquet)
Persona Profiles¶
Personas define the characteristics that guide synthetic response generation. Each persona has demographic attributes and behavioral traits that influence how they answer questions.
Built-in Profiles¶
| Profile | Demographics | Response Characteristics |
|---|---|---|
| Young Professional | Age 25-35, single, employed, $50-80k income | Tech-savvy, time-conscious, brief responses |
| Family Oriented | Age 30-50, married, children, suburban | Family-focused decisions, detailed responses |
| Retired Senior | Age 65+, retired, fixed income | Traditional values, thorough responses |
| High Earner | Age 35-55, high income (>$100k) | Quality-focused, premium preferences |
| Random | Varied demographics | Unpredictable response patterns |
Profile Structure¶
Each persona profile is defined with:
name: Young Professional
description: Young adult professional, tech-savvy and time-conscious
demographics:
age_range: 25-35
gender: any
marital_status: single
employment: full-time professional
income: $50,000 - $80,000
education: bachelor's degree
location: urban/suburban
behavioral_traits:
- tech-savvy
- time-conscious
- values convenience
- early adopter
response_style:
verbosity: brief
decision_speed: quick
detail_level: moderate
Custom Profiles¶
Users can create custom personas for specific research needs:
User: "Create a persona for budget-conscious students"
AI: Creating custom persona: Budget Student
Demographics:
- Age: 18-24
- Employment: Part-time or student
- Income: < $25,000
- Education: Currently enrolled
- Location: University town
Behavioral Traits:
- Price-sensitive
- Social media active
- Peer-influenced decisions
- Values free trials/samples
Response Style:
- Casual language
- Quick decisions
- Strong opinions on value
Save this persona for future simulations?
Response Generation¶
How It Works¶
The Respondent agent receives:
- Current question from the survey flow
- Available options for the question type
- Persona profile with demographics and traits
- Previous responses for consistency
The agent then selects a response that:
- Matches the persona's demographic profile
- Aligns with behavioral traits
- Maintains consistency with prior answers
- Follows realistic response patterns
Response Guidelines¶
The agent follows these principles:
- Demographic consistency - Age, income, employment answers match profile
- Behavioral alignment - Preferences reflect persona traits
- Natural variation - Don't always pick first option or extremes
- Realistic timing - Simulate thoughtful consideration
- Skip appropriately - Use "Not applicable" when logical
Example Response Logic¶
Question: "How often do you shop online?"
Persona: Young Professional (tech-savvy, time-conscious)
Agent reasoning:
- Tech-savvy → comfortable with online shopping
- Time-conscious → prefers convenience of online
- Urban professional → likely has delivery infrastructure
Selected response: "Several times a week"
---
Question: "How often do you shop online?"
Persona: Retired Senior (traditional values)
Agent reasoning:
- Traditional → may prefer in-store experience
- Fixed income → shops carefully, less impulsively
- May have concerns about online security
Selected response: "A few times a month"
Simulation Configuration¶
YAML Configuration¶
simulation:
name: "Q1 Satisfaction Test Run"
questionnaire: "customer_satisfaction_nps.qml"
respondents:
count: 100
demographics:
gender_distribution: { male: 0.48, female: 0.50, other: 0.02 }
age_distribution: { "18-24": 0.15, "25-34": 0.25, "35-44": 0.25, "45-54": 0.20, "55+": 0.15 }
personas:
- young_professional: 30%
- family_oriented: 40%
- retired_senior: 20%
- random: 10%
output:
create_bronze: true
apply_raking: true
export_format: "xlsx"
Chat-Based Configuration¶
User: "Run a simulation of the NPS campaign with 50 respondents,
mostly young professionals and families"
AI: Configuring simulation:
Campaign: NPS Customer Satisfaction
Respondents: 50 synthetic profiles
Persona Distribution:
- Young Professional: 40% (20 respondents)
- Family Oriented: 40% (20 respondents)
- Random: 20% (10 respondents)
Demographics will match your sampling strategy targets.
Output:
- Bronze dataset (raw responses)
- Silver dataset (weighted)
- XLSX export
Start simulation?
Simulation Output¶
After simulation completes, users receive:
1. Campaign Summary¶
Simulation Complete: "Q1 Satisfaction Test Run"
Surveys:
- Total: 100
- Completed: 98
- Terminated (screening): 2
Response Statistics:
- Average completion time: 6m 42s
- Questions answered: 1,470
- Skip rate: 8.3%
NPS Results:
- Promoters (9-10): 34%
- Passives (7-8): 41%
- Detractors (0-6): 25%
- NPS Score: +9
2. Data Quality Report¶
Demographic Distribution vs. Targets:
┌─────────────┬──────────┬──────────┬─────────┐
│ Factor │ Target │ Actual │ RMSE │
├─────────────┼──────────┼──────────┼─────────┤
│ Male │ 48% │ 47% │ 0.01 │
│ Female │ 50% │ 51% │ 0.01 │
│ Age 18-24 │ 15% │ 14% │ 0.01 │
│ Age 25-34 │ 25% │ 26% │ 0.01 │
│ Age 35-44 │ 25% │ 24% │ 0.01 │
└─────────────┴──────────┴──────────┴─────────┘
Overall Quality: ✅ Excellent (RMSE: 0.012)
Weighting Efficiency: 94% (Design Effect: 1.06)
3. Exportable Datasets¶
| Dataset | Description | Format |
|---|---|---|
| Bronze | Raw responses as collected | Parquet |
| Silver | Weighted responses (raking applied) | Parquet |
| Gold | Refined, export-ready | CSV, XLSX, SPSS |
Agent Architecture¶
Respondent Agent¶
The Respondent agent is optimized for fast, consistent survey completion:
| Aspect | Configuration |
|---|---|
| Model | Claude Haiku (fast, cost-effective) |
| Max Turns | 100 per survey |
| Context | Persona profile + survey state |
| Tools | Survey flow tools (see MCP Interface) |
Batch Processing¶
For campaign simulation, the system can process multiple surveys:
- Sequential: One survey at a time (default)
- Parallel: Multiple concurrent agents (configurable)
- Batch completion: Use
mass_fill_surveysfor faster synthetic data
Provider Support¶
Simulation works with any configured AI provider:
| Provider | Model | Best For |
|---|---|---|
| Anthropic | Claude Haiku | Default, best balance |
| AWS Bedrock | Claude Instant | High-volume simulation |
| OpenAI | GPT-3.5 Turbo | Alternative provider |
Best Practices¶
When to Use Simulation¶
- Before launching expensive campaigns
- Testing new questionnaire designs
- Training data analysts on the data pipeline
- Validating sampling strategies
- Generating demo data for stakeholder presentations
Simulation Limitations¶
- Not real opinions: Synthetic data reflects persona templates, not actual attitudes
- Consistency vs. variety: Personas may be more consistent than real humans
- Edge cases: Unusual response combinations may be underrepresented
- Open-ended questions: AI-generated text may lack authentic diversity
Recommendations¶
- Use for structure testing - Validate survey flow, not content insights
- Mix personas - Include "random" profile for variety
- Compare to pilots - Validate simulation patterns against small real samples
- Document synthetic data - Clearly label datasets as simulated
Related Documentation¶
- AI-Assisted Campaign Management - Campaign setup and management
- Data Analysis - Bronze/Silver/Gold pipeline
- Campaign Management - Core campaign concepts