> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsolve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Verified Questions

> Questions paired with SQL you have confirmed answers them correctly. Test cases ask them; switched into agent context, the agent also uses them as worked examples.

A verified question is a **question** your users ask, paired with the **SQL you have confirmed answers it correctly** (and optionally the chart that presents it best). It is the reference answer for testing the agent, and, when you choose, a worked example the agent learns from.

## Tests only, or agent context too

Each verified question has a **Use as agent context** switch, off by default:

* **Off: tests only.** [Test cases](https://docs.upsolve.ai/ai-agent-builder/tests.md) ask the question and grade the agent's answer against your SQL. The agent never sees the answer, so the test shows whether it can work the answer out on its own.
* **On: agent context.** The agent also retrieves the question and its SQL as a worked example when a user asks something similar. That teaches it your team's patterns, but a test on the same question then partly checks whether the agent remembers the answer rather than whether it can find it.

Keep most of the questions your tests ask switched off. Switch one on when you want the agent to reuse a known-good answer, for example a KPI with a precise definition. The **Verified questions** page warns you on any question that is in agent context and also used by a test.

Agent context is part of the workspace version: switching a question on or off changes the draft, and reaches your users when you save and promote (or deploy) a version.

## Add a verified question

1. Open your workspace and go to **Develop → Verified questions**.
2. Click **New question**.
3. Enter the **Question** the way a user would phrase it (for example, *"Show sales by owner segmented by product"*).
4. Enter the **SQL** that answers it correctly. It must be a single read-only query.
5. Leave **Use as agent context** off unless the agent should see it as an example.
6. Save.

There are quicker ways too:

* **From what your users asked.** In **New question**, switch the header to **From chat history** and pick a question your users asked that the agent answered with SQL. It fills the same form with the question and the SQL of its latest successful answer; check it, then save.
* **From a file.** Click **Import** next to **New question** and upload a CSV or JSON file. Its fields can be called anything: pick the one that holds the question and the one that holds the SQL, review the questions (duplicates and invalid rows are skipped), then add them. Each SQL is run before anything is added.
* **From a real conversation.** In [Chat History](https://docs.upsolve.ai/ai-agent-builder/chat-history.md) or a trace in the Playground, click **Create verified question**. The question is filled in, and so is the SQL the agent ran when it can be determined. Check the SQL before you save: confirming it is correct is what makes the question *verified*.
* **From the test case form.** When you build a [test case](https://docs.upsolve.ai/ai-agent-builder/tests.md), pick an existing verified question or create one in place.
* **With the Builder agent.** Ask the [Builder agent](https://docs.upsolve.ai/ai-agent-builder/builder-agent.md) to "add a test for monthly spend by category", or let [guided setup](https://docs.upsolve.ai/ai-agent-builder/setup-guide.md#step-4-set-up-the-workspace) write a first set.

## Manage them

The **Verified questions** page lists every question with its SQL, whether it is in agent context, how many test cases use it, and when it was last updated. Filter by **All**, **In agent context** or **Test only**, search, and select several rows to switch agent context on or off at once.

A question that a test case uses can't be deleted: the page tells you which test cases use it, so you can change or delete them first.

## What makes a good verified question

Write the question the way a real user would ask it, not as a technical specification. Write the SQL your team would actually run, with every filter, join and calculation that makes it correct for your data.

Good candidates for agent context:

* Questions with non-obvious joins or filters specific to your schema.
* KPI calculations with a precise definition (for example, "revenue" as a specific formula, not just a column name).
* Questions whose correct answer depends on business rules the agent can't infer from column names.

15–25 well-chosen questions in agent context do far more for accuracy than 100 generic ones.

## Check that it's used

Open the trace of an answer in the Playground or Chat History. Its retrieval step shows which verified questions the agent found in its context. If a common question retrieves none, add one phrased the way your users ask it and switch it into agent context. See [Agent Observability](https://docs.upsolve.ai/ai-agent-builder/agent-observability.md).

## Next steps

> [card] [Tests](https://docs.upsolve.ai/ai-agent-builder/tests.md)
>
> Run test cases on your verified questions against every change.

> [card] [System Prompts](https://docs.upsolve.ai/ai-agent-builder/system-prompts.md)
>
> Encode business rules and guardrails that apply to every question.

> [card] [Skills](https://docs.upsolve.ai/ai-agent-builder/skills.md)
>
> Turn repeated procedures into reusable know-how the agent loads on demand.

> [card] [Knowledge Base](https://docs.upsolve.ai/ai-agent-builder/knowledge-base.md)
>
> Store the reference documents your verified SQL is based on.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.