AI Features

Unlock powerful automation by connecting your own AI provider.

Table of contents

  1. Overview
  2. Supported Providers
  3. Configuration
    1. Setting API Keys
    2. In-App Configuration
  4. AI Survey Generation
    1. Quick Generate
    2. Guided Wizard
    3. API Usage
  5. Question Optimization
    1. Using Optimization
  6. Response Analysis
    1. Sentiment Analysis
    2. Theme Extraction
    3. Smart Summaries
  7. Translation
    1. Supported Languages
    2. Using Translation
  8. Cost Optimization
    1. Choose the Right Model
    2. Batch Processing
    3. Caching
  9. Rate Limits
  10. Privacy Considerations
    1. GDPR Compliance
  11. Troubleshooting
    1. “API Key Invalid”
    2. “Rate Limit Exceeded”
    3. “Model Not Available”
  12. API Reference

Overview

PulseGen’s AI features let you:

  • Generate surveys from natural language descriptions
  • Optimize questions for clarity and engagement
  • Analyze responses with sentiment detection and theme extraction
  • Translate surveys to 12+ languages instantly

AI features are optional. PulseGen works perfectly without them—add AI when you’re ready.


Supported Providers

Provider Models Best For
OpenAI GPT-4, GPT-4 Turbo, GPT-3.5 General use, fast responses
Anthropic Claude 3.5 Sonnet, Claude 3 Opus Long-form analysis, nuanced responses
Google Gemini Pro, Gemini Ultra Multi-modal, cost-effective
Azure OpenAI GPT-4, GPT-3.5 Enterprise compliance

Configuration

Setting API Keys

Add your API keys to the .env file:

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Google AI
GOOGLE_AI_API_KEY=AIza...

# Azure OpenAI
AZURE_OPENAI_API_KEY=...
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=gpt-4

Keep API keys secure. Never commit them to version control.

In-App Configuration

  1. Go to SettingsAI Configuration
  2. Select your preferred provider
  3. Enter your API key
  4. Test the connection
  5. Save settings

AI Survey Generation

Generate complete surveys from plain English descriptions.

Quick Generate

  1. Navigate to SurveysCreate Survey with AI
  2. Select Quick Generate
  3. Describe your survey:
    1
    2
    3
    
    Create a customer satisfaction survey for an e-commerce store.
    Include questions about product quality, shipping speed,
    customer service, and likelihood to recommend.
    
  4. Set question count (5-30)
  5. Click Generate

Guided Wizard

For more control:

  1. Select Guided Wizard
  2. Have a conversation with AI to refine your survey
  3. Iterate on questions and structure
  4. Preview and edit before saving

API Usage

1
2
3
4
5
6
7
8
curl -X POST http://localhost:5001/api/ai/generate-survey \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Customer feedback survey for a SaaS product",
    "questionCount": 10,
    "provider": "anthropic"
  }'

Question Optimization

AI reviews your questions for:

  • Clarity — Ambiguous wording
  • Bias — Leading questions
  • Length — Questions that are too long
  • Engagement — Ways to improve response rates

Using Optimization

  1. Open a survey in the editor
  2. Click the AI Optimize button
  3. Review suggestions
  4. Accept or reject each recommendation

Response Analysis

Sentiment Analysis

Automatically detect emotional tone in open-ended responses:

  • Positive — Satisfied customers
  • Negative — Issues to address
  • Neutral — Factual feedback
  • Mixed — Complex responses

Theme Extraction

Identify common themes across responses:

1
2
3
4
5
6
7
{
  "themes": [
    { "name": "Shipping Speed", "count": 45, "sentiment": "negative" },
    { "name": "Product Quality", "count": 38, "sentiment": "positive" },
    { "name": "Customer Service", "count": 22, "sentiment": "mixed" }
  ]
}

Smart Summaries

Get AI-generated summaries of survey results:

  1. Open survey analytics
  2. Click Generate AI Summary
  3. Review insights and recommendations

Translation

Translate surveys to multiple languages while preserving meaning and context.

Supported Languages

  • English, Spanish, French, German, Italian
  • Portuguese, Dutch, Polish, Russian
  • Chinese (Simplified/Traditional), Japanese, Korean
  • Arabic, Hebrew (RTL support)

Using Translation

  1. Open survey settings
  2. Click Add Language
  3. Select target language
  4. Choose AI Translate or manual translation
  5. Review and publish

Cost Optimization

Use these strategies to minimize API costs.

Choose the Right Model

Task Recommended Model
Survey generation GPT-4 / Claude 3.5 Sonnet
Question optimization GPT-3.5 / Claude 3 Haiku
Sentiment analysis GPT-3.5 / Gemini Pro
Translation GPT-4 / Claude 3.5 Sonnet

Batch Processing

Process multiple responses together instead of individually:

# Enable batch mode for analysis
AI_BATCH_SIZE=50
AI_BATCH_DELAY_MS=1000

Caching

Enable response caching to avoid duplicate API calls:

AI_CACHE_ENABLED=true
AI_CACHE_TTL_SECONDS=3600

Rate Limits

PulseGen respects provider rate limits:

Provider Requests/min Tokens/min
OpenAI 60 90,000
Anthropic 60 100,000
Google AI 60 120,000

Limits vary by plan. Check your provider’s documentation.


Privacy Considerations

When using AI features:

  1. Data Processing — Survey responses are sent to AI providers
  2. Data Retention — Check provider policies on data retention
  3. Compliance — Ensure AI usage complies with your data policies
  4. Opt-out — Users can disable AI features per survey

GDPR Compliance

For GDPR compliance:

# Anonymize responses before AI processing
AI_ANONYMIZE_PII=true

# Use EU-based endpoints where available
AZURE_OPENAI_ENDPOINT=https://your-eu-resource.openai.azure.com

Troubleshooting

“API Key Invalid”

  1. Check key format matches provider
  2. Verify key has required permissions
  3. Ensure key hasn’t expired

“Rate Limit Exceeded”

  1. Wait and retry
  2. Reduce batch size
  3. Upgrade your API plan

“Model Not Available”

  1. Check model name spelling
  2. Verify model is available in your region
  3. Try an alternative model

API Reference

See the AI API Documentation for complete endpoint details.