voice-agents
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVoice Agents
语音Agent
Overview
概述
Create ElevenLabs Conversational AI voice agents for client discovery, feedback, and check-in calls. Automatically generates agent configuration from client context.
创建用于客户发现、反馈和跟进通话的ElevenLabs对话式AI语音Agent。可根据客户上下文自动生成Agent配置。
Quick Decision Tree
快速决策树
What type of agent?
│
├── Discovery agent (interview clients)
│ └── --scope discovery
│
├── Feedback agent (post-project)
│ └── --scope feedback
│
├── Check-in agent (relationship)
│ └── --scope check-in
│
├── Qualification agent (leads)
│ └── --scope qualification
│
└── Onboarding agent (new contacts)
└── --scope onboardingWhat type of agent?
│
├── Discovery agent (interview clients)
│ └── --scope discovery
│
├── Feedback agent (post-project)
│ └── --scope feedback
│
├── Check-in agent (relationship)
│ └── --scope check-in
│
├── Qualification agent (leads)
│ └── --scope qualification
│
└── Onboarding agent (new contacts)
└── --scope onboardingEnvironment Setup
环境配置
bash
undefinedbash
undefinedRequired in .env
Required in .env
ELEVENLABS_API_KEY=your_api_key
OPENROUTER_API_KEY=your_api_key # For prompt generation
undefinedELEVENLABS_API_KEY=your_api_key
OPENROUTER_API_KEY=your_api_key # For prompt generation
undefinedCommon Usage
常见用法
Create Discovery Agent
创建发现Agent
bash
python scripts/create_voice_agent.py "Microsoft" --scope discovery --notes "CRM migration project"bash
python scripts/create_voice_agent.py "Microsoft" --scope discovery --notes "CRM migration project"Create Feedback Agent
创建反馈Agent
bash
python scripts/create_voice_agent.py "Acme Corp" --scope feedback --notes "Post-project review"bash
python scripts/create_voice_agent.py "Acme Corp" --scope feedback --notes "Post-project review"Dry Run (Preview)
试运行(预览)
bash
python scripts/create_voice_agent.py "Test Company" --scope discovery --notes "Testing" --dry-runbash
python scripts/create_voice_agent.py "Test Company" --scope discovery --notes "Testing" --dry-runScope Types
范围类型
| Scope | Purpose |
|---|---|
| Interview client team about operations, pain points, tech stack |
| Gather feedback on completed project |
| Periodic relationship check-ins |
| Qualify inbound leads before sales |
| Guide new contacts through info gathering |
| 范围 | 用途 |
|---|---|
| 采访客户团队,了解其业务运营、痛点及技术栈 |
| 收集已完成项目的反馈 |
| 定期进行客户关系跟进 |
| 在销售前筛选潜在客户 |
| 引导新联系人完成信息收集 |
Generated Agent Config
生成的Agent配置
The script generates:
脚本会生成以下内容:
Agent Name
Agent名称
[{Company Name}] {Scope} Agent v1[{Company Name}] {Scope} Agent v1First Message
初始消息
Voice-optimized greeting that:
- Introduces as calling on behalf of Casper Studios
- Confirms speaking with right person
- States purpose aligned with scope
- Sets time expectations (10-15 minutes)
- Asks for confirmation
优化后的语音问候语,包含:
- 表明代表Casper Studios致电
- 确认通话对象是否正确
- 说明与当前范围匹配的通话目的
- 告知预计时长(10-15分钟)
- 请求对方确认
System Prompt
系统提示词
Comprehensive conversation guide with:
- Identity and context
- Tone and communication style
- Conversation flow (5-7 stages)
- Interviewing techniques
- Guardrails and boundaries
全面的对话指南,包含:
- 身份与上下文信息
- 语气与沟通风格
- 对话流程(5-7个阶段)
- 访谈技巧
- 对话边界与约束规则
Output
输出
json
{
"agent_id": "abc123xyz",
"agent_name": "[Microsoft] Discovery Agent v1",
"agent_url": "https://elevenlabs.io/app/conversational-ai/agents/abc123xyz",
"first_message": "Hi there! This is an AI assistant...",
"company_name": "Microsoft",
"scope": "discovery"
}json
{
"agent_id": "abc123xyz",
"agent_name": "[Microsoft] Discovery Agent v1",
"agent_url": "https://elevenlabs.io/app/conversational-ai/agents/abc123xyz",
"first_message": "Hi there! This is an AI assistant...",
"company_name": "Microsoft",
"scope": "discovery"
}Context Enrichment
上下文增强
The script optionally fetches context from Google Drive:
- Client's "Research" document
- Previous meeting transcripts (intro calls)
If not available, generates with provided notes only.
脚本可选择性地从Google Drive获取上下文信息:
- 客户的“研究”文档
- 过往会议记录(首次通话)
若无法获取上述内容,则仅使用提供的备注生成配置。
Cost
成本说明
| Service | Cost |
|---|---|
| OpenRouter (prompt generation) | ~$0.01-0.03 |
| ElevenLabs agent creation | Free |
| Google Drive | Free |
| 服务 | 成本 |
|---|---|
| OpenRouter(提示词生成) | 约0.01-0.03美元 |
| ElevenLabs Agent创建 | 免费 |
| Google Drive | 免费 |
Security Notes
安全注意事项
Credential Handling
凭证管理
- Store in
ELEVENLABS_API_KEYfile (never commit to git).env - Store in
OPENROUTER_API_KEYfile (never commit to git).env - Regenerate keys from respective dashboards if compromised
- Never log or print API keys in script output
- 将存储在
ELEVENLABS_API_KEY文件中(切勿提交至git).env - 将存储在
OPENROUTER_API_KEY文件中(切勿提交至git).env - 若凭证泄露,从对应控制台重新生成密钥
- 切勿在脚本输出中记录或打印API密钥
Data Privacy
数据隐私
- Voice agents conduct live conversations with customers
- Call content may include sensitive business discussions
- Agent prompts may contain internal business context
- Conversation logs are stored by ElevenLabs
- Client context from Google Drive may be included in prompts
- 语音Agent会与客户进行实时对话
- 通话内容可能包含敏感业务讨论
- Agent提示词可能包含内部业务上下文
- 对话日志由ElevenLabs存储
- 来自Google Drive的客户上下文可能会被包含在提示词中
Access Scopes
访问权限范围
- - Full access to voice agent creation/management
ELEVENLABS_API_KEY - - AI model access for prompt generation
OPENROUTER_API_KEY - Google OAuth - Optional, for client context enrichment
- - 拥有语音Agent创建/管理的完整权限
ELEVENLABS_API_KEY - - 用于访问AI模型生成提示词
OPENROUTER_API_KEY - Google OAuth - 可选,用于客户上下文增强
Compliance Considerations
合规性考量
- Recording Consent: Inform callers that conversations may be recorded
- AI Disclosure: Disclose that caller is speaking with an AI agent
- Caller Privacy: Conversation data is processed by ElevenLabs servers
- GDPR: EU caller conversations require appropriate consent
- TCPA/CCPA: Comply with applicable telecommunications regulations
- Call Recording Laws: Recording laws vary by jurisdiction (one-party vs two-party consent)
- Data Retention: Review ElevenLabs data retention policies
- Agent Guardrails: Ensure agents have appropriate conversation boundaries
- 录音同意:告知通话者对话可能会被录音
- AI披露:向通话者说明其正在与AI Agent对话
- 通话者隐私:对话数据由ElevenLabs服务器处理
- GDPR:与欧盟通话者的对话需获得适当同意
- TCPA/CCPA:遵守适用的电信法规
- 录音法律:录音法律因司法管辖区而异(单方同意vs双方同意)
- 数据保留:查阅ElevenLabs的数据保留政策
- Agent约束规则:确保Agent具备适当的对话边界
Troubleshooting
故障排除
Common Issues
常见问题
Issue: Agent creation failed
问题:Agent创建失败
Symptoms: API error when creating voice agent
Cause: Invalid configuration, missing fields, or API issue
Solution:
- Validate agent config JSON format
- Ensure all required fields are present (name, first_message, system_prompt)
- Check prompt length doesn't exceed limits
- Review ElevenLabs API documentation for requirements
症状:创建语音Agent时出现API错误
原因:配置无效、字段缺失或API问题
解决方案:
- 验证Agent配置的JSON格式
- 确保所有必填字段(名称、first_message、system_prompt)均已填写
- 检查提示词长度是否超出限制
- 查阅ElevenLabs API文档了解要求
Issue: Invalid voice ID
问题:无效的语音ID
Symptoms: "Voice not found" or "invalid voice_id" error
Cause: Voice ID doesn't exist or not accessible
Solution:
- Use valid ElevenLabs voice ID from your library
- Check voice availability at https://elevenlabs.io/app/voice-library
- Verify voice is not a custom voice from another account
- Use default voice if custom voice unavailable
症状:出现“Voice not found”或“invalid voice_id”错误
原因:语音ID不存在或无法访问
解决方案:
- 使用您库中有效的ElevenLabs语音ID
- 访问https://elevenlabs.io/app/voice-library检查语音可用性
- 确认该语音并非来自其他账户的自定义语音
- 若自定义语音不可用,使用默认语音
Issue: API quota exceeded
问题:API配额超出
Symptoms: "Quota exceeded" or rate limit error
Cause: ElevenLabs subscription limits reached
Solution:
- Check usage at https://elevenlabs.io/app/subscription
- Upgrade subscription tier for more capacity
- Reduce number of concurrent agents
- Delete unused agents to free up slots
症状:出现“Quota exceeded”或速率限制错误
原因:已达到ElevenLabs订阅限制
解决方案:
- 访问https://elevenlabs.io/app/subscription查看使用情况
- 升级订阅套餐以获得更多容量
- 减少并发Agent的数量
- 删除未使用的Agent以释放名额
Issue: Agent not responding in calls
问题:Agent在通话中无响应
Symptoms: Agent created but doesn't respond in conversations
Cause: System prompt issues, webhook configuration, or service issue
Solution:
- Test agent directly in ElevenLabs console first
- Review system prompt for clear instructions
- Check webhook URL is accessible (if configured)
- Verify ElevenLabs service status
症状:Agent已创建,但在对话中不响应
原因:系统提示词问题、Webhook配置错误或服务故障
解决方案:
- 先在ElevenLabs控制台中直接测试Agent
- 检查系统提示词是否包含清晰的指令
- 确认Webhook URL可访问(若已配置)
- 验证ElevenLabs服务状态
Issue: OpenRouter prompt generation failed
问题:OpenRouter提示词生成失败
Symptoms: Error generating agent prompt
Cause: OpenRouter API issue or invalid model
Solution:
- Verify is set correctly
OPENROUTER_API_KEY - Check model availability at OpenRouter
- Try a different model if current one unavailable
- Run with to test without API calls
--dry-run
症状:生成Agent提示词时出错
原因:OpenRouter API问题或模型无效
解决方案:
- 验证是否设置正确
OPENROUTER_API_KEY - 检查OpenRouter上的模型可用性
- 若当前模型不可用,尝试其他模型
- 使用参数运行,无需调用API即可测试
--dry-run
Issue: Google Drive context not loading
问题:Google Drive上下文无法加载
Symptoms: Agent created without client context
Cause: OAuth issue or client folder not found
Solution:
- Verify Google OAuth credentials (see google-workspace skill)
- Check client folder exists in expected location
- Provide context via flag as alternative
--notes - Run without context enrichment first to isolate issue
症状:创建的Agent未包含客户上下文
原因:OAuth问题或未找到客户文件夹
解决方案:
- 验证Google OAuth凭证(参考google-workspace技能)
- 检查客户文件夹是否位于预期位置
- 使用参数提供上下文作为替代方案
--notes - 先不启用上下文增强,排查问题
Resources
资源
- references/elevenlabs.md - ElevenLabs API details
- references/elevenlabs.md - ElevenLabs API详细说明
Integration Patterns
集成模式
Context-Aware Agents
上下文感知Agent
Skills: transcript-search → voice-agents
Use case: Create voice agents with client history
Flow:
- Search transcript-search for past client meetings
- Extract relationship history, pain points, and preferences
- Include context in voice agent system prompt for personalized conversations
技能:transcript-search → voice-agents
使用场景:创建包含客户历史记录的语音Agent
流程:
- 使用transcript-search搜索过往客户会议记录
- 提取关系历史、痛点及偏好
- 将上下文包含在语音Agent的系统提示词中,实现个性化对话
Agent Notes to CRM
Agent通话记录同步至CRM
Skills: voice-agents → attio-crm
Use case: Log voice agent call summaries
Flow:
- Voice agent completes discovery or feedback call
- Extract call summary, insights, and action items
- Create note on Attio company record with call details
技能:voice-agents → attio-crm
使用场景:记录语音Agent的通话摘要
流程:
- 语音Agent完成发现或反馈通话
- 提取通话摘要、见解及行动项
- 在Attio的公司记录中创建包含通话详情的笔记
Research-Enriched Agents
研究增强型Agent
Skills: parallel-research → voice-agents
Use case: Arm voice agents with company intelligence
Flow:
- Run parallel-research on target company
- Extract recent news, funding, tech stack, and pain points
- Include research in agent prompt for informed conversations
技能:parallel-research → voice-agents
使用场景:为语音Agent配备企业情报
流程:
- 对目标公司运行parallel-research
- 提取近期新闻、融资情况、技术栈及痛点
- 将研究内容包含在Agent提示词中,实现更具信息量的对话