Development Guide
Requirements
| Name | Installation | Purpose |
|---|---|---|
| Python 3.11+ | Download | The library is Python-based. |
| uv | Instructions | uv is used for package management and virtualenv management in Python codebases |
Installing dependencies
Generating synthetic queries
Follow these steps to generate synthetic queries using AutoQ:
-
Set up your project directory:
-
Create an
Place your input files inside theinputfolder and add your input data:./inputdirectory. To get started, you can use the AP News dataset provided in the datasets folder. To download this example dataset directly into yourinputfolder, run: You can also download directly to Azure Blob Storage. See the Datasets documentation for storage options. -
Initialize the configuration:
This is the local-filesystem variant.Alternative blob variant (choose this instead of the local command above; do not run both):
This command creates two files in theuv run benchmark-qed config init autoq . \ --storage-type blob \ --container-name my-container \ --account-url https://<account>.blob.core.windows.net \ --base-dir autoq_test./autoq_testdirectory: -.env: Stores environment variables for the AutoQ pipeline. Open this file and replace<API_KEY>with your OpenAI or Azure API key. -settings.yaml: Contains pipeline settings. Edit this file as needed for your use case.The generated
settings.yamlincludes commented-out sections for configuring Azure Blob Storage as input and output backends. Uncomment and fill in thestoragesection underinputto read data from blob storage, or theoutput_storagesection to write results to blob storage instead of the local filesystem. -
Generate synthetic queries:
This is the local-filesystem variant.Alternative blob-stored config variant (choose this instead of the local command above; do not run both):
This will process your input data and save the generated queries in theuv run benchmark-qed autoq blob://my-container/autoq_test/settings.yaml output \ --account-url https://<account>.blob.core.windows.netoutputdirectory.By default, AutoQ also generates assertions for data-driven queries. Assertions are testable factual statements that can be used to evaluate answer accuracy. You can configure assertion generation in
settings.yaml:
Comparing RAG answer pairs
Follow these steps to compare RAG answer pairs using the pairwise scoring pipeline:
-
Set up your project directory:
-
Create an
Copy your RAG answer files into theinputfolder and add your question-answer data:./inputdirectory. To get started, you can use the example RAG answers available in the example data folder. To download this example dataset directly into yourinputfolder, run: You can also download directly to Azure Blob Storage. See the Datasets documentation for storage options. -
Create a configuration file for pairwise comparison:
This is the local-filesystem variant.Alternative blob variant (choose this instead of the local command above; do not run both):
This command creates two files in theuv run benchmark-qed config init autoe_pairwise . \ --storage-type blob \ --container-name my-container \ --account-url https://<account>.blob.core.windows.net \ --base-dir pairwise_test./pairwise_testdirectory: -.env: Contains environment variables for the pairwise comparison tests. Open this file and replace<API_KEY>with your OpenAI or Azure API key. -settings.yaml: Contains pipeline settings, which you can modify as needed.The generated
settings.yamlincludes commented-outinput_storageandoutput_storagesections for configuring Azure Blob Storage backends. -
Run the pairwise comparison:
This is the local-filesystem variant.Alternative blob-stored config variant (choose this instead of the local command above; do not run both):
The results will be saved in theuv run benchmark-qed autoe pairwise-scores blob://my-container/pairwise_test/settings.yaml output \ --account-url https://<account>.blob.core.windows.netoutputdirectory.
Scoring RAG answers against reference answers
Follow these steps to score RAG answers against reference answers using example data from the AP news dataset:
-
Set up your project directory:
-
Create an
Copy your RAG answers and reference answers into theinputfolder and add your data:inputdirectory. To get started, you can use the example RAG answers available in the example data folder. To download this example dataset directly into yourinputfolder, run: You can also download directly to Azure Blob Storage. See the Datasets documentation for storage options. -
Create a configuration file for reference scoring:
This is the local-filesystem variant.Alternative blob variant (choose this instead of the local command above; do not run both):
This creates two files in theuv run benchmark-qed config init autoe_reference . \ --storage-type blob \ --container-name my-container \ --account-url https://<account>.blob.core.windows.net \ --base-dir reference_test./reference_testdirectory: -.env: Contains environment variables for the reference scoring pipeline. Open this file and replace<API_KEY>with your OpenAI or Azure API key. -settings.yaml: Contains pipeline settings, which you can modify as needed.The generated
settings.yamlincludes commented-outinput_storageandoutput_storagesections for configuring Azure Blob Storage backends. -
Run the reference scoring:
This is the local-filesystem variant.Alternative blob-stored config variant (choose this instead of the local command above; do not run both):
The results will be saved in theuv run benchmark-qed autoe reference-scores blob://my-container/reference_test/settings.yaml output \ --account-url https://<account>.blob.core.windows.netoutputdirectory.
For detailed instructions on configuring and running AutoE subcommands, please refer to the AutoE CLI Documentation.
To learn how to use AutoE programmatically, please see the AutoE Notebook Example.
Running with Blob-Stored Configuration
If your settings.yaml is stored in Azure Blob Storage, pass a blob:// URI as the config path instead of a local file path.
Blob URI format
If you initialized config with --base-dir, include that same prefix in the URI.
Authentication options
For commands that read config from blob://, pass one of:
--account-url https://<account>.blob.core.windows.net(managed identity)--connection-string "$AZURE_STORAGE_CONNECTION_STRING"
If neither flag is provided, auth falls back to environment variables:
AZURE_STORAGE_ACCOUNT_URLAZURE_STORAGE_CONNECTION_STRING
AutoQ example
uv run benchmark-qed autoq blob://my-container/autoq_test/settings.yaml output \
--account-url https://<account>.blob.core.windows.net
AutoE examples
Pairwise:
uv run benchmark-qed autoe pairwise-scores blob://my-container/pairwise_test/settings.yaml output \
--account-url https://<account>.blob.core.windows.net
Reference:
uv run benchmark-qed autoe reference-scores blob://my-container/reference_test/settings.yaml output \
--account-url https://<account>.blob.core.windows.net
Assertion:
uv run benchmark-qed autoe assertion-scores blob://my-container/assertion_test/settings.yaml output \
--account-url https://<account>.blob.core.windows.net
When a blob config is loaded, the CLI downloads settings.yaml and sibling files (such as .env and prompts/) under the same prefix into a temporary local directory before execution.
Diving Deeper
To explore the query synthesis workflow in detail, please see the AutoQ CLI Documentation for command-line usage and the AutoQ Notebook Example for a step-by-step programmatic guide.
For a deeper understanding of AutoE evaluation pipelines, please refer to the AutoE CLI Documentation for available commands and the AutoE Notebook Example for hands-on examples.