[FEATURE] Allow hiding LLM/Agent Output from Message History
I am currently building an agent flow, where an LLM is deciding what to do next. The LLM generates JSON for a Condition node, and the Condition will reroute the flow based on the input of the LLM. There is really no need for the output of the LLM to be added to the message history. Not only would it safe tokens to be able to hide the output of the LLM, but the unnecessary messages actually make it harder for following LLMs to 'understand' the context.
I would like to see a simple checkbox "Do not copy to history" on LLMs and Agents. If checked the output is handed over to the next node as usual, but it doesn't appear in the chat history.
if you are using embedded, you can turn it off by showAgentMessages: false: https://github.com/FlowiseAI/FlowiseChatEmbed?tab=readme-ov-file#configuration
@HenryHengZJ I don't want to hide the output from me, but from the other LLMs down the line in the workflow. I want to decide, which messages are added to the history and which are not.
Or add a node that allows removing messages from the state. Langgraph has an example here.
This is a very desired feature, any updates on it? I have similar issue, where state.messages are piling up to a point where agents just get lost. Not to mention the token usage.
I have a similar same issue. I want to clear the conversation history or "disable" appending some output to the list of messages, but I'm not able to achieve that. Any solutions ?
I opened a PR to add a parameter in the Agent Node and LLM Node that disables the insertion of messages from the state: View PR