Data Intelligence Agents: Interpreting, Modeling, and Querying Enterprise Data via Autonomous Coding Agents
TL;DR Highlight
SQL 한 줄 못 써도 CSV 올리면 DB 만들고 자연어 질문에 SQL 자동 생성·검증까지 해주는 3-에이전트 시스템, 7개 벤치마크 모두 SOTA 달성.
Who Should Read
자연어로 DB를 쿼리하는 Text-to-SQL 파이프라인을 구축하거나 개선하려는 백엔드/데이터 엔지니어. 엔터프라이즈 데이터 분석 자동화를 고민하는 AI 애플리케이션 개발자.
Core Mechanics
- Data Interpreter → Schema Creator → Query Generator 3개 에이전트가 샌드박스 내 ACA(Autonomous Coding Agent, 코드를 직접 실행하는 에이전트)를 공유하며 원시 CSV/JSON/Excel을 DB로 만들고 자연어 질문에 SQL로 답변.
- 텍스트 대신 '실행 가능한 아티팩트'(스키마, 스크립트, 쿼리 로그)를 워크스페이스 파일로 주고받아서 에이전트 간 handoff 손실을 없앴고, 도메인 전문가가 각 단계를 리뷰할 수 있음.
- 공유 메모리를 3단계로 운영: 유사 사례 검색(episodic), 현재 DB 규칙(session lesson), 여러 DB에 공통 적용되는 규칙(cross-session lesson). 학습이나 사람 판단 없이 실행 결과만으로 규칙 승격.
- Query Generator는 쿼리 실행 전 '예상 결과 형태(shape declaration)'를 먼저 선언하고, 실행 후 결과가 선언과 다르면 자동으로 진단·수정하는 self-verification 루프를 내장.
- BIRD-Interact 같은 대화형 쿼리에서는 3번 연속 오답 시 강제로 ASK(명확화 질문)를 하게 해서 '같은 SQL 계속 재시도하다 턴 소진'하는 stuck-loop 실패 패턴을 차단.
- 파인튜닝 없이 Claude Sonnet 4.5 + OpenHands 하나로 SQLite·PostgreSQL·Snowflake·DuckDB 4개 dialect, 생성·디버깅·대화형·프로젝트 완성 4개 태스크를 커버.
Evidence
- BIRD-Interact(대화형 쿼리)에서 최고 기존 시스템 22.7% 대비 55.7%로 +33.0%p 차이. 기존 최강 시스템 MERIT+GPT-5.4를 2배 이상 앞섬.
- Spider2-Lite에서 기존 최고 ReFoRCE+o3(55.2%) 대비 71.3%로 +16.1%p, BIRD-Critic 디버깅에서 Gemini 3.1 Pro Preview(48.8%) 대비 64.2%로 +15.4%p.
- BIRD-Dev(가장 포화된 벤치마크)에서 RL로 특화 학습한 전문 모델 MARS-SQL(77.8%)과 사실상 동률(77.7%)을 파인튜닝 없이 달성.
- 7개 벤치마크 전부에서 기존 최고 결과와 동일하거나 초과. 실패 사례 분석에서 SQL 문법 오류(execution failure)는 전체 실패의 3% 미만으로, 남은 오류 대부분은 의미론적 추론 문제.
How to Apply
- Text-to-SQL 에이전트를 만들 때, SQL을 바로 생성하지 말고 먼저 'shape declaration(예상 컬럼 목록·행 granularity·정렬·필터)'을 선언하게 하고, 실행 후 결과와 선언을 비교해 불일치 시 자동 재시도하는 루프를 추가하면 output-convention 오류를 크게 줄일 수 있음.
- 대화형 SQL 에이전트에서 같은 구조의 쿼리를 반복 재시도하는 루프가 생기는 경우, '3번 연속 동일 구조 오답 → 강제 clarification 질문' 정책과 '직전 시도와 동일한 SQL 재전송 금지' 규칙을 추가하면 turn 낭비를 막을 수 있음.
- 에이전트 메모리를 구성할 때 '이번 DB에서만 유효한 규칙(session lesson)'과 '여러 DB에 공통 적용되는 규칙(cross-session lesson)'을 분리 저장하고, cross-session 승격은 실행 검증이 통과한 경우에만 허용하면 stale 경험이 전파되는 문제를 방지할 수 있음.
Code Example
## DIA Query Generator 핵심 패턴 — Shape Declaration + Self-Verification
# STEP 1: 질문에서 예상 결과 형태 선언 (SQL 실행 전)
OUTPUT_CONTRACT = """
cols: [account_id, latest_date]
rows: ~one per account (~4500)
order: none specified
filters:
- transactions whose amount > account-level mean
"""
# STEP 2: Schema probe (컬럼명·값 형식 확인)
probe_result = query_db("SELECT DISTINCT status FROM transactions LIMIT 10")
# -> 'Banned', 'Restricted' (Title Case 확인)
# STEP 3: SQL 생성 및 실행
candidate_sql = """
WITH t_with_avg AS (
SELECT account_id, date, amount,
AVG(amount) OVER (PARTITION BY account_id) AS acct_avg
FROM trans
)
SELECT account_id, MAX(date) AS latest_date
FROM t_with_avg
WHERE amount > acct_avg
GROUP BY account_id;
"""
result = query_db(candidate_sql)
# STEP 4: Self-verification — 선언한 shape과 실제 결과 비교
def verify(result, contract):
checks = {
"col_count": len(result.columns) == len(contract["cols"]),
"row_plausible": abs(len(result) - contract["expected_rows"]) / contract["expected_rows"] < 0.1,
"no_spurious_null_filter": "IS NOT NULL" not in candidate_sql or explicitly_required,
}
if not all(checks.values()):
# 실패 시 진단 후 재생성
diagnose_and_retry(result, contract, checks)
return checks
# STEP 5: Cross-session memory 업데이트
# 실행 관찰이 확인된 경우에만 규칙 기록
if observation_confirmed_on_live_db:
memory.write({
"rule": "COUNT(DISTINCT pk) not COUNT(*) when joining one-to-many",
"evidence": "COUNT(*) returned 9977, COUNT(DISTINCT CDSCode) returned 1",
"scope": "cross-session" # 여러 DB에서 재확인된 경우만
})Terminology
Related Papers
TREX: An AI code reviewer that runs your code
Greptile가 PR 리뷰 시 코드를 실제로 실행해서 런타임 버그까지 잡아주는 TREX를 공개했다. 정적 분석만으로는 발견할 수 없는 race condition, UI 회귀, 상태 의존 로직 버그까지 커버한다.
Written by AI, Managed by AI: Semantic Space Control and Index Sickness Elimination Across 391 Consecutive Sessions
LLM과의 장기 협업에서 규칙과 심볼을 쌓을수록 AI가 더 멍청해지는 이유와, 파일 분리만으로 이를 해결한 실전 기록
How to setup a local coding agent on macOS
인터넷 없이도 쓸 수 있는 로컬 코딩 에이전트를 macOS에서 구축하는 방법을 정리한 글로, llama.cpp + MTP 스펙큘레이티브 디코딩으로 58 tok/s에서 72 tok/s까지 속도를 끌어올린 실제 벤치마크와 설정법을 공유한다.
When Errors Become Narratives: A Longitudinal Taxonomy of Silent Failures in a Production LLM Agent Runtime
LLM 에이전트가 내부 오류를 그럴듯한 가짜 분석 리포트로 변환해 사용자에게 전달하는 'fail-plausible' 장애 패턴을 8주간 22건의 실제 사고로 분석한 논문.
AI agent bankrupted their operator while trying to scan DN42
자율 AI Agent가 DN42 취미 네트워크에 가입해 전체 스캔을 시도하면서 AWS 인프라를 무분별하게 프로비저닝한 결과, 운영자에게 하루 만에 $6,531.30짜리 청구서가 날아온 실제 사건 기록이다.
HyperTool: Beyond Step-Wise Tool Calls for Tool-Augmented Agents
여러 MCP 툴 호출을 코드 블록 하나로 묶어 LLM 에이전트의 컨텍스트 낭비와 추론 단절을 동시에 해결하는 기법
Related Resources
Original Abstract (Expand)
Production data integration is bottlenecked by repeated, lossy handoffs between data owners, engineers, and analysts who must collaboratively discover, structure, and query enterprise data. We present Data Intelligence Agents (DIA), a system of three agents (Data Interpreter, Schema Creator, and Query Generator) that compresses this workflow by treating autonomous coding agents (ACAs) as a first-class abstraction: rather than emitting text, the agents generate, execute, validate, and repair concrete artifacts, draw on a shared memory for experience reuse, and surface each for review by domain experts. DIA is deployed in production for enterprise customers. We study the Query Generator in depth and evaluate it in fully autonomous mode across seven SQL benchmarks spanning four task categories and four dialects. It matches or surpasses the best published results on all seven, demonstrating that an architecture grounded in execution, built on ACAs and a shared memory, generalizes across the data intelligence workload with adaptation confined to natural-language instructions.