
Skill
context-engineering-evaluate
evaluate ContextSet against golden datasets
Description
Guides the agent to execute an evaluation of a ContextSet against a golden NLQ+SQL dataset using the Evalbench framework.
SKILL.md
Load the
context-engineering-workflowskill first. It holds the shared context this phase depends on: workspace layout, state file conventions, phase order, and safety protocol. Do not proceed with this phase without reading it.
Phase: Evaluation Scoring
Goal
Run a structured Evalbench evaluation to score the accuracy of a specific context set against a golden truth dataset, identifying exact query failures.
Input
Before beginning the workflow, you explicitly require:
- A
tools.yamlfile securely located in the workspace root directory containing the target database connection details. - A golden evaluation dataset (
golden_dataset_path), formatted as an absolute system path. The file must be in the simplified user-facing format.
Simplified User-Facing Dataset Format: A JSON list of objects, where each object must have the following keys:id: Unique string identifier (e.g.,eval_001).database: Target database name.nlq: Natural language question.golden_sql: The correct reference SQL query.
Example:[ { "id": "eval_001", "database": "my_db", "nlq": "Count users", "golden_sql": "SELECT COUNT(*) FROM users" } ] - The
context_set_id(the Data Agent's authored context configuration identifier, retrievable by the user directly from the GCP Database Studio console; e.g.,projects/<project_id>/locations/<region>/contextSets/<context_set_name>).
Workflow
Follow these steps exactly in order:
- Experiment Selection & Memory:
- Scan the local
autoctx/experiments/directory and list the available tuning workflows/subfolders to the user. - If no experiment folders exist (or the user wants to create a new one without running Bootstrap):
- Ask the user to choose between 2 paths (do not assume):
- Bootstrap a basic context: Guide them to trigger the Bootstrap workflow.
- Use an existing context:
!IMPORTANT Inform the user that if they have an existing context, it must be uploaded to GCP Database Studio to obtain a
context_set_idfor evaluation.- Ask the user for a name for this new experiment folder (similar to how Bootstrap does).
- Create the folder under
autoctx/experiments/. - Ask the user to provide the local file path of their existing context.
- Record the local file path as the Base Context for this experiment in
autoctx/state.mdfor long-term memory. - Continue with the evaluation flow below.
- Ask the user to choose between 2 paths (do not assume):
- Wait for the user to explicitly select an experiment folder to evaluate (or use the newly created one).
- Once selected, explicitly record their chosen experiment name into the local
autoctx/state.mdfile to act as long-term memory so you don't forget it during subsequent evaluations.
- Scan the local
- Parameter Collection:
- User Inputs: Prompt the user ONLY for the
golden_dataset_pathand thecontext_set_id(if they haven't provided them already). Do NOT ask them to explain or verify database configurations. - Interactive DB Selection: Read the
autoctx/tools.yamlfile to list available databases to the user:- Find all
kind: sourceblocks with supported evaluation engines (consult thegenerate_evalbench_configstool description for the exact list of supported types). - If there is exactly one supported source, inform the user and auto-select it.
- If there are multiple supported sources, list their
nameandtypeand let the user select which database to evaluate.
- Find all
- User Inputs: Prompt the user ONLY for the
- Config Generation (Core Execution):
- Use the
generate_evalbench_configsMCP tool. This is the only way to generate Evalbench configs. Never invent configs from scratch. - If the tool fails, analyze the error and retry with corrected inputs. If it is an internal system error, STOP and inform the user.
- Provide the selected
output_dir(must beautoctx/experiments/<experiment_name>/),dataset_path,context_set_id, absolutetoolbox_config_path(e.g.autoctx/tools.yaml), and selectedtoolbox_source_name. - The tool will automatically write all generated configuration files (including
golden_queries.json) directly to theeval_configs/directory inside the chosenautoctx/experiments/<experiment_name>/folder. - You do not need to manually write or extract file contents. Verify that the files have materialized if needed.
- Use the
- Evalbench Run Integration:
- Trigger the
run_shell_commandnatively to execute the evaluation from the ROOT of the workspace using the following exact command template:uvx google-evalbench@1.9.0 --experiment_config=autoctx/experiments/<experiment_name>/eval_configs/run_config.yaml - Check the command outputs to ensure the evaluation reports materialize in the respective
autoctx/experiments/<experiment_name>/eval_reports/directory.
- Trigger the
Output
Upon successful completion, the workspace must contain:
- The generated Evalbench config files successfully written to the
eval_configs/folder. - Evaluating reports built successfully by the external Evalbench runner process.
Final Summary & Next Steps
Conclude by providing a succinct summary to the user:
- Confirm that the context set has been scored and point out exactly where the final metrics CSV/results are located.
- Share top-level performance summaries.
- Suggest actionable next steps (e.g., transition to a refinement workflow to hill-climb and improve the metrics based on failed evaluations).
Templates & Reference
When listing sources from tools.yaml, ensure you only present kind: source records to the user.
The tool generate_evalbench_configs will find the selected block inside the file and validate its connection parameters deterministically using Python code. You do not need to manually parse or map individual properties such as host, port, or database yourself. If the tool indicates a verification failure for a specific database type, refer to the schema examples inside this directory (e.g., cloud-sql-postgres.md) to guide the user on fixing their tools.yaml definition.
More skills from the db-context-enrichment repository
View all 7 skillscontext-engineering-bootstrap
bootstrap initial ContextSet for database enrichment
Jul 18ContextData ModelingDatabaseGoogle Cloudcontext-engineering-dataset-generation
generate golden SQL evaluation datasets
Jul 18Data AnalysisEvalsGoogle CloudSQLcontext-engineering-hillclimb
improve ContextSet via hill-climbing iterations
Jul 18Data AnalysisEvalsGoogle CloudOptimizationcontext-engineering-init
initialize context engineering and database connections
Jul 18ConfigurationDatabaseEngineeringGoogle Cloudcontext-engineering-workflow
optimize context sets for Gemini data agents
Jul 18Agent ContextData AnalysisGeminiGoogle Cloudcontext-generation-guide
generate context items for database enrichment
Jul 18Agent ContextDatabaseDocumentationGoogle Cloud
More from Google Cloud
View publisherkb-search
search and extract local knowledge base documents
knowledge-catalog
Jul 12DocumentationKnowledge BaseSearchknowledge_catalog_discovery_agent
search and rank Knowledge Catalog data entries
knowledge-catalog
Jul 12Data AnalysisGoogle CloudKnowledge ManagementSearchcontributing
contribute to Cloud Foundation Fabric
cloud-foundation-fabric
Jul 31AutomationEngineeringGitHubGoogle Cloud +1fabric-builder
generate Terraform code for Google Cloud
cloud-foundation-fabric
Jul 12Google CloudInfrastructure as CodeTerraformfast-0-org-setup-prereqs
prepare prerequisites for FAST 0-org-setup
cloud-foundation-fabric
Jul 12Google CloudOperationsagent-aware-cli
design agent-aware command-line interfaces
vertex-ai-creative-studio
Jul 12CLIEngineeringGoogle Cloud