Skip to main content
Contact memory lets your AI agent recall information from previous conversations — preferences, past issues, commitments, and more — without any external database. By mapping post-call analysis fields to contact fields, Retell automatically extracts and stores conversation insights after every call or chat, building a richer contact profile over time. The next time your agent speaks with that contact, the accumulated memory is injected into the agent’s context as dynamic variables, enabling personalized, context-aware conversations.

How It Works

Contact memory is built through a pipeline that runs automatically after every conversation:
1

Post-call analysis extracts structured data

After each call or chat, your agent’s post-call analysis configuration extracts key information from the conversation transcript — things like preferences, action items, objections, or any custom fields you define.
2

Analysis data maps to contact fields

The extracted data is written to contact fields using your configured analysis data mappings. Each mapping specifies an update mode that controls how new data combines with existing data.
3

Contact fields are available as dynamic variables

On the next conversation with the same contact, all contact fields — including the accumulated memory — are automatically injected into the agent’s prompt as dynamic variables.
The Merge update mode is the key to building memory. Unlike “Overwrite” (which replaces the old value) or “Fill if empty” (which only writes once), Merge uses an LLM to intelligently combine the existing field value with new information from the latest conversation — deduplicating, reconciling conflicts, and maintaining a coherent, up-to-date record.

Setup Guide

Step 1: Define Post-Call Analysis Fields

Create post-call analysis fields on your agent that extract the information you want your agent to remember. Navigate to your agent’s Post-Call Analysis tab and add fields. Example fields for contact memory:
Field NameTypeDescription
customer_preferencesTextExtract any stated preferences, requirements, or constraints the customer mentioned.
key_topicsTextSummarize the main topics discussed and any decisions made.
action_itemsTextList any follow-up actions, commitments, or next steps agreed upon.
objectionsTextCapture any concerns, objections, or hesitations the customer raised.
Write descriptive extraction prompts. The more specific you are about what to extract, the more useful the memory will be. For example, instead of “Summarize the call,” use “Extract the customer’s stated budget, timeline, and any product preferences mentioned during the conversation.”

Step 2: Create Contact Custom Fields

Navigate to Contacts > Contact Fields and create custom fields to store the accumulated memory. These fields will hold the merged data across all conversations. Example contact fields:
Field NameTypeDescription (used as the LLM merge instruction)
preferencesStringA consolidated list of this contact’s preferences and requirements across all conversations. When merging, update changed preferences and keep unchanged ones. Deduplicate. Format as a bullet list.
interaction_historyStringA running summary of all conversations with this contact. Include key topics, decisions, and outcomes. Keep the most recent interaction prominent while preserving important context from earlier conversations. Limit to the 10 most recent interactions.
pending_actionsStringOutstanding action items and commitments. When merging, mark completed items as done if the new conversation indicates completion. Add new action items. Remove items that are no longer relevant.
objections_and_concernsStringA deduplicated list of objections or concerns raised across all conversations. When merging, add new concerns without repeating existing ones. Note if a previously raised concern has been resolved.
The field description is critical when using the Merge update mode. The description acts as an instruction to the LLM that performs the merge — it determines how existing and new values are combined. See How Merge Works for detailed guidance.

Step 3: Map Analysis Fields to Contact Fields

Navigate to Contacts > Contact Fields and configure post-call data mappings for each field. Map each post-call analysis field to its corresponding contact field and select the Merge update mode.
Analysis FieldContact FieldUpdate Mode
customer_preferencespreferencesMerge
key_topicsinteraction_historyMerge
action_itemspending_actionsMerge
objectionsobjections_and_concernsMerge
Analysis data mappings are configured at the organization level, not per agent. As long as any agent’s post-call analysis produces a field with the mapped name, the value will be written to the contact. This means memory accumulates across all agents that interact with the same contact.

Step 4: Reference Memory in Your Agent Prompt

Use dynamic variables to inject the accumulated memory into your agent’s prompt. When a call connects to a known contact (matched by phone number), all contact fields are automatically available.

Sync Memory to Your CRM

If you have a CRM integration connected, you can push the accumulated contact memory back to your CRM using outbound sync mappings. This keeps your CRM records enriched with insights from every AI conversation.
Retell Contact FieldCRM Field
preferencesCustomer_Preferences__c / customer_preferences
interaction_historyAI_Interaction_Notes__c / ai_interaction_notes
pending_actionsPending_Actions__c / pending_actions
This creates a complete loop: CRM data flows into Retell, the agent uses it during conversations, post-call analysis extracts new insights, those insights merge into the contact profile, and the updated profile syncs back to your CRM.

Best Practices

  • Keep memory fields focused. A single field that tries to capture everything produces noisy, hard-to-use context. Create separate fields for distinct categories (preferences, history, action items) so each one stays clean and useful.
  • Write specific merge descriptions. The field description controls how the LLM merges values. “A running summary of interactions” is too vague. “A chronological summary of the last 10 interactions — include key topics and outcomes, drop greetings and small talk” gives the LLM clear instructions.
  • Set size limits in merge descriptions. Without limits, merged fields grow unboundedly. Include instructions like “Limit to 10 most recent interactions” or “Keep under 500 words” to prevent fields from becoming too large for the agent’s context window.
  • Use “Overwrite” for status fields, “Merge” for history fields. A field like lead_status should always reflect the latest value — use Overwrite. A field like interaction_history needs to accumulate across conversations — use Merge.
  • Use “Fill if empty” for stable facts. Fields like email address or company name rarely change. Use “Fill if empty” so they’re captured on first mention without being overwritten by later extractions.
  • Backfill from past conversations. If you set up memory fields after conversations have already occurred, use the batch rerun feature to populate contact fields from historical conversation data.
  • Test with real conversations. After configuring your memory pipeline, make a few test calls to the same contact and verify that the contact fields accumulate correctly. Check the contact detail page to confirm the merged values make sense.