https://retellai.com/?utm_source=discord&utm_medium=seo logo
Our agent is caching variables between different p...
# ❓・ai-evy-support
p
@AI Evy Our agent is caching variables between different phone calls. When Person A calls and authenticates with custnum X, then Person B calls, the agent uses Person A's custnum for Person B. We need each call to be completely isolated with no memory of previous calls.
a
Thanks for tagging me @peterthehammer_05753. I'll look through relevant sources and get back to you shortly.
### Answer Each call in Retell AI should be isolated by default. The issue you're describing suggests the problem is likely in your backend implementation rather than Retell AI's call isolation. Each call has its own unique
call_id
[(1) ]() [(2) ]() [(3) ]() and
retell_llm_dynamic_variables
that are specific to that call instance . When you create or register a phone call, you can set call-specific dynamic variables:
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;
[(3) ]()
Copy code
javascript
const phoneCallResponse = await client.call.registerPhoneCall({
 agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
[(2) ]() The
retell_llm_dynamic_variables
object in the call response contains variables specific to that individual call [(1) ]() [(2) ]() [(3) ]() . Each call maintains its own isolated context. If variables are persisting between calls, check your backend implementation: 1. Ensure you're not storing variables globally or in shared memory 2. Verify that your webhook handlers are processing each call's unique
call_id
separately [(2) ]() [(3) ]() 3. Make sure dynamic variables are being set per call, not cached from previous calls The call isolation issue is most likely occurring in your custom backend logic rather than Retell AI's platform, as each call maintains its own separate context and variables by design.
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p