Prolog-RAG: A Symbolic Reasoning Approach to Retrieval-Augmented Generation
Bailing Zhang, Jiajie Li, Kang Peng, Shuchang Zheng, Kai Meng · 2025
Retrieval-Augmented Generation (RAG) enhances large language models (LLMs) by incorporating external knowledge, but its application in specialized domains like environmental protection remains limited due to challenges in logical reasoning and knowledge updates. We propose Prolog-RAG, a lightweight framework that integrates Prolog-based symbolic reasoning with LLMs to support domain-specific tasks. Prolog enables structured, rule-based inference with high interpretability and low maintenance cost. We develop a Prolog-RAG system for real-world environmental scenarios, such as wastewater diagnostics and policy queries, where precise logic and timely knowledge are essential. Experimental results on benchmark datasets demonstrate that Prolog-RAG significantly improves answer relevance over traditional vector-based RAG methods, particularly in logic-driven and frequently changing domains. This work offers a practical approach to combining symbolic reasoning with generative models, providing a new direction for retrieval-augmented generation in specialized applications.