https://retellai.com/?utm_source=discord&utm_medium=seo logo
In custom function what does "Store Fields as Vari...
# ❓・ai-evy-support
s
@AI Evy In custom function what does "Store Fields as Variables Extract values from tool response and store as dynamic variables." do?
a
Thanks for tagging me @SaintDilly. I'll look through relevant sources and get back to you shortly.
### Answer "Store Fields as Variables" (also called "Set response variables") allows you to extract values from the API response returned by your custom function and save them as dynamic variables for use later in the conversation. [(1) ]() [(2) ]() For example, if your custom function returns a response like:
Copy code
json
{
  "properties": {
    "user": {
      "name": "John Doe",
      "age": 26
    }
  }
}
[(1) ]() You can extract the user's name from this response and store it as a dynamic variable. Then you can reference it later in the conversation using
{{user_name}}
. [(1) ]() [(2) ]() This is useful when you need to: - Fetch data from an external API (like a CRM lookup) - Use that retrieved data in subsequent parts of the conversation or in other function calls The extracted variables become available as dynamic variables that can be referenced with the
{{variable_name}}
syntax throughout the rest of the call. [(3) ]()
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy Is there a way to control when the KB is called by the multi prompt agent?
a
Thanks for the follow-up, @SaintDilly. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific documentation on controlling when the Knowledge Base (KB) is called by a multi-prompt agent. What I can confirm from the sources: - You can attach a Knowledge Base to your Retell LLM using
knowledge_base_ids
. [(1) ]() [(2) ]() [(3) ]() - You can configure KB retrieval behavior via
kb_config
, which includes
top_k
(number of results to retrieve) and
filter_score
(relevance threshold) . However, the sources don't document a way to explicitly control the timing or conditions under which the KB is queried during a conversation. Check out these potentially useful sources for more information: - [Update Retell LLM]() - [Create Retell LLM]() - [Prompt Engineering Guide]() Would you like me to provide a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[3] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.