https://retellai.com/?utm_source=discord&utm_medium=seo logo
if for example, my assistant does not have the nam...
# ❓・ai-evy-support
h
@AI Evy if for example, my assistant does not have the name or phone number of the individual because it's an inbound call can the assistant automatically identify the number based off the number that is actually calling like commit scene in real time the number that's calling and then jot that down in a dynamic variable without asking the user specifically, or does the user need to actually specify the number and when it comes to the name, how is that done and obviously email yeah I would have to ask for that, but like I'm just asking specifically for the number how does that work? Can I automatically just extract the number?
a
Thanks for tagging me @hans_70884. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Populating dynamic variables (caller details) based on the entity provided by the user (inbound)](https://discord.com/channels/1186424376300679209/1257709468251066439) [[3] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) ​
### Answer Yes, for inbound calls, Retell AI automatically provides the caller's phone number as a system variable without needing to ask the user [(1) ]() . The system variable
{{user_number}}
contains the caller's phone number (the from_number for inbound calls) . You can reference this directly in your prompts, begin messages, or tool configurations using the
{{user_number}}
syntax . For the caller's name, you have two approaches: 1. **Fetch from CRM during call start**: Use the Inbound Call Webhook to look up caller details based on
{{user_number}}
and populate dynamic variables like
{{caller_name}}
before the conversation begins [(1) ]() [(2) ]() . 2. **Extract during conversation**: If no name is available at call start, use an Extract Dynamic Variable Node to collect the name from the conversation and store it as a dynamic variable [(3) ]() . For email, you'll need to ask the user directly and extract it during the conversation, as there's no automatic system variable for email addresses [(1) ]() . Example usage in your prompt:
Copy code
Hello! I see you're calling from {{user_number}}. May I have your name to better assist you?
The
{{user_number}}
variable is automatically available for all phone calls and requires no configuration .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy so if I make a dynamic variable extraction just to keep it clean because I keep everything via dynamic variables, it will know the users number you're saying and then like what? What? What description would I have to give it like will it automatically know to like pull the number you have to specify from like in the system the number that they user is calling fromextract like how do I do it?
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
### Answer \You don't need to use an Extract Dynamic Variable tool for the phone number. The
{{user_number}}
system variable is already automatically available for all phone calls [(1) ]() . System default dynamic variables like
{{user_number}}
are built-in and don't require extraction . They're automatically populated by Retell AI when the call starts . For inbound calls specifically: -
{{user_number}}
contains the caller's phone number (the from_number) -
{{agent_number}}
contains your Retell phone number (the to_number) -
{{direction}}
will be "inbound" You can simply reference
{{user_number}}
directly in your prompts, begin messages, or tool configurations without any extraction setup. If you still want to store it as a custom dynamic variable, you would use the Extract Dynamic Variable tool with: [(2) ]() 1. **Variable Name**: Something like
caller_phone
2. **Description**: "The phone number the user is calling from" 3. **Variable Type**: Text Then update your prompt to explicitly tell the agent: "Extract the caller's phone number by calling the extract function. The phone number is
{{user_number}}
." But again, this is unnecessary since
{{user_number}}
is already available system-wide [(1) ]() .
​ To learn more, see the sources I considered: [[1] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
give example format i should store it in @AI Evy
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
### Answer You don't need to store
{{user_number}}
separately since it's already a system variable [(1) ]() . However, if you want to extract and store it as a custom dynamic variable for consistency with your workflow, here's the format: For Extract Dynamic Variable tool: [(2) ]() - **Variable Name**:
caller_phone
- **Description**:
The phone number the user is calling from
- **Variable Type**:
Text
Then in your prompt, add:
Copy code
When the call starts, extract the caller's phone number by calling the extract function. The phone number is {{user_number}}.
To reference it later in your flow: [(1) ]() - Use
{{caller_phone}}
anywhere you need the stored value - Or continue using
{{user_number}}
directly since it's always available Example in a prompt:
Copy code
The caller is reaching out from {{user_number}}. Their contact information is {{caller_phone}}.
Both variables will contain the same phone number -
{{user_number}}
is the system default, and
{{caller_phone}}
would be your extracted copy . For Conversation Flow, you'd create an Extract Dynamic Variable Node with the same settings [(3) ]() : - Variable Name:
caller_phone
- Description:
The phone number the user is calling from
- Variable Type:
Text
The extracted variable will be stored in
collected_dynamic_variables
and available throughout the call [(4) ]() [(5) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[3] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[4] Update Call](https://docs.retellai.com/api-references/update-call) [[5] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
h
how many tokens is that considered too much for an LLM in specific GPT 4.1 to handle? would you estimate, @AI Evy
a
### Answer --- ### Answer For GPT-4.1 on Retell AI, the LLM prompt token limit is 32,768 tokens [(1) ]() . The platform also has a specific pricing structure for prompts that exceed 3,500 tokens : - Prompts up to 3,500 tokens follow the existing flat rate - Prompts exceeding 3,500 tokens scale proportionally in cost For example: - A prompt with 3,200 tokens will be billed at the base rate - A prompt with 4,500 tokens will be billed at
4500 / 3500 * base rate
GPT-4.1 also supports a 1M token context window [(2) ]() [(3) ]() [(4) ]() [(5) ]() , which means it can handle very long conversations and maintain context across extended interactions [(5) ]() . The example extraction setup you described (storing
{{user_number}}
as
caller_phone
) would be minimal in token usage—likely under 50 tokens for the extraction instruction and variable storage combined. **
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] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[2] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[3] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) [[4] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[5] Smarter AI Phone Calls with ChatGPT-4.1 | Retell AI | Retell AI](https://www.retellai.com/blog/chatgpt-4-1-ai-phone-calling-retell) ​
h
no in my car Assistance says the estimated tokens are around 3616. I don't know if that's like per call or per minute or whatever but like my question to you is like around what number of tokens would be too bloated for an assistant to handle to where I would start hallucinating or negatively affecting the assistant I'm using GPT 4.1 by the way.
@AI Evy no in my car Assistance says the estimated tokens are around 3616. I don't know if that's like per call or per minute or whatever but like my question to you is like around what number of tokens would be too bloated for an assistant to handle to where I would start hallucinating or negatively affecting the assistant I'm using GPT 4.1 by the way.
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
### Answer Based on the available information, 3,616 tokens is within acceptable limits for GPT-4.1 on Retell AI [(1) ]() . The maximum prompt token length is 32,768 tokens by default . However, based on community discussions with Retell engineers, prompts should generally remain below 8,000 tokens to ensure optimal performance [(2) ]() . Using over 33,000 tokens can significantly reduce stability, causing the LLM to become confused and respond inaccurately . Your 3,616 tokens is well within the recommended range and should not cause hallucinations or performance issues. Important context about the token count: - The estimated tokens you're seeing (3,616) likely refers to your prompt size (your agent configuration, instructions, and tool descriptions) [(1) ]() - This is separate from the conversation context that builds up during the call - GPT-4.1 supports a 1M token context window, which handles the accumulated conversation history [(3) ]() Pricing consideration: Since your prompt exceeds 3,500 tokens, you'll incur a proportional surcharge : - Prompts up to 3,500 tokens follow the flat rate - Your 3,616 tokens will be charged at:
(3616 / 3500) * base rate
= approximately 1.03x the base rate [(3) ]() [(4) ]() Recommendation: Your current token count is healthy and shouldn't cause issues. You'd only need to optimize if you approach or exceed 8,000 tokens in your prompt configuration [(2) ]() .
​ To learn more, see the sources I considered: [[1] Understand concurrency & limits](https://docs.retellai.com/deploy/concurrency) [[2] Prompt exceeds the limit of 32768 tokens, please contact support if you need longer context.](https://discord.com/channels/1186424376300679209/1432544872421789789) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[4] LLM Token surcharge error?](https://discord.com/channels/1186424376300679209/1384217732496490507) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.