TwilioAmanda LangeTutorial
How To Import Data From Your CRM Or Another External Source Into Conversation Memory
Summary
Callers often have to repeat account details each time they contact a business. Twilio Conversation Memory addresses this by storing customer profiles, traits (e.g., VIPStatus, PreferredLanguage), and observations (e.g., ‘Order #9401 delayed’) for use by voice agents, chatbots, and IVRs. This tutorial presents two import paths: uploading a CSV directly in the console with AI-assisted mapping of columns to custom traits of types string, integer, boolean, or array, or building a .NET 9 Web API for programmatic sync. The API solution reads a mock JSON file containing four customer records, maps fields like phone and email to the Profiles API via CrmSyncService, and exposes a POST /sync/{phone} endpoint that first checks for existing profiles to avoid duplicates. After successful syncing, customer data appears in the Conversation Memory Store and is accessible on incoming interactions without extra database calls.
Context
Callers often repeat account details on each contact, creating friction. Twilio Conversation Memory stores customer profiles, traits, and observations to provide context to voice agents, chatbots, and IVRs without extra database calls.
Approach / What changed
The tutorial explains two methods: uploading a CSV via the console with AI-assisted mapping, and building a .NET 9 Web API. The API solution reads mock CRM JSON, maps fields to Twilio’s Profiles API, checks for existing profiles to avoid duplicates, and exposes a POST endpoint to trigger sync. It requires a Twilio account, memory store ID, and API key.
Takeaways
Conversation Memory stores data as profiles (tied to phone or email), traits (static properties like VIPStatus), and observations (past events like order delays).
CSV upload in the console supports AI-assisted mapping of columns to custom traits of types string, integer, boolean, or array.
The API-based sync uses a .NET 9 Web API with CrmSyncService that checks for existing profiles by phone before creating or updating to avoid duplicates.
FAQ
What data types can traits be in Conversation Memory?
Traits can be string, integer, boolean, or an array of those types, but nested arrays are not supported.
How does the API avoid creating duplicate profiles?
The CrmSyncService first queries the Profiles API by phone number. If a profile exists, it updates it; if not, it creates a new profile.
How do you handle the '+' sign in phone numbers for the sync endpoint?
The + sign must be percent-encoded as %2B in the URL path so the server interprets it as part of the E.164 phone number rather than a space.
Source and freshness
- Source
- twilio.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.