Skip to main content
Data agents need your table history and business definitions to write reliable SQL. Add validated queries, table metadata, and business rules to the agent’s knowledge. The agent retrieves the relevant context before writing SQL.
With knowledge attached, the agent searches it for each question and retrieves the matching context. Knowledge search is on by default. Set search_knowledge=False to turn it off.

Context to curate

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.

Start with validated queries

Validated queries give the agent a trusted starting point for recurring questions such as monthly recurring revenue. For a related request, the agent can retrieve a known-good query and adapt its structure. Store the question, SQL, tables used, and data-quality notes for queries your analysts already trust.

Grounding vs raw text-to-SQL

Next steps

Developer Resources