STACKFEED: Structured Textual Actor-Critic Knowledge Base Editing with Feedback

Large Language Models (LLMs) are increasingly used for complex software engineering tasks but often generate incorrect or outdated code. Retrieval-Augmented Generation systems attempt to solve this by using external knowledge bases (KB) like API documentation, but in the fast-paced world of software development, this documentation itself quickly becomes outdated. To address this critical gap, we introduce STACKFEED, a novel Structured Textual Actor-Critic Knowledge base editing with FEEDback approach that iteratively refines documentation using feedback from oracles, such as compiler errors or test failures, via a multi-actor, centralized critic architecture. Each document in the KB is managed by a dedicated ReACT actor agent that performs structured edits based on targeted instructions from the critic. We demonstrate STACKFEED’s effectiveness on challenging software engineering scenarios, including code generation for a low-resource language, outdated Python library documentation, and large-scale real-world repository migration using the MigrationBench benchmark. Our experiments show that STACKFEED significantly improves KB quality, leading to more accurate and reliable code generation.