FURI | Spring 2026

Translating NL queries into UDF-centric SQL queries using LLMs

Data icon, disabled. Four grey bars arranged like a vertical bar chart.

Existing text-to-SQL systems assume all necessary database functions are predefined, yet real-world queries often require custom logic that must be generated on demand. This research investigates whether Large Language Models (LLMs) can translate natural language queries into both the required User-Defined Functions (UDFs) and the SQL queries that depend on them, using a multi-agent framework with iterative verification that evaluates correctness without relying on ground truth. Applied to a clinical dataset of 785,000 medical records, the system achieves full accuracy across seven medical UDF scenarios while an ablation-based memory analysis identifies which components of agent history are essential for reliable verification. Future work will systematically reduce specification requirements to evaluate how much domain logic LLMs can infer from natural language alone.

Student researcher

Catlynh Nguyen

Computer science

Hometown: Gilbert, Arizona, United States

Graduation date: Spring 2027