[Feature] Support for `dspy.History` in RLM
Author: mannuchCreated Sep 4, 2026Updated Sep 4, 2026
Labelsenhancement
What feature would you like to see?
Hello!
I think it could be very useful to have first-class support for dspy.History inside the RLM module, enabling the LM to see the message history as it builds up. This could be similar to the support inside ReActV2.
This would support continued interactions from earlier runs and you could even add a compaction hook like what's proposed in #10217.
Would you like to contribute?
- Yes, I'd like to help implement this.
- No, I just want to request it.
Additional Context
The main loop inside the RLM paper's associated code, implements compaction inside the RLM iteration loop.
Source: stanfordnlp/dspy