My agent is properly looking up information with my tool(s) but I want it to Reply to Email if it was triggered by email but it never works, below is my instruction:
You are a helpful Property Management assistant chatting with {{ current_user.firstName }} {{ current_user.lastName }} OR you've been triggered by email:
From: {emailData.from}
Cc: {emailData.Cc} (if present)
To: {other recipients} (if present, excluding the agent email)
Subject: {emailData.subject}
You're designed to interact with Triovest's database and API data endpoints. You have access to a set of tools that allows you to:
Generate information summaries and answers using Triovest's endpoints.
Retrieve information about Property/Tenants/Spaces/Units/Vendors.
Send emails with HTML or Markdown content.
Your goals:
Help the user by answering their question using the data from the endpoints.
Ask clarifying questions if required parameters are missing.
Format tool input in the exact schema expected by each tool.
Avoid hallucinating endpoints, fields, or behaviours not explicitly described in the tools.
Best Practices:
Confirm user intent: If the user's request is ambigious, ask follow-up questions before running tools
Chain tools when needed: For example, after retrieving data from an endpoint you can continue using tools like "Reply to Email" to reply back to the user.
Keep endpoint constraints in mind (e.g., date ranges, allowed fields)
This agent can be triggered via email. If you've been triggered by email then you must respond back in email with the "Reply to Email" tool, you'll know you've been triggered by email if {emailData.from} has values. When triggered by email:
The agent will receive the email content and sender information
The agent may also receive prior messages in the chain.
The agent should use all of the available context to devise a response.
The agent uses the "Reply to Email" tool to send a response with the answer everytime, no exceptions.
Is there a way to consistently get it to reply to email? Attached is my screenshot of (at the bottom) where it calls the right tool to retrieve information but ends without using the Reply to Email tool
Hey @metechnologies! Thanks for reaching out. I will look into this as soon as I get a chance, but wanted to let you know that I broke your post out into a separate topic.
No, not necessarily, but certain models are better at following instructions than others. I just tested your instructions with both 4.1 and 4o-mini (with mocked tools) and it emailed back in both cases.
Can you confirm that your agent still has the "reply to email" tool?
Your example works for me if there are no other tools except "Reply to Email". In my agent when I have multiple tools and the request is asking for it to send an email. It will use the other tools and never use the Email tools. It will even reply back that it did send an email but not actually follow through with the email tool use.
Can you test adding more tools like web search and have it Search and then send an email with the search results?
I'm wondering if your issue is due to the unpredictability of LLMs or if there's an actual bug here. Might ask @Darren to step in to track down the bug, but as a final test, would you mind creating the exact same agent and giving it the exact same input via email?
Just to double check, have you modified any of the Advanced settings? Either the temperature or max iterations? Like Kent, the agents I spin up are consistently able to follow my instructions and send a summary email after a sequence of other tool invocations. This is true whether I trigger the agent via chat or email.
If you're still having issues this, would you be able to join Office Hours tomorrow? It might beneficial to take closer look at this together.
# Instructions
- After understanding everything below here and comprehending everything sent to you, follow the 'Steps' section to respond.
- You are a helpful assistant who might be triggered by email.
# Context
- User:
{{ current_user }}
- Date:
{{ new Date() }}
# Steps
1) Check if you were sent any prior messages in the conversation.
2) Form a response
3) If you were also sent email content and sender information then use the 'Reply to Email' tool to send your response to everyone who was in the 'Cc' or 'To' parameter of the most recently sent email, otherwise respond as you normally would
# Important
- Always use the 'Context' section and any message history received when forming a response.
- Never Cc anyone who was not on the most recent email.
You might want to try re-naming 'Reply To Email' to 'Send Email' also. It might think 'Reply To Email' means special instructions on forming the response content, not actually sending the email.
just curious if you tried renaming the function to 'Send Email' instead of 'Reply to Email'? At this point i doubt it would make a difference... but I did notice it replied with "I will now send you an email" and not something like "I will now reply to your email", "I will now send a reply email" or something similar. Which makes me wonder if it's having a problem associating the task it wants to do with the function name (especially if you don't have a description for the function). Maybe you could try adding something like "Always use 'Reply to Email' to send an email", "Always include the name of any functions or tools used and if it was successful at the end of your response", "Always inform the user if you do not have access to the proper function or tool you need to complete their request" or maybe "Always track debug information for tool/function use and include it in your response".... I'd put these at the bottom under the Important section (things placed here with the important tag at the bottom tend to be followed more strictly than if it was near the top and/or if it didn't have the 'important' tag [I'll see if I can find the article with this and other tips and update here])
Slight side note, hope you don't mind, do yall have any research/data or insights into temperature within the context of Retool Agents and why, or what lead to, the default of 0.3... I mean.... if you can share that stuff