Skip to main content

Creating an Agent

Agents are the core of Truedy - they handle conversations and interact with users. This guide shows you how to create and configure agents.

Basic Agent Creation

Create a simple agent:
curl -X POST https://api.truedy.ai/api/public/v1/agents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Agent",
    "description": "Handles customer support inquiries",
    "voice_id": "VOICE_UUID",
    "system_prompt": "You are a helpful customer support agent. Be friendly and professional.",
    "model": "ultravox-v0.6"
  }'

Advanced Configuration

Adding Tools

Connect your agent to external APIs:
{
  "name": "Sales Agent",
  "voice_id": "VOICE_UUID",
  "system_prompt": "You are a sales agent...",
  "tools": ["tool-uuid-1", "tool-uuid-2"]
}

Adding Knowledge Bases

Give your agent access to documents:
{
  "name": "Support Agent",
  "voice_id": "VOICE_UUID",
  "system_prompt": "You are a support agent...",
  "knowledge_bases": ["kb-uuid-1"]
}

Configuring Call Settings

Customize call behavior:
{
  "name": "Sales Agent",
  "voice_id": "VOICE_UUID",
  "system_prompt": "You are a sales agent...",
  "recording_enabled": true,
  "temperature": 0.7,
  "language_hint": "en-US"
}

System Prompts

The system prompt defines your agent’s personality and behavior. Tips:
  • Be Specific: Clearly define the agent’s role and responsibilities
  • Set Boundaries: Specify what the agent should and shouldn’t do
  • Include Examples: Provide example interactions
  • Define Tone: Specify the communication style

Example Prompts

Customer Support:
You are a helpful customer support agent. Your goal is to resolve customer issues quickly and professionally. Always be polite and empathetic. If you cannot resolve an issue, escalate to a human agent.
Sales:
You are a sales agent focused on understanding customer needs and recommending appropriate products. Be consultative, not pushy. Ask questions to understand requirements before making recommendations.
Appointment Booking:
You are an appointment booking assistant. Your goal is to schedule appointments efficiently. Confirm all details (date, time, service type) before finalizing. Be friendly and clear.

Best Practices

Start Simple

Begin with a basic agent, then add complexity as needed

Test Thoroughly

Use test calls to verify agent behavior before production

Iterate on Prompts

Refine system prompts based on real conversations

Monitor Performance

Track call outcomes and adjust agent configuration

Next Steps