elevenlabs_agent
ElevenLabs Agent adds real-time, two-way voice AI to your Drupal 11 site: visitors talk to an ElevenLabs conversational agent, and every finished call becomes a Drupal event your site can act on.
New to this space? ElevenLabs runs the hosted conversational voice agents; this module is the Drupal side that connects to them and handles the secure, fiddly plumbing — minting voice sessions, verifying post-call webhooks, feeding the agent context, and capturing leads — so you can offer a spoken assistant (support, sales, concierge, or a FAQ that answers from your own content) without building any of that yourself.
The core is deliberately plumbing, not policy: it owns the secure parts and dispatches an event so your site decides what each conversation means. It has no dependency on the AI module, and its richer surfaces — a call-to-action block, an audio visualiser, knowledge-base sync, lead capture — are all optional and opt-in.
Features
- Signed-URL session minting — a CSRF-guarded route mints short-lived WebSocket credentials server-side, so your API key never reaches the browser.
- Bindable trigger element (
#type 'elevenlabs_agent_trigger') — start/stop a conversation from any element. Deliberately not a floating widget, so the agent is a chosen affordance, not a nag. - HMAC-validated post-call webhook that dispatches an
ElevenLabsCallCompletedevent with the parsed transcript and analysis — persist a lead, email a summary, update a CRM, without forking the module. - Agent and Conversation entities, an admin test bed to run a call end-to-end, and a remote-agents browser to adopt agents from your ElevenLabs workspace in one click.
- Context signals — a plugin system that feeds per-request
dynamic_variablesto the agent (IP, in-session navigation, your own). - Knowledge Base sync — projector plugins, a queue worker, and drush commands push your site content into the agent's ElevenLabs Knowledge Base so it answers from real site data.
- The FACE — an optional active-channel audio visualiser that reacts to the live conversation on an HTML canvas; theme-tunable via CSS custom properties.
- Call To Action block — a self-contained banner (visualiser, copy, start-call button, first-use mic/sound consent) you can place on any page.
When and why: use it when you want a spoken interface to your site — a website concierge that answers from your own pages, a voice support or sales line, an inbound qualification agent that captures leads, or an accessible spoken way into your content.
Post-Installation
- Go to
/admin/config/services/elevenlabs-agentand enter your ElevenLabs API key and post-call webhook secret. In production, prefer overriding these insettings.phprather than storing them in configuration. - Add an Agent: create one and set its ElevenLabs Agent ID, or use the remote-agents browser to adopt an existing agent from your workspace.
- In the ElevenLabs dashboard, point the post-call webhook at the receiver URL shown on the settings page.
- Place the trigger element or the Call To Action block where the conversation should start.
- Run a call from the admin test bed before going live.
Each conversation is recorded as a Conversation entity for auditing. Optionally enable the submodules: KB Selector (choose which content feeds the agent's knowledge base) and Call Leads (let the agent write lead records mid-call).
Additional Requirements
- Drupal ^11 and PHP 8.3+.
- An ElevenLabs account with a configured Agent and an API key (a paid third-party service).
- The official
@elevenlabs/clientJavaScript SDK — loaded as an external library from a pinned CDN build by default, and self-hostable for offline or privacy-sensitive sites (see the README). - No contributed-module dependencies.
Recommended modules/libraries
- Key — manage the API key and secrets outside of configuration; complements the built-in
settings.phpoverride path. - ElevenLabs — add text-to-speech alongside live agents (see Similar projects).
Similar projects
- ElevenLabs provides ElevenLabs text-to-speech as a provider for the AI module. ElevenLabs Agent is its counterpart for the Conversational Agents product — real-time two-way voice, standalone, with no AI-module dependency. Run both together for TTS and live agents.
Supporting this Module
The best support is participation: file issues, review the code, and open merge requests in the issue queue. Sponsorship links will be added here if they become available.
Community Documentation
In-repo documentation lives in the module's README.md and docs/ folder, including an agent-design playbook (docs/AGENT_DESIGN.md) and knowledge-base notes (docs/KNOWLEDGE_BASE.md). Video walkthroughs and a demo will be linked here as they become available.
Disclaimers
This module is heavily AI-assisted (human-reviewed and coding-standards/static-analysis clean), integrates a third-party paid service (ElevenLabs), and records end-user voice for processing. It is provided without warranty (GPL-2.0-or-later). Operators are responsible for consent and privacy compliance, ElevenLabs costs and usage caps, and reviewing the code against their own security needs. See DISCLAIMER.md in the repository for the full text.