customer-memory
Skill2 starsChanged 8 months agoMITView on GitHub
Twilio development skill: customer-memory
- Reads credentials
- Sends data out
In this repository66 other files it gives its agents.
- adversarial-reviewSkill
- agent-connectSkill
- agent-teams-guideSkill
- agent-testingSkill
- android-sdkSkill
- brainstormSkill
- branded-callingSkill
- callbacksSkill
- compliance-regulatorySkill
- conferenceSkill
- context-engineeringSkill
- context-hubSkill
- conversational-intelligenceSkill
- conversation-relay-referenceSkill
- conversation-relaySkill
- conversationrelaySkill
- conversations-v2Skill
- deepgramSkill
- deep-validationSkill
- elastic-sip-trunkingSkill
- env-doctorSkill
- event-streamsSkill
- getting-startedSkill
- hooks-referenceSkill
- iamSkill
- ios-sdkSkill
- ivr-crawlerSkill
- ivr-migratorSkill
- lookupSkill
- media-streamsSkill
- memory-systemsSkill
- messaging-services-referenceSkill
- messaging-servicesSkill
- messagingSkill
- multi-agent-patternsSkill
- operational-gotchasSkill
- paymentsSkill
- paySkill
- phone-numbersSkill
- proxySkill
- real-time-transcriptionSkill
- recordingsSkill
- segmentSkill
- sendgrid-emailSkill
- sip-byocSkill
- sipSkill
- sync-referenceSkill
- syncSkill
- taskrouter-referenceSkill
- taskrouterSkill
- tdd-workflowSkill
- tool-boundariesSkill
- twilio-cliSkill
- twilio-invariantsSkill
- verify-referenceSkill
- verifySkill
- video-patternsSkill
- videoSkill
- voice-insightsSkill
- voice-referenceSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Create memory stores as profile containers (max 15/account, 10K profiles/store) <!-- verified: T1 -->
- Distinctive: line 35
Delete profiles (async, HTTP 202) <!-- verified: T3 -->
- Distinctive: line 61
Store deletion: Check current API documentation for store deletion support.
- Distinctive: line 158
After creating a Store and Conversation Configuration with phone numbers, SMS conversations are automatically ingested.
- Very specific: line 230
occurredAtis required for manual observations: Not listed as required in docs, but API rejects without it. - Distinctive: line 233
Reconciliation latency is 30-60 seconds: Not instantaneous. The AI model processes contradictions asynchronously.
- Distinctive: line 262
Not PCI or HIPAA compliant: Do not store payment card data, health records, or other regulated data.
- Very specific: line 268
Profile deletion: Delete a customer profile via DELETE /v1/Services/{serviceSid}/Profiles/{profileSid} to remove all associated data …
- Distinctive: line 274
Data persistence: Check current documentation for data retention and migration guarantees.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
name: customer-memory description: Twilio Customer Memory development guide. Use when building customer context persistence, personalized AI agents, omnichannel profile management, or integrating memory into ConversationRelay or messaging flows. allowed-tools: mcp__twilio__*, Read, Grep, Glob
<!-- verified: memory.twilio.com/v1 API, conversations.twilio.com/v2 API + live testing 2026-03-26 -->Twilio Customer Memory
AI-powered contextual data layer for customer profiles. Stores traits (structured facts), observations (unstructured insights auto-extracted from conversations), summaries, identifiers, and events. Provides semantic + lexical hybrid Recall search. Integrates with Twilio Conversations (SMS, WhatsApp, Voice) for automatic profile hydration.
Generally available — Not PCI or HIPAA compliant. AI models: OpenAI GPT-5-mini + text-embedding-3-large.
Evidence date: 2026-03-26.
Scope
CAN
- Create memory stores as profile containers (max 15/account, 10K profiles/store)
<!-- verified: T1 --> - Auto-extract observations from closed/inactive conversations (after conversation config set up)
<!-- verified: docs --> - Auto-hydrate SMS profiles from configured phone numbers via Conversation Configuration
<!-- verified: T12 --> - Recall with semantic + lexical hybrid search across observations, summaries, and communications
<!-- verified: T9 --> - Recall without explicit query — returns recent observations (fast: ~37ms vs 800-10000ms with semantic query)
<!-- verified: T9 --> - Structured traits via trait groups with validation rules (STRING, BOOLEAN, INTEGER, arrays)
<!-- verified: T2 --> - Auto-promote traits to identifiers via
idTypePromotion(phone, email, chat, whatsapp)<!-- verified: T5 --> - Identity resolution across channels with EXACT matching and profile merging
<!-- verified: T4 --> - Observation reconciliation: contradictions update in-place, enrichments merge, unsupported discard
<!-- verified: T8 --> - Delete profiles (async, HTTP 202)
<!-- verified: T3 --> - Date-range filtering and relevance threshold on Recall
<!-- verified: T9 --> - Lookup profiles by identifier via
GET /Profiles?idType=X&value=Y<!-- verified: T6 --> - Bulk upsert up to 1000 profiles per request (async)
<!-- verified: T13 --> - CSV import up to 1M rows with automatic trait mapping (Console only)
- Profile events for tracking actions (up to 1000/batch, 10 properties each)
- Custom trait groups with custom trait definitions
<!-- verified: T2 -->
CANNOT
- Cannot delete memory stores — Private beta limitation. Once created, a store is permanent. Plan names carefully.
<!-- verified: docs + no delete endpoint found --> - Cannot move traits between groups — Trait-to-group assignment is permanent. Design taxonomy before creating.
<!-- verified: docs --> - Cannot reconcile profiles across stores — Multi-store = isolation, not federation. Same customer gets separate profiles.
<!-- verified: docs --> - Cannot use for PCI/HIPAA data — Uses OpenAI models. Data stored for 3 years.
<!-- verified: nutrition-facts.md --> - Cannot use fuzzy identity matching —
matchingAlgoonly supportsexact. No phonetic or partial matching.<!-- verified: T4 --> - Cannot create profiles without traits — Error 400: "Traits are required to create a profile." Must provide at least one registered trait.
<!-- verified: T3 --> - Cannot use unregistered trait names — Error 400: "Trait not registered for this service." Traits must be defined in a trait group first.
<!-- verified: T3 --> - Cannot Recall without both storeId and profileId — No cross-profile search exists. Use Lookup first to resolve identifier → profileId.
<!-- verified: T9 --> - Cannot request communications without conversationId — Recall fails with 400 if
communicationsLimit > 0withoutconversationId.<!-- verified: T9 --> - Cannot create conversation summaries without conversationId — Manual summary injection requires a real conversation reference.
<!-- verified: T10 --> - 17 MCP tools available — Stores, Trait Groups, Profiles, Observations, Recall, and Identity Resolution via
mcp__twilio__*tools. UseToolSearch("select:mcp__twilio__create_memory_store")to hydrate before calling.<!-- verified: MCP REFERENCE.md search --> - Cannot get real-time observations — Extraction happens post-conversation (when closed/inactive), not during.
<!-- verified: docs --> - CI v3 webhook
profileId: nullfor participants without Memory profiles — When Intelligence v3 sends operator results via webhook,participants[].profileIdisnull(not absent) for callers without a Memory profile. TAC SDK's Zod schema must use.nullable().optional()to accept this. The "No memory store ID in event" error is a downstream symptom — the SDK rejects the payload before reaching Memory logic.<!-- verified: 2026-05-18 live testing -->
Data Lifecycle & Compliance Notes
- Store deletion: Check current API documentation for store deletion support.
- Profile deletion: Async (HTTP 202). No completion confirmation callback. Unclear whether deletion reaches OpenAI embeddings or overrides the 3-year retention window.
- GDPR Article 17 (Right to Erasure): Profile deletion is the closest available mechanism, but completeness of erasure across the OpenAI processing chain is undocumented. Consult Twilio for GDPR compliance guarantees before storing EU personal data.
- Data retention: 3 years per AI Nutrition Facts. No configurable retention period in beta.
- Data processing: Observations processed by OpenAI GPT-5-mini; embeddings by text-embedding-3-large. Data residency and sub-processor DPA details not documented for beta.
Quick Decision
| Need | Use | Why |
| Customer context across voice/messaging sessions | Customer Memory | Purpose-built cross-session, cross-channel profiles |
| Application state across webhook calls | Sync Documents | Structured JSON, real-time, TTL support |
| Structured CRM-like fields (name, tier) | Customer Memory Traits | Key-value in trait groups, bulk importable |
| Unstructured conversation insights | Customer Memory Observations | Auto-extracted, AI-reconciled, searchable via Recall |
| Real-time call state during single call | Sync Document per CallSid | Customer Memory is post-conversation |
| Organizational knowledge (FAQs, docs) | Enterprise Knowledge | Shared/org-level, not per-customer |
| Agent handoff context | Customer Memory Recall + Summaries | Prior conversation summaries for handoff agent |
| Session-scoped temp state | URL params or Sync with TTL | Customer Memory is persistent, no TTL |
Decision Frameworks
Traits vs Observations vs Events
| Criterion | Traits | Observations | Events |
| Data shape | Key-value (structured) | Free-text phrase (unstructured) | Named action + properties |
| Source | API/CSV/Bulk, manual | Auto-extracted from conversations, or manual via API | API ingestion |
| Mutability | Overwritable per key | AI-reconciled (contradictions update in-place) | Append-only |
| Searchable via Recall | No (fetch via profile GET) | Yes (semantic + lexical) | Not confirmed |
| Pre-registration | Required (trait group + trait definition) | No schema needed | No schema needed |
| Max per profile | 50 groups × 95 traits | 500 | Unknown |
| Use case | Identity, segmentation, routing rules | Preferences, behaviors, context | Tracking actions, analytics |
| Example | Contact.firstName: "Jane" | "Prefers email over phone" | page_viewed { page: "pricing" } |
Store Topology
| Strategy | When | Tradeoff |
| Single store | Most cases. One business, unified profiles | Simplest. No cross-store reconciliation issues. |
| Production + sandbox | Need isolated testing | Profiles duplicated. Cannot delete stores when done. |
| Per business unit | Regulatory isolation, separate data governance | No reconciliation. Same customer calling both units gets two profiles. |
Identity Resolution Strategy
- Default config ships with 4 identifier types: phone, email, chat, whatsapp — all with enforceUnique=true, limit=100, FIFO overflow
- Traits with
idTypePromotionauto-create identifiers — SettingContact.phoneon a profile automatically creates a phone identifier. No separate API call needed. - Matching rules determine merge behavior: if a new profile's identifier matches one existing profile, it updates; if it matches multiple, they merge; if no match, a new profile is created.
- Add custom identifier types by updating ID Resolution Settings with additional
identifierConfigsentries. - Normalization options:
phone(E.164),email(lowercase),trim(whitespace). Chat and whatsapp default totrim.
Recall Optimization
| Scenario | Strategy | Expected latency |
| Need relevant memories for current conversation | Provide query + conversationId | 800-10000ms (semantic search) |
| Need all recent context (no specific query) | Omit query, omit conversationId | ~37ms (returns recent observations) |
| Need conversation-specific communications | Provide conversationId + communicationsLimit > 0 | Varies |
| Filter low-relevance noise | Set relevanceThreshold (0-1). 0.8 is aggressive — filters most results. | — |
| Default limits | observationsLimit: 20, summariesLimit: 5, communicationsLimit: 0 | — |
Integration Patterns
ConversationRelay + Customer Memory
Flow: Inbound call → TwiML webhook → ConversationRelay WebSocket → setup event → Lookup profile by phone → Recall observations/summaries → Inject into LLM system prompt → Conversation proceeds → Call ends → Observations auto-extracted.
// In WebSocket setup handler — lookup + recall
const storeId = 'mem_store_...';
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const auth = Buffer.from(`${accountSid}:${authToken}`).toString('base64');
// Step 1: Lookup profile by caller phone number
const lookupResp = await fetch(
`https://memory.twilio.com/v1/Stores/${storeId}/Profiles?idType=phone&value=${encodeURIComponent(callerPhone)}`,
{ headers: { Authorization: `Basic ${auth}` } }
);
const { profiles } = await lookupResp.json();
if (profiles && profiles.length > 0) {
// Step 2: Recall memories for the profile
const recallResp = await fetch(
`https://memory.twilio.com/v1/Stores/${storeId}/Profiles/${profiles[0]}/Recall`,
{
method: 'POST',
headers: { Authorization: `Basic ${auth}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ observationsLimit: 20, summariesLimit: 5 })
}
);
const memories = await recallResp.json();
// Inject memories.observations and memories.summaries into system prompt
}Messaging + Auto-Hydration
After creating a Store and Conversation Configuration with phone numbers, SMS conversations are automatically ingested. Observations are extracted when conversations close (default: 15 min timeout for messaging).
# 1. Create store (one-time)
POST https://memory.twilio.com/v1/ControlPlane/Stores
{"displayName": "my-store", "description": "Production memory store"}
# 2. Create conversation configuration (one-time)
POST https://conversations.twilio.com/v2/ControlPlane/Configurations
{
"displayName": "sms-config",
"description": "SMS auto-hydration",
"conversationGroupingType": "GROUP_BY_PARTICIPANT_ADDRESSES",
"memoryStoreId": "mem_store_..."
}
# Then assign phone numbers via ConsoleProgrammatic Profile Management
# Register a custom trait group
POST https://memory.twilio.com/v1/ControlPlane/Stores/{storeId}/TraitGroups
{
"displayName": "Loyalty",
"description": "Customer loyalty program data",
"traits": {
"tier": {"dataType": "STRING", "description": "Gold/Silver/Bronze"},
"points": {"dataType": "INTEGER", "description": "Accumulated points"},
"memberSince": {"dataType": "STRING", "description": "ISO date of enrollment"}
}
}
# Create profile with traits (async)
POST https://memory.twilio.com/v1/Stores/{storeId}/Profiles
{
"traits": {
"Contact": {"firstName": "Jane", "lastName": "Doe", "email": "jane@example.com"},
"Loyalty": {"tier": "Gold", "points": 1500, "memberSince": "2024-01-15"}
}
}
# Add manual observations (async)
POST https://memory.twilio.com/v1/Stores/{storeId}/Profiles/{profileId}/Observations
{
"observations": [
{"content": "Prefers email over phone calls", "source": "crm-import", "occurredAt": "2026-03-25T10:00:00Z"}
]
}Gotchas
Setup & Stores
- Stores cannot be deleted: Private beta limitation. Creating a store is irreversible. Use descriptive, intentional names.
<!-- verified: T1, docs --> - displayName is 32 chars, alphanumeric + hyphens/underscores only: Not the friendly name — it's the URL-safe unique identifier.
<!-- verified: docs --> - Duplicate displayName returns error 20001: "a memory store with displayName 'X' already exists for account 'AC...'"
<!-- verified: T1 --> - Store creation is async: Returns
status: "QUEUED", becomesACTIVEwithin seconds. Fetch to verify.<!-- verified: T1 --> - IDs use
mem_*prefix, not Twilio SID format: Stores aremem_store_*, profilesmem_profile_*, observationsmem_observation_*. Not AC/IS/ET format.<!-- verified: T1, T3, T7 -->
Traits & Trait Groups
- Traits must be pre-registered in a trait group: Cannot create profiles with ad-hoc trait names. Error: "Trait not registered for this service." Register the trait group first via ControlPlane API.
<!-- verified: T3 --> - Trait names are camelCase:
firstNamenotfirst_name. The default Contact group uses camelCase for all 11 traits.<!-- verified: T2 --> - Default Contact group ships with 11 traits: firstName, lastName, email, phone, chat, whatsapp, city, state, country, postalCode, street. Docs understate this as "first name, last name, phone, address."
<!-- verified: T2 --> - Traits cannot be moved between groups: Assignment is permanent. Design your trait group taxonomy carefully before creating traits.
<!-- verified: docs --> - Trait group API path is ControlPlane:
GET /v1/ControlPlane/Stores/{id}/TraitGroupsworks./v1/Stores/{id}/TraitGroupsreturns 404.<!-- verified: T2 --> - idTypePromotion auto-creates identifiers: Setting
Contact.emailautomatically creates an email identifier on the profile. No separate identifier API call needed.<!-- verified: T5 -->
Observations & Reconciliation
occurredAtis required for manual observations: Not listed as required in docs, but API rejects without it. Error: "observations[N].occurredAt: must not be null."<!-- verified: T7 -->12b.occurredAtclock skew breaks Recall ordering: Customer Memory observations sort byoccurredAt. Clock skew >30s between your WebSocket/server and Twilio causes out-of-order Recall results. Use server-side timestamps from Twilio events (call setupstart_time, messagedateSent, CRelay setup message) foroccurredAt, NOT local clock. NTP-sync your servers — required when clocks may drift (containers, multi-region, ephemeral compute).<!-- verified: super-uber-validation 2026-05-19 chaos scenario 6 -->- Observation reconciliation updates in-place: Same observation ID retained. Content merged by AI model.
updatedAtreflects the reconciliation time. Original context is preserved in the rewritten content.<!-- verified: T8 --> - Reconciliation latency is 30-60 seconds: Not instantaneous. The AI model processes contradictions asynchronously.
<!-- verified: T8 --> - Conversation summaries require a conversationId: Cannot manually inject summaries without a real conversation reference.
<!-- verified: T10 -->
Identity Resolution
- Default ID resolution includes 4 types: phone, email, chat, whatsapp. All with
enforceUnique: true,limit: 100. Pre-configured on store creation.<!-- verified: T4 --> - Enum values are lowercase in API responses:
"exact"not"EXACT","fifo"not"FIFO". Docs show uppercase.<!-- verified: T4 --> matchingThreshold: 75exists but is undocumented: Present in ID resolution settings response. Purpose unclear.<!-- verified: T4 -->trimnormalization exists: Used for chat and whatsapp identifiers. Not in docs (only "email" and "phone" documented).<!-- verified: T4 -->
Recall
- Recall without query is 20-270x faster: ~37ms vs 800-10000ms depending on data volume. Use query-less Recall when you want recent context without semantic search overhead.
<!-- verified: T9 --> - relevanceThreshold=0.8 filters aggressively: May return 0 results even with clearly related observations. Start with 0.3-0.5 for practical filtering.
<!-- verified: T9 --> - communicationsLimit > 0 requires conversationId: Error 400 if you request communications without specifying a conversation.
<!-- verified: T9 -->22b. Recall latency scales with observation volume: Profiles with 400+ observations and long content can push Recall to 10s+ response times. For voice AI (where latency matters), setobservationsLimit: 10-20andrelevanceThreshold: 0.3-0.5to filter noise. Implement application-level observation pruning for high-volume profiles before they degrade. No 413 has been observed; HTTP client timeout is the practical ceiling.<!-- verified: super-uber-validation 2026-05-19 chaos scenario 7 -->22c. Cross-product timing: When using Customer Memory with ConversationRelay, see/conversationrelaySecurity section for prompt-injection defense and clock-sync requirements.<!-- cross-reference -->22d. Prompt injection defense for observations: Observations stored in Customer Memory may be recalled into LLM contexts. See Twilio prompt-injection defense guidance for the three-layer defense pattern (write-time sanitizer, read-time wrapping, system prompt instruction).<!-- verified: super-uber-validation 2026-05-19 UC12/UC13 -->
Bulk & CSV
- Bulk upsert requires pre-registered traits: Same constraint as single profile creation. Trait groups must exist first. The bulk response says "Events accepted for processing" (confusing wording) regardless.
<!-- verified: T13 --> - CSV requires phone or email identifier: Other identifier types not supported for CSV import.
<!-- verified: docs --> - "Completed" CSV status includes partial failures: Files with fewer than 100 failed rows still show "Completed." Always check row-level details.
<!-- verified: docs -->
Compliance & AI
- Not PCI or HIPAA compliant: Do not store payment card data, health records, or other regulated data.
<!-- verified: docs --> - AI models are OpenAI (GPT-5-mini, text-embedding-3-large): Customer data is processed by OpenAI models for observation extraction, reconciliation, and Recall embeddings.
<!-- verified: nutrition-facts.md --> - 3-year data retention: Per AI Nutrition Facts.
<!-- verified: nutrition-facts.md -->
GDPR & Data Erasure
Profile deletion. Delete a customer profile via DELETE /v1/Services/{serviceSid}/Profiles/{profileSid} to remove all associated data (traits, observations, identifiers, summaries). Check docs for Memory Store deletion support.
No automated TTL. Customer Memory has no built-in data retention limits. Developers must implement cleanup logic for time-bound data or respond to GDPR erasure requests manually.
OpenAI sub-processing. Customer data is processed by OpenAI models (gotcha #27). Document this in your DPA. The 3-year retention policy (gotcha #28) may conflict with GDPR minimization requirements — plan erasure workflows accordingly.
Data persistence. Check current documentation for data retention and migration guarantees.
Related Resources
- Sync skill (
/sync) — For application state; complements Customer Memory for customer knowledge - ConversationRelay CLAUDE.md (
/conversationrelayskill) — Primary integration surface for voice AI - Memory Systems skill (
/memory-systems) — Broader state tracking patterns - Voice Use Case Map (
/voice-use-case-map) — Voice AI agent use cases - 17 MCP tools —
mcp__twilio__create_memory_store,recall_memories,create_memory_profile, etc. Hydrate via ToolSearch before use. - Agent Connect (TAC) skill (
/agent-connect) — SDK wrapper that automates Memory retrieval - Conversations (unified stack) (Twilio Conversations documentation) — End-to-end integration guide for Conversations v2 + Customer Memory + Intelligence v3 pipeline. Setup sequence, data flow, cross-product gotchas.
Reference Files
| Topic | File | When to read |
| Full API endpoints | references/api-reference.md | Making any Customer Memory API call |
| Data modeling decisions | references/data-modeling.md | Designing profile schema, choosing traits vs observations, identity resolution |
| Resource limits | references/limits.md | Validating a design against product limits |
| Test evidence | references/test-results.md | Verifying behavioral claims with SID evidence |
| Assertion audit | references/assertion-audit.md | Provenance chain for all factual claims |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

