A Hybrid RAG–Text2SQL Architecture for Auditable Question Answering in Brazilian Portuguese Legal-Administrative Collections - Silva, Josiel Pantaleão Cardoso; de Oliveira, Sávio Salvarino Teles; Brakes, Matheus Fares Costa; Presa, João Paulo Cavalcante (Anais do Simpósio Brasileiro de Banco de Dados (SBBD); 2026: Anais do XLI Simpósio Brasileiro de Bancos de Dados, 2026)
Question answering over Brazilian Portuguese legal-administrative collections must support semantic information needs and structured intents such as counting, filtering, aggregation, and ranking. Retrieval-augmented generation (RAG) grounds answers in text, but it does not reliably execute relational operations. Standalone Text2SQL can execute auditable queries, but lacks textual grounding and explanatory coverage. This paper presents a hybrid architecture that runs semantic retrieval and a constrained Text2SQL pipeline in parallel and synchronizes both outputs into a single answer. The structured branch includes column routing, schema restriction, normalized derived columns, WHERE-hints, read-only execution policies, and decomposition for multi-intent questions. We formalize the evaluation protocol for structured and semantic queries, define the proposed metrics, and clarify the role of the LLM-based judge used for semantic assessment. On a curated TCE-GO corpus, the hybrid architecture outperforms a RAG-only baseline on structured queries while remaining competitive on semantic ones. The contribution lies in showing how semantic retrieval and constrained SQL execution can be combined for Portuguese legal-administrative QA with explicit safety, auditability, transparency, and evaluation policies.