ABSTRACT: Debugging remains one of the most cognitively demanding tasks in software development, particularly for novice programmers, due to the limited interpretability of traditional compiler and runtime error messages. Existing solutions, including integrated development environments (IDEs), online forums, and generic AI assistants, fail to provide context-aware, code-specific explanations within a unified workflow. To address these limitations, this paper presents a RAG-augmented AI Code Debugger that integrates Retrieval-Augmented Generation (RAG) with locally deployed Large Language Models (LLMs) for explainable and context-aware error analysis.
The proposed system combines a browser-based code editor with a FastAPI backend, a subprocess-based execution engine, and a multi-stage AI pipeline consisting of error parsing, semantic retrieval using ChromaDB, and inference via a locally hosted DeepSeek Coder model using Ollama. A composite query strategy, incorporating error type, error message, and faulty code snippets, is used to retrieve relevant debugging knowledge from a structured knowledge base, which is then injected into the LLM prompt to improve response grounding. The system generates structured outputs including error interpretation, root cause analysis, and corrected code, enhancing both usability and educational value.
Experimental observations demonstrate that the integration of RAG significantly improves the relevance and specificity of debugging explanations compared to direct LLM prompting. Additionally, the use of on-device LLM inference ensures data privacy, eliminates API dependency, and enables cost-effective deployment. The system also introduces an interactive mechanism for handling input-dependent programs, improving robustness in real-world debugging scenarios. Overall, the proposed approach highlights the effectiveness of combining retrieval-based reasoning with local LLMs to build intelligent, explainable, and scalable debugging assistants.
KEYWORDS: Retrieval-Augmented Generation (RAG), Large Language Models (LLMs), Code Debugging, Explainable AI, ChromaDB, Semantic Search, Ollama, DeepSeek Coder, Software Engineering, AI-Assisted Development


Downloads: PDF | DOI: 10.17148/IARJSET.2026.13473

How to Cite:

[1] R Sivani, T Aakash, Christon Davis, T Hari Srinivas, N Saraswathi, "An Explainable AI-based Code Debugger for Programming Error Understanding," International Advanced Research Journal in Science, Engineering and Technology (IARJSET), DOI: 10.17148/IARJSET.2026.13473

Open chat