Skip to main content
A model knows SQL but it does not know that revenue was replaced by revenue_v2 last March, that “active” excludes trialing accounts, or that MRR is computed net of credits. Grounding provides the missing context. The agent retrieves the relevant context for each question before it writes a line of SQL.
With knowledge attached, the agent searches it per question and pulls only the matching context, instead of carrying the entire data dictionary in every prompt. Knowledge search is on by default. Set search_knowledge=False to turn it off.

The layers worth curating

A production data agent grounds each answer in several layers. The first set is curated and stored in a vector database. The rest are live.

Validated queries are the highest-leverage layer

One known-good query for “monthly recurring revenue” is worth more than a page of schema notes. When the agent retrieves a validated query for a similar question, it adapts a correct shape instead of inventing one. Seed the store with the queries your analysts already trust: the question, the SQL, the tables used, and any data-quality notes.

Grounding vs raw text-to-SQL

Next steps

Developer Resources