https://retellai.com/?utm_source=discord&utm_medium=seo logo
is it possible to make a chat agent remember the t...
# ❓・ai-evy-support
a
Thanks for tagging me @alonsobrena_26588. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Discord message from @archdesignconcept_00787 on 2025-01-20](https://discord.com/channels/1186424376300679209/1294891368505937952/1330819130978340947) [[2] Get Chat](https://docs.retellai.com/api-references/get-chat) ​
### Answer Yes, you can make a chat agent remember previous phone conversations, but you'll need to implement conversation history in your backend. [(1) ]() Here's how it works: 1. Use the
call_analyzed
webhook to retrieve the call summary after each phone conversation 2. Store this summary in your backend, associated with the user's phone number 3. Use the inbound dynamic variables webhook to supply the conversation history as a variable into the chat agent You can pass this historical context using dynamic variables like
{{customer_name}}
or custom variables you define. [(2) ]() For retrieving call recordings, the
call_ended
or
call_analyzed
webhooks will deliver the recording URL, which you can access via the get call API. [(1) ]() You might also consider using a memory solution like mem0 for more sophisticated conversation history management.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
and is it possible for a call agent to remember a chat?
@AI Evy and is it possible for a call agent to remember a chat?
a
Thanks for the follow-up, @alonsobrena_26588. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
### Answer Yes, a call agent can remember previous chat conversations using the same approach—you'll need to implement this through your backend using dynamic variables. [(1) ]() Here's the process: 1. After each chat session ends, retrieve the chat transcript and summary 2. Store this information in your backend, associated with the user identifier 3. When initiating a phone call, pass the chat history as dynamic variables in the
retell_llm_dynamic_variables
field Dynamic variables can be used in your agent's prompts, begin message, and tool configurations to inject personalized context. For example, you could create a variable like
{{previous_chat_summary}}
that contains key points from the user's chat session. For outbound calls specifically, you set variables in the
retell_llm_dynamic_variables
field when using the Create Phone Call API, with all values as strings. You can also configure agent-level default dynamic variables as fallbacks when specific variables aren't included in the call request.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
but how can i call the webhook at the begining of each chat?
a
Thanks for the follow-up, @alonsobrena_26588. I'll get back to you soon.
### Answer --- ### Answer For chat sessions, you don't "call" the webhook at the beginning—instead, you retrieve the conversation history from your backend when the chat starts and pass it as context. Here's the workflow: 1. When a chat begins, your application queries your backend/database for any previous conversation history associated with that user 2. Pass this history as context when initializing the chat session through dynamic variables or your agent configuration 3. At the end of the chat, use webhooks to capture and store the chat transcript for future sessions [(1) ]() [(2) ]() Retell AI webhooks are **event-driven**—they push data to your endpoint when specific events occur (like
call_started
,
call_ended
, or
call_analyzed
) [(1) ]() [(3) ]() . They're designed to send information out from Retell AI to your systems, not to be called by you at the start of a session [(4) ]() [(3) ]() . For inbound phone calls specifically, there is an inbound call webhook that triggers when a call is received, allowing you to provide call-specific information like dynamic variables before the call is processed [(2) ]() . However, for chat sessions, you'll need to handle context retrieval in your application logic when initializing the chat. The key is storing conversation data (from both calls and chats) in your backend, then retrieving and injecting it as dynamic variables when starting new sessions.
a
how can i set a dinamic variable durring the chat?
how can i set a dinamic variable durring the chat?
a
Thanks for the follow-up, @alonsobrena_26588. I'll get back to you soon.
### Answer Based on the available documentation, you cannot set dynamic variables during an active chat session. Dynamic variables need to be set when you create the chat session. When creating a chat using the Create Chat API, you pass dynamic variables in the
retell_llm_dynamic_variables
field [(1) ]() . Here's the structure:
Copy code
json
{
  "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "retell_llm_dynamic_variables": {
    "customer_name": "John Doe"
  }
}
However, you can extract information during the conversation and store it as dynamic variables using the Extract Dynamic Variable Node in Conversation Flow [(2) ]() . This node is specifically designed to extract information from the conversation and store it as a dynamic variable, though it's not intended for having a conversation with the user . So the workflow would be: 1. Set initial dynamic variables when creating the chat session [(1) ]() 2. Use Extract Dynamic Variable Nodes to capture new information during the conversation [(2) ]() 3. Store extracted variables in your backend for use in future sessions If you need to update context mid-conversation, you'd need to extract the information using the Extract Dynamic Variable Node rather than directly setting variables during the active chat .
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Discord message from @q40478 on 2025-10-30](https://discord.com/channels/1186424376300679209/1186462578310910112/1433471315293110413) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] Retell AI Webhooks | AI Voice Agents With Live Data | Retell AI](https://www.retellai.com/blog/retell-ai-webhooks-feature) [[4] Webhook](https://www.retellai.com/glossary/webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy how can i make that if a chat ends, a specific node gets activated?
a
Thanks for the follow-up, @alonsobrena_26588. I'll get back to you soon.
### Answer ### Answer Based on the available sources, I don't have specific information about activating a node when a chat ends within Retell AI's Conversation Flow. However, you can use webhooks to trigger actions when a chat session ends [(1) ]() [(2) ]() . Webhooks are event-driven messages that automatically push data when specific events occur . When a chat ends, Retell AI can send a webhook notification to your backend system [(2) ]() . Here's what you could do: 1. Configure a webhook to listen for chat end events [(1) ]() [(2) ]() 2. When the webhook receives the chat end notification, your backend can trigger whatever logic you need 3. If you need to start a new conversation flow or activate specific functionality, you could initiate a new session with the appropriate context Webhooks work by sending structured HTTP requests (usually in JSON format) to a predefined URL when events happen [(1) ]() . This allows you to instantly update systems, trigger automated workflows, or initiate custom actions [(1) ]() [(2) ]() . If you're looking to trigger a specific node within the same conversation session when certain conditions are met (rather than when the chat ends) , you might want to explore Conversation Flow's conditional transitions and node configurations instead. Could you clarify if you're trying to trigger something within the same conversation or start a new process after the chat ends? That would help me provide more specific guidance. --- **
​ To learn more, see the sources I considered: [[1] Webhook](https://www.retellai.com/glossary/webhook) [[2] Retell AI Webhooks | AI Voice Agents With Live Data | Retell AI](https://www.retellai.com/blog/retell-ai-webhooks-feature) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.