How can I control whether a specific message is included in the conversation history? #26256
Replies: 1 comment
-
Dify does not currently support explicit, per-message control over whether a specific message is included in the conversation history. Message inclusion is managed automatically based on thread structure, message type (system/user), and token or window limits in memory. There is no API parameter, flag, or configuration to exclude or include arbitrary individual messages from history. The only exception is in the frontend, where messages marked as If you need custom filtering (for example, to exclude messages with certain content or tags), you would need to modify the backend logic that retrieves and processes conversation history, such as in the agent runner or prompt transform classes see code see code. This could involve adding custom filters before messages are included in the prompt or memory. Let me know if you have a specific use case or need guidance on where to implement such filtering in the codebase. 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
1. Is this request related to a challenge you're experiencing? Tell me about your story.
How can I control whether a specific message is included in the conversation history?
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions