-
My goal: I'm trying to use the new Agent Chat component in one of my apps as I've built an agent to handle a common workflow. My use case requires the user to be able to clear the chat and start a new session (without refreshing the page)
-
Issue: There doesn't seem to be any method to clear/reset the Agent Chat component, or start a new session. Are there any plans to add this functionality, or am I just missing it somewhere?
-
Additional info: Cloud Retool
Hey welcome back to the Community @jcace!
The option to auto clear the LLM Chat component on page load is not available yet. We have a feature request open and I added your +1.
For now, the simplest workaround is to add a short delay, then call clearHistory() after the component loads. Just a heads up that you may see a quick flash of the previous messages before they clear.
Hope this is helpful, let me know! ![]()
Hi @ChiEn , thanks for getting back to me.
Could you please let me know how/where to call this clearHistory() function? I don't see it in the event handler dropdown, and in a JS Query component it says
agentChat1.clearHistory is not a function . Attached some screenshots below for context.
@jcace, I'm curious if there's anything preventing you from giving your end users access to the built-in Agent chat to accomplish this task, rather than using the in-app component?
Hey @jcace, I apologize. I misread this. That function was meant for the LLM Chat component and does not work for Agents Chat component. I have filed a feature request internally for you! ![]()
In the meantime, could you take a look at @kent’s question? That will help us build a better understanding, thank you!
Thanks @ChiEn !
@kent , our use case is a work order / estimate builder, which we use to build client-facing documents that are exported as PDF once complete.
In the retool app, our team can input line items (SKUs), labour hours and work descriptions - so we've built components for that functionality (for example, "look up product by SKU").
We're exploring the Agent chat component as an "assistant" - the idea is to have it in the sidebar, to help templating out these work orders using prompts. We still need the fine-grained ability to edit individual items - hence using the Agent chat in-app component in a sidebar, instead of just the Agent chat.
Ah makes perfect sense, thank you. For this use case, do you also need the ability to have different chat threads, or is the single chat sufficient? Do you need to pass additional context into the agent chat query (like, for example, table1.selectedRow.someValue)?
These are the types of things we’re thinking about for the in-app agent chat, so curious for your take.
Yes, clear and sending context would be so great. I’ve been struggling so bad today being able to send context to the agent chat
And somehow being able to trigger queries based on either reply or adding context to the return message would also be a lovely scenario :-)![]()
@rlynggaard_Vertica would something like address your needs?
That is hoe I’ve done it, but not the most user friendly way. It would be great if the query had a parameter (key value pairs) that you could the refer to in the system message in the agent. That way it would be user friendly and the context would go into the system message and not just in a user message that might get lost in a longer conversation.
It would also be very nice if there was a way to set return parameters from the agent (maybe using a tool) that was sent back as a property on the query response that goes back to the chat/trigger
Context management in agent chats is frustrating when you need control over what gets passed through. Retool's agent component can be limiting for workflows where you want to trigger queries based on responses or inject specific context.
Weavy's AI Copilot component handles this out of the box - you can programmatically send context, clear history, and trigger actions based on agent responses. It integrates with OpenAI, Claude, or Gemini and works as a drop-in Web Component in Retool's custom component framework.
What kind of context are you trying to pass through? Query results, user data, or something else?

