Skip to main content
Certified queries are pre-approved SQL queries that the agent treats as a library of trusted examples. They guide the agent toward correct business logic and well-formed query patterns without restricting it to a fixed set of queries. Certified queries are configured as code in your data model repository, alongside your cubes and views.
The agent is not limited to running only certified queries. When answering a user request, the agent may:
  • Use a certified query directly if it matches the request
  • Use a certified query as a starting point and adapt it (e.g., add filters, dimensions, or measures) to fit the user’s question
  • Generate a new query independently if no certified query is relevant
Certified queries help the agent toward trusted patterns and correct business logic, but the agent retains full flexibility to construct the query that best answers each question.

Defining certified queries

Certified queries are defined as Markdown files under agents/certified_queries/. Each query lives in its own file: the YAML frontmatter holds metadata, and the Markdown body is the SQL query.
Files placed under a certified_queries/, certified-queries/, or queries/ directory are treated as certified queries automatically — no kind property is required. The name is inferred from the file name (e.g., quarterly-revenue.mdquarterly-revenue).

Frontmatter properties

Inlining certified queries in YAML

You can also inline certified queries directly in agents/config.yml under a certified_queries key:
Inline certified queries accept the same properties as Markdown ones — name, description, user_request (required), and sql_query (required).
Certified queries inlined at the root of agents/config.yml are attached to the implicit auto space and applied to the default agent in a single-agent setup. In a multi-agent setup, attach certified queries to a specific space by inlining them under that space’s certified_queries key (or by placing Markdown files under agents/certified_queries/<space-name>/).

Writing effective certified queries

  • Phrase user_request like a real user question. This is what the agent matches against incoming requests.
  • Keep queries focused. A certified query should answer one well-defined question; the agent will adapt it for variations.
  • Use canonical business logic. Certified queries are the reference for “the right way” to compute something — encode the definitions you want the agent to follow.
  • Cover common patterns first. Start with the questions users ask most often, and grow the library based on usage.