An AI agent that rewrites its own code generation after generation — with no human edits and without changing the underlying model — measured on a real, ungameable task: turning English questions into SQL.
Given a plain-English question (“How many singers do we have?”) and a database, produce a SQL query that returns the right answer. This is text-to-SQL, benchmarked on Spider — 200+ real databases and thousands of questions from Yale.
We grade with execution accuracy: actually run the predicted SQL and the gold SQL against the database and check the result sets match. It’s exact, instant, and hard to fake — you can’t bluff it with plausible-looking SQL. It either returns the right rows or it doesn’t.
SIA (a real framework, hexo-ai/sia) runs three AI agents in a loop:
improvement.md, and rewrites the target agent for the next generation.Repeat. The crucial constraint: the answering model never changes (Claude Haiku, every generation). The only thing that changes is the harness — the agent’s own scaffolding, prompt, and code. So any accuracy gain is provably the agent rewriting itself, not a bigger model.
The gold answers live in data/private/ and are never given to
the agent — it only sees the questions, the schemas, the databases, and a separate labeled
training pool. So gains are real generalization, not memorizing an answer key. The verifier
runs every query read-only with a timeout and rejects anything that isn’t a single
SELECT/WITH. (Judges call this the “Goodhart” test — a verifier you
can’t cheat.)
By reading its own failures, the feedback-agent invented concrete, non-obvious fixes:
SELECT count(*), col (aggregate first) and added that rule.Jetblue when the data said JetBlue).> MIN, not > MAX.It even caught and fixed a regression it caused itself: gen 2 over-applied a rule, then gen 3 detected that from the new failures and corrected it. That self-correction — reasoning about the consequences of its own past edits — is the heart of the demo.
Across generations, execution accuracy climbed 75.8% → 79.2% → 88.3% → 93.3% — every point a self-discovered harness change, with the model held fixed the whole time.
See it live in the demo →