-
-
Notifications
You must be signed in to change notification settings - Fork 17.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add options to filter conversation history messages used in sequential LLM and Agent nodes #3653
feat: Add options to filter conversation history messages used in sequential LLM and Agent nodes #3653
Conversation
- Add new `disableConversationHistory` boolean parameter in LLMNodes.ts and Agent.ts to optionally skip including conversation history in prompts - Fix potential error in Agent.ts when messages array is empty by adding null safety checks - Improve memory efficiency by allowing stateless interactions when history isn't needed
When testing locally, I encountered an error with the agent tool when the "Require Approval" toggle is set to true. However, this issue occurs regardless of whether "Disable Conversation History" is set to false or true, so I suspect the problem is unrelated to the changes in this PR. Feel free to check with the joint "Test flow Agents.json" agent workflow. Additionally, my existing LLM nodes/agent nodes are not updated automatically. I had to create new nodes for the "Disable Conversation History" parameter to appear under additional parameters. I'm unsure if this behavior is expected, but it happens regardless of whether I bump the component versions. |
@jeanibarz |
Yes, exactly! The feature disables the inclusion of historical messages in the prompt but still allows you to manually add specific messages—whether from the prompt or from the script that allow to create custom conversation messages. In theory, this means you could include the initial user query or even the last two messages from the state messages history, for example. Additionally, it’s worth noting that the node will still append its output to the state messages as usual. |
Awesome, I had my fingers crossed that this would come soon. I think a lot of people don't realize the amount tokens they are burning behind the scenes. Hopefully just seeing the option will help increase awareness (on top of control of course). |
I attempted to add a history message when the boolean disableConversationHistory is set to true. Here's what I observed:
|
For approval tools, you need an agent memory attached |
I just tested with AgentMemory and it works when the required approval is true: thank you ! |
Replace the disable conversation history feature with a more flexible filtering system that allows selecting: - User question only - Last message only - All messages (default) - No messages This provides more granular control over conversation context management.
- Remove unnecessary state.messages check for user_question case - Add proper null handling for last_message and all_messages cases - Remove @ts-ignore comments with proper typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you so much @jeanibarz ! really good work
Thank you very much to you for your time and your patience ;-) |
disableConversationHistory
boolean parameter underAdditional Parameters
inAgent
andLLMNode
to optionally skip including conversation history in prompts, improving sequential agent workflow customization capabilities