RAG-Reflect: Agentic Retrieval-Augmented Generation with Reflections for Comment-Driven Code Maintenance on Stack Overflow
Mehedi Hasan Shanto, Muhammad Asaduzzaman, and Alioune Ngom

TL;DR
This paper introduces RAG-Reflect, a modular framework using retrieval, reasoning, and self-reflection with large language models to predict whether user comments on Stack Overflow trigger code edits, achieving high accuracy without task-specific training.
Contribution
The paper presents RAG-Reflect, a novel, task-agnostic framework that combines retrieval-augmented reasoning and self-reflection to predict comment-edit causality in software maintenance.
Findings
RAG-Reflect achieves an F1 score of 0.78, outperforming traditional baselines.
The framework approaches fine-tuned model performance without retraining.
Both retrieval and reflection modules significantly improve prediction accuracy.
Abstract
User comments on online programming platforms such as Stack Overflow play a vital role in maintaining the correctness and relevance of shared code examples. However, the majority of comments express gratitude or clarification, while only a small fraction highlight actionable issues that drive meaningful edits. This paper demonstrates how agentic AI principles can revolutionize software maintenance tasks by presenting RAG-Reflect, a modular framework that achieves fine-tuned-level performance for valid comment-edit prediction without task-specific training. Valid Comment-Edit Prediction (VCP) is the task of determining whether a user comment directly triggered a subsequent code edit. The framework integrates large language models (LLMs) with retrieval-augmented reasoning and self-reflection mechanisms. RAG-Reflect operates through a three-stage runtime workflow built on a one-time…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
