feat: Initial development of seed eval dataset generation - #139
feat: Initial development of seed eval dataset generation#139chen0040 wants to merge 24 commits into
Conversation
|
/gcbrun |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive framework for generating and expanding seed evaluation datasets of Natural Language Question (NLQ) and SQL pairs, including a new MCP tool and crash-resilient state management. The reviewer identified several technical issues and improvement opportunities: the GenAI client requires better exception handling and alignment of retry configurations, while the core generator should replace assert statements with explicit runtime checks and correct docstring return types. Additionally, several magic numbers across the implementation should be refactored into named constants to improve maintainability.
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
1 similar comment
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
…e based on its knowledge derived from app code and business context artifacts
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
| @@ -1,14 +1,14 @@ | |||
| [project] | |||
| name = "google-cloud-db-context-enrichment" | |||
| version = "0.5.0" | |||
There was a problem hiding this comment.
We don't need to bump version by ourselves. This will be handled by the release-please automatically.
| @@ -0,0 +1,32 @@ | |||
| [ | |||
| { | |||
| "id": "flight_expert_001", | |||
There was a problem hiding this comment.
IIUC, this and the following golden_property_search_advanced.json are part of the eval. We might not want to put these in the root folder.
| @@ -1 +1 @@ | |||
| 3.12 | |||
| 3.12.13 | |||
| standard_file.write_text(json.dumps(standard_content)) | ||
|
|
||
| # Call the tool | ||
| attach_context_set.fn( |
There was a problem hiding this comment.
I think these has been fixed in the main branch. We can do a quick merge of main to this PR?
| * *Level 4 (Expert)*: Analytical operations (Window functions like `RANK()`/`ROW_NUMBER()`, Self-joins, Pivot logic, handling complex JSON/Array data types). | ||
|
|
||
| The standard evaluation format is a JSON object: | ||
| 9. **Generate Dataset Pairs**: |
There was a problem hiding this comment.
Checking the preview page, it seems there are some formatting issues that these are not showing as bullet points.
| 3. Treat these reverse-translated pairs as your "Seed Pairs" for the rest of the workflow. | ||
|
|
||
| 7. **Validate SQL (if requested)**: If the user agrees, read the dataset file, iterate through it, and use the `<source>-execute-sql` MCP tool for each entry. Report any failures. Overwrite the file with any corrections if the user approves them. | ||
| 5. **Initial Save (If Seed Pairs Provided or Extracted)**: If seed pairs were provided explicitly OR extracted/translated from Query Logs, use the `generate_dataset` MCP tool to save them. You must provide the exact `output_file_path`. Pass the constructed dataset as a JSON string (`dataset_entries_json`). |
There was a problem hiding this comment.
How to use the tool would better be a tool description.
| --- | ||
|
|
||
| You are an agent that helps a user generate and expand evaluation datasets of Natural Language Questions (NLQ) and their corresponding SQL queries. Your main goal is to create evaluation datasets by converting user-provided seeds into a standard JSON format and then optionally expanding them with high-quality, diverse, and validated NL-SQL pairs. | ||
| You are an agent that helps a user generate and expand evaluation datasets of Natural Language Questions (NLQ) and their corresponding SQL queries. Your main goal is to create high-fidelity evaluation datasets by converting user-provided seeds into a standard JSON format, actively validating them for logical alignment, and expanding them using tunable complexity levels. |
There was a problem hiding this comment.
Considering only put the high level key info in the skill when the content is getting bigger. We can put details to the skill references to reduce the context consumption here.
| * **Action**: Present any discovered flaws to the user and suggest specific corrections. Overwrite the file with user-approved corrections. | ||
|
|
||
| 10. **Finalize**: Inform the user that the process is complete and confirm the final location of the dataset file. | ||
| 8. **Prompt for Generation/Expansion & Complexity Tuning**: Ask the user if they want to generate new pairs. If yes, ask them to define the desired **SQL Complexity Level**: |
There was a problem hiding this comment.
Have we considered to separate the seed generation & dataset expansion to 2 skills?
cc: @helloeve @g-lynnzee
| 3. Treat these reverse-translated pairs as your "Seed Pairs" for the rest of the workflow. | ||
|
|
||
| 7. **Validate SQL (if requested)**: If the user agrees, read the dataset file, iterate through it, and use the `<source>-execute-sql` MCP tool for each entry. Report any failures. Overwrite the file with any corrections if the user approves them. | ||
| 5. **Initial Save (If Seed Pairs Provided or Extracted)**: If seed pairs were provided explicitly OR extracted/translated from Query Logs, use the `generate_dataset` MCP tool to save them. You must provide the exact `output_file_path`. Pass the constructed dataset as a JSON string (`dataset_entries_json`). |
There was a problem hiding this comment.
I forgot why we want to do initial save here. Wondering if we can save at the end of the workflow?
| 5. **Initial Save (If Seed Pairs Provided or Extracted)**: If seed pairs were provided explicitly OR extracted/translated from Query Logs, use the `generate_dataset` MCP tool to save them. You must provide the exact `output_file_path`. Pass the constructed dataset as a JSON string (`dataset_entries_json`). | ||
|
|
||
| 8. **Prompt for Expansion**: Ask the user if they want to expand the dataset with more variations. | ||
| 6. **Prompt for Validation (If Seed Pairs Provided)**: If a seed was saved, ask the user if they want to validate the `golden_sql` and NLQ alignment in the dataset file. Advise them that this step ensures high-quality evaluation data. |
There was a problem hiding this comment.
For validation, consider using the validation loop as mentioned in the best practices.
https://agentskills.io/skill-creation/best-practices#validation-loops
da36512 to
9c2a07b
Compare
Title: feat: Initial development of seed eval dataset generation
Description
This PR introduces the initial development of the Seed Evaluation Dataset Generation feature. It provides an autonomous, multi-agent workflow to generate, evaluate, and expand high-quality Natural Language Question (NLQ) and SQL pairs directly from a database schema.
Key Changes
autoctx:generate-datasettoevals/core-cujs/dataset.jsonto test the new dataset generation capability in the core CUJs.Testing
autoctx:generate-dataset*).