Voice AI & Conversational AgentsPlatforms and stacks · Lesson 4 of 17

Building an agent with ElevenAgents

Article · 18 min · 9 min lecture

Video lecture

Building an agent with ElevenAgents

13 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 13

Building with ElevenAgents

  • Formerly 'Conversational AI'
  • Agent, voice, turn-taking, tools, knowledge
  • Workflows, tests, analysis
  • Create via API

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

What ElevenAgents gives you

ElevenAgents is ElevenLabs' platform for voice and chat agents (it was previously called "Conversational AI", and some API paths still use convai). It bundles the whole cascade: speech recognition, a choice of LLMs (from several providers, or your own via a custom LLM endpoint), ElevenLabs TTS voices, turn-taking, tools, a knowledge base with retrieval, workflows, testing, analytics and deployment to web, mobile, phone (Twilio, SIP trunking), WhatsApp and other channels. Features evolve quickly; check the docs for current names and limits.

The core configuration

AreaWhat you set
AgentSystem prompt, first message, default language, LLM choice and parameters (temperature, max tokens), dynamic variables
Voice (TTS)Voice, conversational TTS model, stability/speed/similarity, pronunciation dictionaries
Turn-takingTurn timeout, eagerness (patient/normal/eager), silence end-call timeout, interruption behavior
ToolsServer (webhook) tools, client tools, MCP servers, and system tools such as end call, language detection, transfer to another agent, transfer to a phone number, skip turn, play keypad tones (DTMF) and voicemail detection
Knowledge baseUpload documents, URLs or text; enable retrieval (RAG) so the agent pulls relevant chunks instead of stuffing everything into the prompt
AnalysisEvaluation criteria (did the call achieve its goal?) and data collection fields (extract structured values from each conversation)
Security and privacyAuthentication for widgets, allowlists, overrides, data retention, guardrails

Dynamic variables

Variables in double curly braces, like {{customer_name}} or {{clinic_branch}}, are filled at conversation start (for example from your CRM when placing an outbound call) or updated by tool responses. System variables such as the current time and caller ID are also available. Use them to personalize without rewriting prompts.

Tools: the three kinds you will use most

  • Server tools (webhooks): the platform calls your HTTPS endpoint with parameters the LLM extracts (for example check_availability(date, service)). You describe the tool and its JSON parameters; your server does the work and returns JSON. You can control whether the agent speaks before the tool runs ("pre-tool speech"), timeouts, and whether callers can interrupt during the tool.
  • Client tools: trigger actions in the user's app or web page (show a calendar, open a product page).
  • System tools: built-in behaviors such as ending the call, detecting language, transferring to a human number or another agent, and detecting voicemail.

Workflows and multi-agent handoffs

For complex calls, split responsibilities: a triage agent that transfers to a booking agent or a billing agent, or a visual workflow with nodes and conditions. Smaller, focused prompts are easier to test and usually more reliable than one giant prompt.

Testing and analysis

ElevenAgents supports automated tests: response tests (does the agent's reply meet a success condition?), tool-call tests (did it call the right tool with the right parameters?) and simulation tests where a simulated caller with a scenario and persona talks to your agent for several turns and is judged against success conditions, with the option to mock tools. After launch, evaluation criteria and data collection run on every conversation, and a post-call webhook can send transcripts and results to your systems (verify the signature with your webhook secret).

Worked example: "Aria" for Nova Dental (Dubai and London)

  • Agent: first message "Hi, this is Aria, Nova Dental's virtual assistant. I can book, move or cancel appointments. How can I help?" Language English with Arabic available.
  • Voice: designed calm voice; Flash model; slightly slow speed.
  • Tools: check_availability, book_appointment, cancel_appointment (webhooks); system tools: transfer to reception number, end call, language detection.
  • Knowledge base: opening hours, services, price list, preparation instructions, cancellation policy.
  • Guardrails in prompt: never give clinical advice; emergencies go to emergency services wording; always confirm date, time and branch before booking.
  • Evaluation criteria: "appointment_booked_or_changed", "no_clinical_advice", "correct_disclosure". Data collection: service requested, branch, new-patient flag.

Hands-on: create a webhook tool and an agent via the API

import os, requests

API = "https://api.elevenlabs.io/v1/convai"
HEADERS = {"xi-api-key": os.environ["ELEVENLABS_API_KEY"], "Content-Type": "application/json"}

tool = {
  "tool_config": {
    "type": "webhook",
    "name": "check_availability",
    "description": "Check free appointment slots for a service at a branch on a given date. Use before offering times.",
    "api_schema": {
      "url": os.environ["BOOKING_API_URL"] + "/availability",
      "method": "POST",
      "request_body_schema": {
        "type": "object",
        "properties": {
          "date": {"type": "string", "description": "Requested date in YYYY-MM-DD"},
          "service": {"type": "string", "description": "Service name, e.g. cleaning, check-up"},
          "branch": {"type": "string", "description": "Branch: dubai-marina or london-soho"}
        },
        "required": ["date", "service", "branch"]
      }
    }
  }
}
r = requests.post(f"{API}/tools", json=tool, headers=HEADERS, timeout=30)
r.raise_for_status()
tool_id = r.json()["id"]

agent = {
  "name": "Aria - Nova Dental",
  "conversation_config": {
    "agent": {
      "first_message": "Hi, this is Aria, Nova Dental's virtual assistant. How can I help today?",
      "language": "en",
      "prompt": {
        "prompt": open("aria_system_prompt.md", encoding="utf-8").read(),
        "llm": os.environ.get("AGENT_LLM", "gemini-2.5-flash"),
        "temperature": 0.3,
        "tool_ids": [tool_id]
      }
    },
    "tts": {"voice_id": os.environ["BRAND_VOICE_ID"], "model_id": "eleven_flash_v2_5"},
    "turn": {"turn_eagerness": "normal"}
  },
  "platform_settings": {
    "evaluation": {"criteria": [
      {"id": "booked", "name": "Appointment booked or changed",
       "conversation_goal_prompt": "Did the agent successfully book, move or cancel an appointment the caller asked for?"}
    ]},
    "data_collection": {
      "service": {"type": "string", "description": "The dental service the caller wanted"}
    }
  }
}
r = requests.post(f"{API}/agents/create", json=agent, headers=HEADERS, timeout=30)
r.raise_for_status()
print("agent_id:", r.json()["agent_id"])

The field names above follow the public API at the time of writing; confirm against the current API reference, and choose the LLM from the platform's supported list. Many teams configure agents in the dashboard first, then export and version the configuration.

Pitfalls

  • One giant prompt that tries to handle every scenario; split into focused agents or workflow nodes.
  • Stuffing the whole price list into the prompt instead of the knowledge base.
  • Launching without tests or evaluation criteria, so you cannot tell whether changes help or hurt.

Key takeaways

  • ElevenAgents (formerly Conversational AI) bundles ASR, LLM choice, TTS, turn-taking, tools, knowledge base, workflows, tests and analytics across web, phone and messaging channels.
  • Dynamic variables personalize conversations from CRM data or tool results without rewriting prompts.
  • Use webhook tools for actions, system tools for transfers, end call, language detection and voicemail, and the knowledge base for reference content.
  • Write response, tool-call and simulation tests and define evaluation criteria and data collection before launch.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. Where should a clinic's full price list and policies live in an ElevenAgents setup?
  2. Which tool type should transfer a caller to the human reception number?
  3. What does a simulation test do?

Put it into practice

Create one webhook tool and one agent (via API or dashboard) for a booking use case. Before any test call, write three simulation tests with clear success conditions.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.