Give recurring questions SQL your team has reviewed.
An example pairs a question your team asks with SQL you’ve run and checked. Your agent reads its examples before it answers, so related questions start from the joins, definitions and filters your team already uses.
Free plan. No credit card required.
Question
Reviewed example
Net revenue for a month
Logic summary
Paid invoice amounts minus refunds in the reporting period, excluding test accounts.
Answer
Net revenue, September 2026
$112,000
Paid invoices $120,000 − refunds $8,000
Verified query
Its SQL matches the example “Net revenue for a month”.
How it works
Choose the question
One your team asks often, the way they ask it.
Add and run the SQL
Save & Run Query runs it; check the result answers the question.
Save the example
The agent reads it before it answers related questions.
Save the logic behind a familiar question
Choose a question your team asks regularly, like “What was net revenue in September?”, add the SQL and run it against your data. Check the result before you save it as an example for the agent to reuse.
- Save & Run Query runs the SQL before you save it
- Each example keeps the question, the SQL and its source
Example
What was net revenue in September?
-- Net revenue for September 2026 (sample)
WITH paid AS (
SELECT COALESCE(SUM(i.amount_cents), 0) AS cents
FROM invoices i
JOIN accounts a ON a.id = i.account_id
WHERE i.status = 'paid'
AND i.paid_at >= '2026-09-01'
AND i.paid_at < '2026-10-01'
AND NOT a.is_test
),
refunded AS (
SELECT COALESCE(SUM(r.amount_cents), 0) AS cents
FROM refunds r
JOIN accounts a ON a.id = r.account_id
WHERE r.refunded_at >= '2026-09-01'
AND r.refunded_at < '2026-10-01'
AND NOT a.is_test
)
SELECT (paid.cents - refunded.cents) / 100.0 AS net_revenue
FROM paid, refunded;Ran on the sample data: 1 row, net_revenue 112000.00
Query ran: one row.
Make important filters part of the example
An example records more than a number: the joins, date boundaries and exclusions behind it. When the agent reads a table, the examples on it show the filters your team applies, like leaving out test accounts.
- Examples on a table show the agent its usual filters
- The agent reads your examples before it answers
Answer steps
- Understood the question
Reading
invoices2 examples use this table. The filters they apply:
- status = 'paid'
- NOT a.is_test
- paid_at within the period
- Writing the query
Sample data. Example answer steps.
See when an answer matches one
When the SQL behind an answer matches an example, the answer is marked as a verified query and rated high confidence. Add the same question as an eval, and rerun it after changes to check the agent still answers it your way.
- Marked as a verified query, rated high confidence
- Add the question as an eval to keep checking it
Answer
Net revenue for September 2026 was $112,000: $120,000 in paid invoices less $8,000 in refunds.
Verified query
This answer’s SQL matches the example “Net revenue for a month”, so it’s rated high confidence.
Sample data. Example answer.
Frequently asked questions
What is an example?
A question your team asks, paired with SQL you’ve run and reviewed. When the SQL behind an answer matches one, the answer is marked as a verified query.
Does a question need to use the same wording?
No. The agent reads your examples before it answers, so related questions in other words can use them. When a question changes the period, the metric or who’s counted, add that variation as an eval to check it.
What should I check before saving one?
That the SQL runs, which Save & Run Query does for you, and that the result answers the question: the right joins, filters and definition.
How are examples different from evals?
Examples show the agent how your team answers a question. Evals test how it answers. Use the same question in both, and add evals for variations your examples don’t cover.
Where do I add them?
In the agent’s Examples tab.