AI Features
Unlock powerful automation by connecting your own AI provider.
Table of contents
- Overview
- Supported Providers
- Configuration
- AI Survey Generation
- Question Optimization
- Response Analysis
- Translation
- Cost Optimization
- Rate Limits
- Privacy Considerations
- Troubleshooting
- 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 |
| 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
- Go to Settings → AI Configuration
- Select your preferred provider
- Enter your API key
- Test the connection
- Save settings
AI Survey Generation
Generate complete surveys from plain English descriptions.
Quick Generate
- Navigate to Surveys → Create Survey with AI
- Select Quick Generate
- 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.
- Set question count (5-30)
- Click Generate
Guided Wizard
For more control:
- Select Guided Wizard
- Have a conversation with AI to refine your survey
- Iterate on questions and structure
- 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
- Open a survey in the editor
- Click the AI Optimize button
- Review suggestions
- 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:
- Open survey analytics
- Click Generate AI Summary
- 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
- Open survey settings
- Click Add Language
- Select target language
- Choose AI Translate or manual translation
- 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:
- Data Processing — Survey responses are sent to AI providers
- Data Retention — Check provider policies on data retention
- Compliance — Ensure AI usage complies with your data policies
- 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”
- Check key format matches provider
- Verify key has required permissions
- Ensure key hasn’t expired
“Rate Limit Exceeded”
- Wait and retry
- Reduce batch size
- Upgrade your API plan
“Model Not Available”
- Check model name spelling
- Verify model is available in your region
- Try an alternative model
API Reference
See the AI API Documentation for complete endpoint details.