How does the memory windows size work in chat flow? #33196
Replies: 1 comment
-
|
The window size represents conversation rounds (user + assistant message pairs), not individual messages. So a window size of 1 should include 2 prompt messages (1 user question + 1 assistant response). However, what you're experiencing is a known bug. If you're using an agent node, there's an issue where the code doesn't properly check if LLM nodes handle this correctly by checking both Workaround: If you're self-hosting, you can manually edit prompt_messages = memory.get_history_prompt_messages(
message_limit=node_data.memory.window.size if (
node_data.memory.window.enabled and
node_data.memory.window.size is not None and
node_data.memory.window.size > 0
) else None
)Then restart the backend service. This isn't configurable via environment variables, so the code change is the only reliable fix for now. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
I set the windows size to 1, but when I ask the third question, I see the previous two questions are still sent both as context. I assume it should only contain the latest question I've asked?
Beta Was this translation helpful? Give feedback.
All reactions