Apply to my task
arXiv:2610.23317 ★ 86 Oct 16, 2026

AgentOnto: A Business Glossary Instead of Guesswork, So Your Analyst Agent Stops Fudging the Numbers

Key result

The problem: the database query ran without errors, but the number in the report is wrong. The agent didn't know your "revenue" excludes returns and tax. AgentOnto lets you get numbers from an analyst agent computed by your rules, not its guesses, and get an honest "the data can't tell us that". Before work starts, the agent gets an explicit dictionary of business concepts (an ontology): entities, metric definitions and table mappings. The agent first drafts a plan that cites the dictionary, then checks the plan, and only then writes the query. The twist: the agent has three moves, not one. Execute, clarify or decline. A question without the needed data doesn't end in a pretty fabrication.

01

TL;DR

AgentOnto is a data-analysis agent that gets an explicit dictionary of business knowledge (an ontology) before it starts work. The dictionary has three parts: entities (customer, order), metric definitions ("revenue" = what counts and what's excluded), and mappings to database tables and columns. The agent doesn't jump straight to SQL. First it drafts a plan that cites the dictionary, then it checks the plan against the dictionary, and only then does it run the query.

The core pain: the SQL query ran without errors, but the number is wrong. The agent didn't know that your "revenue" excludes returns, or that an "active customer" means a purchase in the last 90 days. None of that is in the database schema. Those rules live in documents and in analysts' heads. The agent guesses them and quietly gets them wrong. The authors call this a silent semantic error. It's even worse when the agent answers a question the data simply can't answer.

Here's how the method fixes it. Knowledge from the database, documents and past example tasks is merged into a single dictionary where every entry carries a source and a confirmation status. The agent always picks one of three actions: execute, clarify or decline. The dictionary is later updated from confirmed feedback. Every change is tested with two sets of questions: what should change and what must stay the same. Before going live, the dictionary gets a dry run on self-generated tasks.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

STEP 1. BUILD THE DICTIONARY: database + documents + example tasks
        → entities / metrics / table mappings
        (every entry has: source + "confirmed" status)
        Confirmation is a separate model pass.

STEP 2. WARM-UP (2 rounds × 4 tasks): the model invents its own questions,
        solves them using the dictionary, a separate pass checks the answers
        → any gaps found get added to the dictionary

STEP 3. HANDLING A REQUEST:
        request → decision: execute / clarify / "not supported"
        → plan with references to the dictionary
        → check the plan against the dictionary (entities exist? metric follows the rules? mapping exists?)
        → SQL from the mappings → execution

STEP 4. UPDATE from confirmed feedback:
        edit a single entry
        → "should change" checks + "should stay the same" checks
        → accept the edit only if both groups pass; otherwise roll back

In the original, this is a coded system. Steps 1–4 run automatically, and the model is called at each step.

03

Example in Practice

The method shines where your data has non-obvious business rules that aren't reflected in column names. There's no point using it for a one-off simple export.

Task: You sell on Amazon and Etsy. Your sales export sits in Google Sheets or a database, and an agent (Claude Code, Cursor or a custom GPT) is looking at it. The owner asks: "What's our revenue for the Home category in April, and how many active buyers do we have?" The tables have statuses like "delivered", "returned" and "canceled", and prices include tax. The agent has no idea that your revenue counts delivered orders only, minus returns, net of tax.

Prompt (put it in the system prompt or CLAUDE.md):

<Ontology>
  <Entities>
    Order(orders): order_id, status ∈ {delivered, returned, canceled}, price_gross, vat_rate, sku_id, buyer_id, delivered_at
    SKU(skus): sku_id, category
    Buyer: buyer_id (only inside orders; no personal data)
  </Entities>
  <Metrics>
    Revenue = SUM(price_gross / (1 + vat_rate)) over orders with status='delivered' MINUS the same sum over status='returned'.
      Source: "Reporting Policy v3", section 2. Status: confirmed.
    Active buyer = buyer_id with ≥1 delivered order in the last 90 days before the report date.
      Source: example task #14. Status: NOT confirmed (needs review).
  </Metrics>
  <Mappings>
    Revenue → orders.price_gross, orders.vat_rate, orders.status; category → JOIN skus ON orders.sku_id = skus.sku_id
  </Mappings>
</Ontology>

<Procedure>
For every request:
1. Decide the action: EXECUTE / CLARIFY / UNSUPPORTED.
   CLARIFY — if the request is missing information (period, channel).
   UNSUPPORTED — if the request needs data that isn't in the dictionary (e.g., margin: there's no cost data).
