Elevenlabs Twilio Memory Bridge
FastAPI personalization webhook that adds persistent caller memory and dynamic context injection to ElevenLabs Conversational AI agents on Twilio. No audio…
от britrik2 592 установки в других каталогах
Установить Elevenlabs Twilio Memory Bridge в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
elevenlabs-twilio-memory-bridge
Personalization webhook service for ElevenLabs + Twilio voice agents with persistent caller memory.
What It Does
When a call arrives on your Twilio number, ElevenLabs' native integration triggers this webhook. The bridge looks up the caller's history, loads long-term memory facts and daily context notes, combines them with a customizable soul/personality template, and returns everything as a system prompt override so your agent greets each caller with full context.
Architecture
- No audio proxying — ElevenLabs and Twilio handle media directly
- Webhook only — called once per inbound call to inject context
- File-based persistence — JSON files in
./data/, zero external dependencies - OpenClaw compatible — works with any OpenAI-compatible LLM endpoint
Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/webhook/personalize |
POST | ElevenLabs calls this on inbound call |
/webhook/post-call |
POST | Optional post-call cleanup |
/api/memory/{phone_hash} |
POST | Add long-term fact about a caller |
/api/notes |
POST | Add global or caller-scoped context note |
/health |
GET | Health check |
Setup
- Clone repo,
pip install -r requirements.txt - Copy
.env.exampleto.env, fill in secrets - Configure ElevenLabs agent with Custom LLM pointing to your OpenClaw instance
- Enable system prompt + first message overrides in agent Security settings
- Add webhook URL
https://your-domain/webhook/personalizein ElevenLabs settings - Import Twilio number in ElevenLabs dashboard
- Run:
uvicorn app:app --host 0.0.0.0 --port 8000
Required Environment Variables
ELEVENLABS_API_KEY— scoped ElevenLabs keyELEVENLABS_AGENT_ID— your agent IDOPENCLAW_API_BASE_URL— your OpenClaw instance URLPUBLIC_BASE_URL— publicly reachable URL of this serviceADMIN_API_KEY— secret for admin endpoint authPHONE_HASH_SALT— salt for phone number hashing. Generate withopenssl rand -base64 32. Changing this invalidates all existing caller data.WEBHOOK_SECRET— shared secret for HMAC webhook verification. Must be set in production.
Optional Environment Variables
| Variable | Default | Purpose |
|---|---|---|
DATA_ENCRYPTION_KEY |
(unset) | Fernet key for encrypting memories and notes at rest. Generate with python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())". Required unless ALLOW_PLAINTEXT_STORAGE=true; the bridge refuses to start without it. |
SOUL_TEMPLATE_PATH |
./soul_template.md |
Path to personality template file |
DATA_DIR |
./data |
Directory for JSON persistence |
ALLOWED_ORIGINS |
(unset) | Comma-separated CORS origins |
HOST |
0.0.0.0 |
Bind address for uvicorn |
PORT |
8000 |
Listen port |
LOG_LEVEL |
INFO |
Python logging level |
Security
- Deterministic phone hashing — Phone numbers are hashed with HMAC-SHA256 using
PHONE_HASH_SALTas the key before storage. Changing the salt invalidates existing caller data. - Encryption at rest — Session records, memories and notes are encrypted with Fernet. Startup fails without
DATA_ENCRYPTION_KEYunless you explicitly setALLOW_PLAINTEXT_STORAGE=true. - Mandatory webhook verification —
WEBHOOK_SECRETis required in production. Webhooks are rejected when the secret is not set (fail-closed). - Rate limiting — Admin endpoints (
/api/memory,/api/notes) are limited to 30 requests per minute. Webhook endpoints are limited to 60 per minute. - File locking — JSON reads and writes use POSIX advisory locks (
fcntl) to prevent race conditions under concurrent access. - Restrictive permissions — Data directory (
DATA_DIR) is created with0o700permissions. JSON files are written with0o600. - Secrets from env vars only — No hardcoded credentials in source.
- Safe for public GitHub repos — All sensitive config is loaded from environment variables.
Data Handling
- What is stored: a salted HMAC of the caller's phone number (never the raw number), caller name, call count, memory facts and notes added through the admin API.
- Where: JSON files under
DATA_DIRon the host running the bridge. Each session record (caller name, call count, timestamps, last call SID), memory fact and note is encrypted at rest with Fernet; files arechmod 600and the directory0700. The phone-number HMAC is kept in clear as the lookup key. Every read-modify-write holds an exclusive lock, so concurrent calls don't lose updates. - Retention: data is kept until you delete the files under
DATA_DIR; the bridge has no automatic expiry. Delete a caller's file to forget them. - Prompt injection: stored facts and notes are flattened to single bounded lines (newest 30 facts within a 6,000-character budget, last 10 notes) and fenced in a
<caller_memory>block that tells the agent to treat it
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Elevenlabs Twilio Memory Bridge?
FastAPI personalization webhook that adds persistent caller memory and dynamic context injection to ElevenLabs Conversational AI agents on Twilio. No audio proxying, file-based persistence, OpenClaw compatible.
Как установить скилл Elevenlabs Twilio Memory Bridge?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Elevenlabs Twilio Memory Bridge запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…