Agent strategy with automatic self-critique and iterative refinement. Based on Self-Refine (NeurIPS 2023).
A Dify agent strategy plugin that improves output quality through iterative self-critique and refinement.
Self-Refine Agent Strategy implements the Self-Refine (NeurIPS 2023) algorithm, enabling agents to automatically evaluate and improve their own outputs through multiple refinement cycles.
The strategy works by having the LLM act as its own critic:
This approach is particularly effective for tasks requiring high-quality outputs such as writing, analysis, code generation, and complex reasoning.
When configuring the agent in Dify:
To test the plugin locally:
Ensure Dify is running locally (via Docker Compose)
Start the plugin:
The refinement loop follows this pattern:
The agent automatically stops refining when:
Based on the paper:
Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., ... & Clark, P. (2023).
Self-Refine: Iterative Refinement with Self-Feedback.
NeurIPS 2023. arXiv:2303.17651
MIT License
No outbound calls found
Last checked 09/24/2026 03:05 AM · version 0.0.4