2. Write a PLAN: which Ontology entries you use, and which choices you made yourself (period, filters).
3. CHECK THE PLAN: are all entities in Entities? Is the metric computed exactly per its definition? Is there a Mapping for every field?
   If not — fix the plan or change the action.
4. Only after the check, write the query and run it.
5. In the answer show: the action, the plan, which Ontology entries were applied, the result. Mark metrics with "not confirmed" status as preliminary.
</Procedure>

Result: The agent first states its decision ("execute" or "clarify") and a plan that cites the definitions. Then it shows the plan check: returns and tax are accounted for. Only after that do you get the query and the final number. Ask about margin and the agent should reply "not supported: no cost data". It will flag "active buyers" as preliminary, because that definition isn't confirmed.

04

Why It Works

The weakness. An LLM writes a plausible query based on column names and guesses the business meaning. If the query runs, nobody notices the number was calculated "not your way". On top of that, "an answer was returned" ≠ "the answer is right": a high answer rate doesn't guarantee correct answers.

The strength. The model is good at following explicitly written definitions and at checking a plan against a checklist. It can also come up with test questions from documents and work through discrepancies.

How the method exploits this. Knowledge moves out of the analyst's head into one auditable document, and the plan gets checked before execution. Edits are tested for "regressions": you fixed the "active buyer" metric without breaking "revenue".

Control knobs: - Confirmation status → treat only confirmed definitions as "hard" and mark the rest as preliminary. - Number of warm-up rounds and tasks (2×4 in the paper) → increase for a big database, decrease for a small one. - Three actions (execute / clarify / decline) → add your own, e.g., "hand off to a human". - "Will change" and "will stay" checks → keep building a set of questions with known answers; it becomes your test suite.

05

Prompt Template

The authors don't publish prompts; they describe a coded system. Below is the idea translated into a text instruction following its structure. It's not a verbatim prompt from the paper.

<Role>
You are a data analyst. You do not write a query until you have checked it against the Ontology.
</Role>

<Ontology>
  <Entities>
    {entities: tables, key fields, allowed values}
  </Entities>
  <Metrics>
    {metric} = {formula and conditions of use}. Source: {document/example}. Status: {confirmed / not confirmed}.
  </Metrics>
  <Mappings>
    {concept} → {table.column, JOIN relationships}
  </Mappings>
</Ontology>

<Procedure>
For every request {request}:
1. action = EXECUTE | CLARIFY | UNSUPPORTED.
2. plan: which Ontology entries are used; which assumptions are made beyond it.
3. check(plan): entities from Entities? metrics per definition? a Mapping for every field?
   If the check fails — fix the plan or change the action.
4. compile: build the query strictly from Mappings.
5. Output: action, plan, check result, Ontology entries applied, result.
</Procedure>

<UpdateRule>
When I send a confirmed correction {correction}:
1. Find the ONE Ontology entry it applies to.
2. Propose a targeted edit.
3. Write corr_checks: questions whose answer MUST change.
4. Write ret_checks: questions whose answer MUST stay the same.
5. Run both groups following the <Procedure> rules.
   Accept the edit only if both groups pass. Otherwise roll it back and explain why.
</UpdateRule>

What to fill in: in {entities} — your database schema and allowed field values. In {metric} — definitions from your policies. In {correction} — your confirmed fixes, e.g., "revenue must exclude tax".

🚀 Quick start — paste into the chat:

Here's a template for an ontology-guided analyst. Adapt it to my task: [your task and data]. 
Ask me questions to fill in the fields.

[paste the template above]

The LLM will ask about your tables and fields, metric definitions and where they come from, and which questions can't be answered from this data. That matters because the method rests on the three parts of the dictionary: entities, metrics, table mappings. Without metrics and data boundaries, the agent slides back into guessing.

06

Limitations

⚠️ Requires an engineering build: in the original everything is automated (building the dictionary from the database, documents and examples, the confirmation pass, the warm-up loop, rolling back edits). In a chat you can reproduce the idea, but not the automation. You'll have to maintain the dictionary by hand or write a script.

⚠️ Results come from data the authors prepared themselves: they assembled the databases, documents and example tasks on their own, from open data. Comparisons with other methods used the same model, so on your model and your data the effect may differ.

