Self-Optimizing Enterprise RAG+SQL Knowledge Agents: Unified Retrieval, Schema-Aware Query Translation, Event Graph Reasoning, and Adaptive Model Routing
Year: 2026
Type: preprint
Abstract: Enterprise knowledge is fragmented across relational databases, PDFs, incident reports, tickets, logs, spreadsheets, policy documents, and operational runbooks. Retrieval-augmented generation (RAG) systems help with unstructured text, while text-to-SQL systems help with structured databases, but production workflows frequently require both forms of reasoning in the same answer. A finance analyst may ask for contract terms and revenue aggregates; a compliance officer may ask for a policy exception and the exact affected accounts; a support lead may ask for the causal sequence behind an incident and the customer records touched by it. This paper introduces the Self-Optimizing Enterprise RAG+SQL Knowledge Agent, a middleware architecture that unifies schema-aware SQL translation, document retrieval, event-schema knowledge graphs, execution validation, and adaptive model routing. The proposed agent decomposes enterprise questions into typed evidence plans, retrieves from hybrid vector and graph indexes, prunes relational schemas through schema relationship graphs, executes SQL in bounded read-only sandboxes, composes multi-source evidence, and continuously up-dates routing and retrieval policies from observed quality, latency, cost, and validation feedback. The design extends prior work on schema-aware query translation, EventForge hybrid RAG+KG storage, LLM-Advisor dynamic model routing, and feedback-control allocation. We provide a detailed architecture, objective function, routing policy, validation protocol, benchmark design, implementation blueprint, and risk analysis. The central claim is that enterprise question answering should be treated as a self-optimizing control problem over heterogeneous knowledgetools, not as a single prompt over retrieved text.
Source: Research Square
Author: Harshil Lodhiya
Language: English
Topic: Topic Modeling
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7204159978
