https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> is there a way to trigger a...
# ❓・ai-evy-support
n
@AI Evy is there a way to trigger a tool call function at the start of every call before the multi prompt agent says anything?
a
Thanks for tagging me @nick_00964. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Build a multi-prompt agent]() * [Step 2: Configure the basic settings]() * [Prompt Overview]() * [End call]() -----------------------------
### Answer Yes, you can trigger a tool call function at the start of a multi-prompt agent call by: 1. Configure your agent to use "Agent-First" conversation initiation in the basic settings [(1)]() 2. In your starting state prompt, include explicit instructions to call your function immediately Based on community feedback, to ensure reliable function calling, use phrases like "immediately and reliably call [function_name]" in your prompt. [(2)]() [(3)]() For example, you could add this to your initial state prompt:
Copy code
Immediately and reliably invoke the [your_function_name] function at the start of the call without fail. This is critical and non-negotiable.
[(3)]() For best practices with functions in multi-prompt agents: - General functions (like those you want to call at the start) should be kept at the agent level rather than state-specific [(4)]() - Adding a number to the function name in your prompt (e.g., "call function your_function_123") may help the AI identify it more reliably as a function - Make the instruction explicit and treat it as a high-priority action in your prompt [(3)]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
For clarification where exactly should I paste the initial state prompt
@AI Evy For clarification where exactly should I paste the initial state prompt
a
Thanks for the follow-up, @nick_00964. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Step 2: Configure the basic settings]() * [Build a multi-prompt agent]() * [Prompt Overview]() * [Platform Changelogs | Retell AI]() -----------------------------
### Answer When creating a multi-prompt agent, you should place your function call instruction in two specific places: 1. In your initial state prompt For a multi-prompt agent, you need to add the function call instruction in the first state of your prompt tree. Based on community examples, you can structure it like this:
Copy code
## Task:
1. Use the 'your_function_name' function to [purpose] (do not say this out loud, this is just for your reference).
2. Introduce yourself, stating that you are [name] from [company].
3. [Continue with other tasks...]
[(1)]() 2. Configure Conversation Initiation settings Make sure your agent is set to "Agent-First" mode in the basic settings: * Go to "Configure Conversation Initiation" * Select "Agent-First" (Agent initiates the conversation) * You can either set a fixed welcome message or use prompts to guide the agent's opening message [(2)]() This combination ensures your function is called immediately when the call begins, before any conversation with the user starts. For reference, the multi-prompt approach allows you to create a structured tree of prompts where each node can contain its own specific prompt, custom function calling instructions, and clear transition logic to other nodes. [(3)]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy I'm sorry this is still not clear. Can you share screenshots?
a
Thanks for the follow-up, @nick_00964. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Build a multi-prompt agent]() * [End call]() * [Step 2: Configure the basic settings]() * [Prompt Overview]() -----------------------------
### Answer I understand you're looking for screenshots, but I don't have the ability to share screenshots that aren't in the information sources. However, I can provide clearer instructions based on the documentation: 1. Configure Agent-First setting: - In the basic settings section, find "Configure Conversation Initiation" [(1)]() - Select "Agent-First" option (Agent initiates the conversation) - This setting allows your agent to speak first and execute functions before user input 2. Add your function: - Click "+ Add" in the tools section and select "Custom Function" from the dropdown menu [(2)]() - Configure your function with name, description, endpoint URL, and parameters 3. Add function call to initial state: - In your multi-prompt agent's first state, add explicit instructions to call the function [(3)]() - Based on community feedback, make the instruction very explicit: "Immediately and reliably invoke the [function_name] function" [(4)]() For better results with function calling, community members suggest: - Add a number to the function name in your prompt (e.g., "call function your_function_123") [(5)]() - Keep general functions at the agent level rather than state-specific For more detailed guidance, I recommend checking the documentation links or joining the Retell Discord community for visual examples and support.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.