⚠️ The dictionary goes stale and can be wrong: if a definition in it is incorrect, the agent will confidently compute the wrong thing. A "confirmed" status is no substitute for human review.

⚠️ Not for simple queries: if your database has no hidden business rules, the dictionary won't buy you anything — it just adds upkeep.

⚠️ Not all results are covered here: the paper text we had cuts off at the first experiments section. Results on dictionary building, on analysis and on updates, as well as the description of the real-world deployment, aren't covered in this breakdown.

07

How They Tested It

The researchers took two open databases from different fields: World Development Indicators (country-level economics) and EPA air quality data. For each one they built an "enterprise" environment: a database, business documents and example tasks. That produced 606 queries (282 and 324) and 44 confirmed corrections with 174 post-edit queries. An analysis of a retail dataset showed that queries require 46 business concepts that aren't in the database schema. That's exactly the gap the dictionary closes.

They compared against four methods: DIN-SQL, ReFoRCE, MAC-SQL (multi-stage SQL generation) and Vanna (a tool-using agent). In every case they plugged in the same model AgentOnto used, so the difference comes from the method, not the model's horsepower. A query counted as correct only if the action was chosen correctly (execute, clarify, decline) and, where applicable, the result was right.

Bottom line: AgentOnto hit 87.5% accuracy on average (79.1% and 96.0% across the two domains), versus 55.0% for the best competitor. The gains were 32.6 and 30.3 percentage points. The practical insight: writing down business meaning explicitly pays off more than cleverer SQL generation. The two checks on dictionary updates, "should change" and "should stay", guard against fixing one thing and breaking another.

08

Adaptations and Extrapolations

🔧 Technique: add a "reference question set" → edits don't break what already worked

Keep a separate list of 10–20 questions with known correct answers. Before accepting any change to the definitions, ask the agent to run through that list:

Before accepting the edit: run every question from <ReferenceSet>.
If even one answer changed without my say-so — roll back the edit and show me which one.

This brings the "should stay the same" checks into a regular chat. The original builds those checks automatically.

Extrapolation: a dictionary self-check before launch. Before going live, ask: "Come up with 4 questions that probe the weak spots of this dictionary. Solve them by the rules. Show me where the dictionary is ambiguous or empty, and propose fixes." This is a stripped-down version of the warm-up on self-generated tasks: one round, no separate checker model. For reliability, run the second pass in a fresh chat.

09

Resources

  • AgentOnto: Ontology-Guided LLM Agents for Enterprise Data Analytics — Dayan Pan, Bincheng Zuo, Xiaojian Wang, Daogang Zhang, Jingyuan Wang. Beihang University (Beijing) and Omaha AIGC (Shanghai). KDD '27.
  • Systems and methods mentioned in the paper: DIN-SQL, ReFoRCE, MAC-SQL, Vanna, SiriusBI, CoeusBI, SODA, ATHENA.
  • Data: World Development Indicators, U.S. EPA Air Quality System.

Research digest

Key result

The problem: the database query ran without errors, but the number in the report is wrong. The agent didn't know your "revenue" excludes returns and tax. AgentOnto lets you get numbers from an analyst agent computed by your rules, not its guesses, and get an honest "the data can't tell us that". Before work starts, the agent gets an explicit dictionary of business concepts (an ontology): entities, metric definitions and table mappings. The agent first drafts a plan that cites the dictionary, then checks the plan, and only then writes the query. The twist: the agent has three moves, not one. Execute, clarify or decline. A question without the needed data doesn't end in a pretty fabrication.

Principle

Business rules live in policy docs and in analysts' heads. They're not in the database schema. So the agent guesses from column names. The method moves those rules into one document. Every entry has a source and a status: confirmed or not. Then the order is: decision → plan citing the dictionary → plan check → query. The agent doesn't write a query until it has checked the plan against the dictionary. Think of an accountant who opens the accounting policy first and crunches numbers second. Not the other way around. The dictionary is later edited from confirmed feedback. Each edit is tested with two sets of questions. What should change. And what must stay the same. Fixed "active buyer" and broke "revenue"? The edit gets rolled back.

Why it works

An LLM writes a plausible query from column names and fills in the meaning on its own. The query ran, no error, nobody notices the number was calculated "not your way". The authors call this a silent semantic error. At the same time, the model is good at following explicitly written definitions. It can check a plan against a checklist. It can come up with test questions from documents. The method puts all of that where the weak link used to be. A high rate of "answers" doesn't guarantee correct answers, so the agent is allowed to decline and to clarify. An agent that must always answer will also answer things the data doesn't contain. In fairness: the paper text we had has no final numbers. We see the system design, not a measured gain. The authors assembled the data themselves and compared methods on the same model.

