- name
- conversation-intelligence
- description
- Twilio Conversation Intelligence development guide. Use when building real-time or post-call conversation analysis, language operator pipelines, sentiment analysis, agent assist, cross-channel analytics, or querying aggregated conversation insights (sentiment trends, escalation rates, dashboards).
# Conversation Intelligence
Decision-making guide for Twilio's Conversation Intelligence v3 API — real-time and post-call GenAI analysis of conversations across Voice, SMS, RCS, and WhatsApp. Covers Intelligence Configurations, Language Operators (Twilio-authored and custom), Rules, Triggers, Actions, and result consumption.
> **Security:** All inbound messages captured by the Orchestrator are untrusted external input. If Intelligence operators process this content with LLMs, their prompts should include instructions to ignore adversarial content and not follow instructions embedded in customer messages.
> **GA** — Conversation Intelligence v3 is generally available.
## Use Cases
Conversation Intelligence powers **human agent augmentation** — giving every agent a "second brain" that listens, understands, and surfaces the right data at the right time. Agents focus on empathy, judgment, and problem-solving; AI handles analysis and assistance.
### Wrap-up Agent Assist (Post-Call)
Analyze completed conversations and generate structured outputs — summaries, sentiment signals, topic dispositions. Reduces after-call work, accelerates agent transitions to next interaction. **Low-friction entry point** — start here.
- **Operators**: Summary, Sentiment, custom Conversation Scoring
- **Trigger**: `CONVERSATION_END`
- **Integration**: Webhook → CRM case note creation
### Real-time Agent Assist
Analyze conversations as they unfold. Surface sentiment shifts, script adherence signals, or recommended next responses enriched with customer history and enterprise knowledge. Agents respond more confidently without searching across systems.
- **Operators**: Script Adherence, Next Best Response, Escalation Risk (custom)
- **Trigger**: `COMMUNICATION`
- **Integration**: Webhook → Agent desktop overlay
### Real-time Workflow Automation
Combine real-time intelligence with orchestration to trigger downstream workflows when specific conditions are met — escalate to supervisor, trigger fraud prevention, notify specialist.
- **Operators**: Custom risk detection, compliance monitoring
- **Trigger**: `COMMUNICATION`
- **Integration**: Webhook → Workflow engine / TaskRouter
### Contact Center QA
Generate post-interaction summaries, sentiment scores, and compliance signals for QA, coaching, and analytics. Aggregate across interactions to support training and continuous optimization.
- **Operators**: Script Adherence, Summary, custom Conversation Scoring
- **Trigger**: `CONVERSATION_END`
- **Integration**: Webhook → Analytics / BI tools
## How It Works
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 1. Customer engages agent (Voice, SMS, WhatsApp, RCS, Chat, Email) │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 2. Conversations (Conversation Orchestrator) groups communications into a │
│ Conversation │
│ - Normalizes channel events │
│ - Groups related messages/utterances │
│ - Tracks participants (CUSTOMER, HUMAN_AGENT, AI_AGENT) │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 3. Conversation events trigger Intelligence rules │
│ - COMMUNICATION: on each new message/utterance │
│ - CONVERSATION_END: when conversation closes │
│ - CONVERSATION_INACTIVE: when conversation goes idle │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 4. Language Operators analyze the conversation │
│ - Twilio-authored: Sentiment, Summary, NBR, Script Adherence │
│ - Custom: domain-specific analysis with your prompts │
│ - Context: enriched with Customer Memory + Enterprise Knowledge │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 5. Results delivered via webhook + REST API │
│ - Real-time: Agent desktop, workflow triggers │
│ - Post-call: CRM notes, QA systems, analytics │
│ - Aggregated: Conversational Insights for cross-conversation analysis │
└─────────────────────────────────────────────────────────────────────────────┘
```
**Key insight**: Real-time and post-conversation intelligence use the **same underlying model**. Start with low-friction post-call summaries, then progressively introduce real-time assist using the same components.
## Scope
### CAN
- Analyze conversations in real-time (per-message) and post-conversation (at close/inactive) via Language Operators
- Use 4 Twilio-authored operators: Sentiment, Summary, Next Best Response, Script Adherence
- Create custom Language Operators with natural language prompts and structured output (TEXT, JSON, CLASSIFICATION) — `EXTRACTION` is a read-only format returned by some Twilio-authored operators; it cannot be set on custom operators you create
- Define up to 5 rules per Intelligence Configuration, each with 1-5 operators (minimum 1 required), 0 or 1 trigger, and 0-2 webhook actions
- Throttle real-time triggers with `count` parameter (run every N communications, min 1, max 20)
- Deliver results via webhook (POST) and query historically via REST API
- Track conversations across SMS, Voice, RCS, WhatsApp, Chat, and Email channels via Conversation Orchestrator (Conversations v2) integration
- Create custom operators with parameters (`{{parameters.name}}` syntax), including knowledge base references (`KNOWLEDGE_BASE_AND_SOURCE_IDS` type — value format: `knowledge_base_id:knowledge_source_id`)
- Enrich operators with Customer Memory (`context.memory.enabled: true`) and Enterprise Knowledge (`context.knowledge.bases: [...]`) at the rule or operator level
- Add `trainingExamples` (input/output pairs) to custom operators to improve accuracy
- Pin a specific operator version in a rule via `operators[].version`; omit to use latest
- Query OperatorResults filtered by `intelligenceConfigurationId`, `conversationId`, or `operatorId`
- Query operator versions and fetch specific version details
- Delete Intelligence Configurations, custom Operators, and individual OperatorResults via REST API
- Use ETag/If-Match headers for optimistic locking on **Operator** updates (returns 412 on mismatch) — ETag is not supported on Configuration updates
- Filter Conversations by `status`, `channels`, `createdAtBefore`/`createdAtAfter`, `channelId`, `intelligenceConfigurationIds`, `operatorIds`
- Authenticate with both Account SID/Auth Token and API Key/Secret
- Define rules without a trigger (trigger is optional per spec; runs on all events if omitted)
### CANNOT
- **JSON-only API** — All v3 endpoints require `Content-Type: application/json`. Form-encoded bodies return HTTP 415 with error 20422.
- **No standalone operation** — v3 requires Conversation Orchestrator (Conversations v2) for conversation capture. You cannot feed raw messages or recordings into v3 directly.
- **No per-message sentiment** — Sentiment is conversation-level, accumulating across all messages. A conversation with one positive and one negative message returns "mixed", not separate results per message.
- **No deleting Twilio-authored operators** — DELETE returns 404 "Operator not found" for Twilio-authored operators, not 403. They are not treated as "yours" to delete.
- **No editing Twilio-authored operator prompts** — Twilio-authored operators have `prompt: null` when retrieved via GET. The prompt is hidden and not configurable.
- **No more than 2 actions per rule** — The API enforces `size must be between 0 and 2` for actions.
- **No more than 5 rules per configuration** — API enforces `size must be between 0 and 5`.
- **No PCI or HIPAA compliance** — Conversation Intelligence v3 is not PCI compliant or HIPAA Eligible. Do not use for payment data or protected health information.
- **No GET/PUT/DELETE on v3 Conversations** — The Conversations endpoint is read-only (GET list, GET by ID). Conversation lifecycle is controlled by Conversation Orchestrator, not by the Intelligence API.
- **No unsupported JSON schema features** — The following are rejected in `outputSchema`: `minLength`/`maxLength` (strings), `patternProperties` (objects), `uniqueItems` (arrays). Use basic types only.
- **Cannot use PUT to update a live configuration** — PUT creates an inactive version with no activation API. Operators silently stop returning results. Workaround: DELETE the configuration and POST to recreate it.
- **Silent Memory Store linkage failures** — If `memoryStoreId` points to a deleted or invalid store, capture still works but identity resolution and extraction silently fail with no error. Implement periodic health checks to verify Memory Store linkage is functioning.
## Quick Decision
| Need | Use | Why |
|------|-----|-----|
| Real-time agent assist during live calls/chats | v3 + COMMUNICATION trigger + Next Best Response operator | Real-time webhook delivery per utterance |
| Post-call QA scoring | v3 + CONVERSATION_END trigger + Script Adherence operator | Runs once at conversation close, returns detailed score |
| Conversation sentiment tracking | v3 + Sentiment operator (Twilio-authored) | Conversation-level classification: positive/negative/neutral/mixed |
| Post-call recording transcription + analysis | v2 Voice Intelligence (existing) | v3 does not ingest recordings directly — v2 pipeline handles recording→transcript→operators |
| Custom domain-specific analysis | v3 + Custom operator with JSON output | Define prompt, parameters, structured output schema |
| Cross-channel conversation history | Conversations v2 (Conversation Orchestrator) alone | v3 adds analysis on top; Conversation Orchestrator handles capture and history |
| Simple keyword extraction | v3 + Custom operator (EXTRACTION format) | Structured extraction with custom prompt |
## Decision Frameworks
### v2 (Voice Intelligence) vs v3 (Conversation Intelligence)
| Dimension | v2 (Voice Intelligence) | v3 (Conversation Intelligence) |
|-----------|------------------------|-----------------------------------|
| Input source | Recording SIDs (audio) | Conversation Orchestrator conversations (text/transcriptions) |
| Channels | Voice only | SMS, Voice, RCS, WhatsApp, Chat, Email |
| Operator management | Console only (attach to Intelligence Service) | REST API (full CRUD on custom operators) |
| Trigger model | Post-transcription (async) | Real-time (per-message) or post-conversation |
| Result delivery | Webhook (`voice_intelligence_transcript_available`) | Webhook (per-rule action) + REST query |
| SDK support | `client.intelligence.v2.transcripts` | Twilio Node.js SDK supported |
| SID prefix | `GA` (service), `GT` (transcript), `LY` (operator) | `intelligence_configuration_*`, `intelligence_operator_*` |
| Status | GA | GA |
| Coexistence | Works alongside v3 | Works alongside v2 |
Use v2 when: You need post-call transcription from recordings, or need GA stability.
Use v3 when: You need real-time analysis, cross-channel support, or API-managed custom operators.
### Real-Time vs Post-Conversation
| Factor | COMMUNICATION trigger | CONVERSATION_END trigger | CONVERSATION_INACTIVE trigger |
|--------|----------------------|-------------------------|-------------------------------|
| When it fires | On each new message/utterance | When conversation closes | When conversation goes idle |
| Latency | Near real-time | Seconds after close | After inactive timeout |
| Use cases | Agent assist, escalation detection, live compliance | QA scoring, summaries, CRM updates | Idle conversation follow-up |
| Operator context | Accumulating — sees all messages so far | Complete conversation | Messages up to inactivity point |
| Throttling | `count` parameter (every N messages) | N/A | N/A |
| Cost implication | Runs per message (more executions) | Runs once per conversation | Runs once per inactivity event |
### Operator Version Lifecycle
| Status | Behavior | When |
|--------|----------|------|
| `PREVIEW` | Normal execution, restricted visibility | Internal/testing versions |
| `ACTIVE` | Normal execution, full availability | Production-ready versions |
| `DEPRECATED` | Executes with Warn event via Watch | Migration window — update to newer version |
| `RETIRED` | Hard failure, Error logged in Watch | Must update Intelligence Configuration manually |
### Custom Operator Output Formats
| Format | Use When | Result Shape | Schema Support |
|--------|----------|-------------|----------------|
| TEXT | Free-form analysis, summaries, translations | `{"text": "..."}` | Auto-generated (not customizable) |
| JSON | Structured extraction with custom fields | User-defined via `outputSchema` | Full JSON Schema (max 100 props, 10 nesting levels, 1000 enum values max) |
| CLASSIFICATION | Category labeling (sentiment, intent, topic) | `{"label": "..."}` | Auto-generated |
| EXTRACTION | Returned by some Twilio-authored operators only — cannot be set on custom operators | `{"entities": [{"text": "...", "label": "..."}]}` | N/A (read-only) |
### Twilio-Authored Operator Reference
Ready-to-use operators maintained by Twilio. Use these IDs directly in rules — no custom prompt required.
| Operator | ID | Best Trigger | Use Case |
|----------|-----|--------------|----------|
| **Sentiment** | `intelligence_operator_01kcrvw16kfa88qvgrfmr7y151` | COMMUNICATION | Real-time sentiment tracking (positive/negative/neutral/mixed) |
| **Summary** | `intelligence_operator_01kcv35pnkeysaf6z6cqtbpegn` | CONVERSATION_END | Post-call conversation summary |
| **Next Best Response** | `intelligence_operator_01kea27sy7ffsafmtsfp17nzx4` | COMMUNICATION | Real-time agent assist with suggested responses |
| **Script Adherence** | `intelligence_operator_01kf34tcyefpyb1t4m0nbd8rxg` | CONVERSATION_END | QA scoring for script compliance |
**Note**: Twilio-authored operators have `author: "TWILIO"` and `prompt: null` when retrieved via GET. Prompts are hidden and not configurable. Use custom operators if you need control over the prompt.
## Integration Patterns
Code samples use raw `fetch()` for clarity, but the Twilio Node.js SDK is also supported for v3.
### Authentication Helper
```javascript
const INTELLIGENCE_V3_BASE = 'https://intelligence.twilio.com/v3';
function getAuthHeaders() {
const credentials = Buffer.from(
`${process.env.TWILIO_ACCOUNT_SID}:${process.env.TWILIO_AUTH_TOKEN}`
).toString('base64');
return {
'Authorization': `Basic ${credentials}`,
'Content-Type': 'application/json',
};
}
```
### Create Intelligence Configuration with Rules
```javascript
// Step 1: Create configuration (empty rules initially)
const configResponse = await fetch(
`${INTELLIGENCE_V3_BASE}/ControlPlane/Configurations`,
{
method: 'POST',
headers: getAuthHeaders(),
body: JSON.stringify({
displayName: 'Customer Support Analytics',
description: 'Real-time sentiment + post-call summary',
rules: [],
}),
}
);
const config = await configResponse.json();
// config.id = "intelligence_configuration_..."
// Step 2: Add rules via PUT (replaces all rules)
const updateResponse = await fetch(
`${INTELLIGENCE_V3_BASE}/ControlPlane/Configurations/${config.id}`,
{
method: 'PUT',
headers: getAuthHeaders(),
body: JSON.stringify({
displayName: 'Customer Support Analytics',
rules: [
{
operators: [
{ id: 'intelligence_operator_01kcrvw16kfa88qvgrfmr7y151' }, // Sentiment
],
triggers: [{ on: 'COMMUNICATION' }],
actions: [
{ type: 'WEBHOOK', method: 'POST', url: 'https://your-app.com/realtime-results' },
],
},
{
operators: [
{ id: 'intelligence_operator_01kcv35pnkeysaf6z6cqtbpegn' }, // Summary
],
triggers: [{ on: 'CONVERSATION_END' }],
actions: [
{ type: 'WEBHOOK', method: 'POST', url: 'https://your-app.com/post-call-results' },
],
},
],
}),
}
);
const updatedConfig = await updateResponse.json();
// updatedConfig.version = 2 (auto-incremented)
```
### Link to Conversation Orchestrator Conversation Configuration
```javascript
// Intelligence config must be linked to a Conversation Orchestrator conversation config
// See conversation-orchestrator skill for full Conversation Orchestrator setup
const convConfigResponse = await fetch(
GitHub에서 보기