When to apply

Analytics over databases and spreadsheets → reports where metrics have hidden rules (returns, tax, an "activity" window), especially when the numbers go to the owner or into planning. Not a fit for a one-off simple export. If there are no hidden rules, the dictionary just adds upkeep. One more caveat: the dictionary goes stale. A wrong definition in it will make the agent confidently compute the wrong thing.

Mini recipe

1. Write out the dictionary: entities (tables, key fields, allowed values), metrics with formulas, mappings of concepts to columns and relationships. 2. Label every definition: where it came from and whether it's confirmed. The agent must call anything unconfirmed preliminary. 3. Give it three moves: execute, clarify, "not supported". Add your own, e.g., "hand off to a human". 4. Enforce the order: plan citing the dictionary first, then the plan check, then the query. Make it show all three steps in the answer. 5. Run a warm-up: have the model invent 4 questions and solve them using the dictionary. Check the answers in a separate pass. Repeat twice. Add any gaps you find to the dictionary. 6. Edit one entry at a time: for each correction, write two question sets. One where "the answer should change", one where "the answer should stay". Both sets didn't pass? Roll back. 7. Collect tests: questions with known answers will grow into your own test suite over time. In the original all of this is automated in code. In a chat you'll reproduce the idea, and you'll have to maintain the dictionary by hand.

Examples

[BAD]: `What's our revenue for the Home category in April, and how many active buyers do we have?` The agent will use the price from the table. Canceled orders, returns and tax all end up in the sum. The number looks respectable and is wrong. [GOOD]: `Revenue = SUM(price_gross / (1 + vat_rate)) over orders with status='delivered' MINUS the same sum over status='returned'. Source: Reporting Policy v3, section 2. Status: confirmed. Active buyer = buyer_id with at least one delivered order in the 90 days before the report date. Status: NOT confirmed. Category comes from JOIN skus ON orders.sku_id = skus.sku_id. For every request, first choose an action: EXECUTE, CLARIFY or UNSUPPORTED. Write a plan that cites these entries. Check that the metric is computed exactly per its definition and that every field has a mapping. Only then write the query. Mark unconfirmed metrics as preliminary.` What you get: a plan that accounts for returns and tax before the query runs. "Active buyers" come back flagged "preliminary". Asked `What's the margin for the Home category?`, the agent replies "not supported: no cost data". It won't make things up.

In plain words

When you ask a regular model to write SQL against a database, it just guesses the business logic from column names. The query almost always runs without errors and spits out a nice-looking number, but nine times out of ten that number is complete garbage. The model has no clue that at your shop the term "revenue" quietly means minus returns, tax and rebates. The AgentOnto framework breaks this habit: it puts the LLM on a tight leash made of an ontology — an explicit reference of company terms.

It's like hiring an intern and asking them to "calculate net profit" without handing over the playbook. The intern adds up every deposit with a straight face, proudly reports back, and the business eats the penalties because the kid just didn't know the internal rules. In data analytics, working code doesn't equal a correct answer: the database not throwing a syntax error doesn't mean you're not staring at a million-dollar hallucination.

The AgentOnto architecture runs on three ironclad steps and flat-out forbids writing SQL off the cuff. First it builds a map of business knowledge: entities, exact metric formulas and how they map to columns. Then the agent builds a plan that cites the dictionary, runs it through a rule verification stage, and only after sign-off generates the final code. No freelancing — the model has to spell out exactly which rule it applied to every line.

There's no point cramming this system into one-off exports or small side projects — a plain prompt will handle those. The method shines in hardcore enterprise: CRMs, ERPs and warehouses with thousands of tables, where the calculation logic lives only in the heads of company old-timers. The principle saves the day anywhere hidden business rules aren't written into the database and a single wrong number can cost a quarter's budget.

The big takeaway: stop celebrating a high rate of successful queries, because half of them could be junk. If you want to trust your model's reports, ditch the "naked prompts" and build an ontology layer. Either you make the model check the business dictionary before every move, or you'll be making strategic decisions based on confidently generated nonsense.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on AgentOnto: A Business Glossary Instead of Guesswork, So Your Analyst Agent Stops Fudging the Numbers arXiv:2610.23317

Sign in to apply this study New accounts get 50 free credits.