Skip to content

Add Docker-free multi-turn SQLite text-to-SQL workflow (BIRD) - #635

Open
flyingdoubleG wants to merge 2 commits into
agentscope-ai:mainfrom
flyingdoubleG:feat/sqlite-sql-workflow
Open

flyingdoubleG wants to merge 2 commits into
agentscope-ai:mainfrom
flyingdoubleG:feat/sqlite-sql-workflow

Conversation

@flyingdoubleG

Copy link
Copy Markdown

Description

Closes #634

Adds sqlite_sql_workflow (trinity/common/workflows/envs/sqlite_sql/):

  • sqlite_sql_env.py: pure-Python environment (no Trinity imports): read-only execution with an
    SQLite authorizer, single statement, timeout and row cap; <action> / <answer> parsing that
    ignores tags inside <think>; result rendering; BIRD/Spider execution-accuracy reward.
  • sqlite_sql_workflow.py: MultiTurnWorkflow loop (schema + question + evidence prompt, up to
    max_env_steps turns, optional auto_submit), experience info with env_rounds, submitted,
    num_queries, num_query_errors, gold_error, gold_empty.
  • Registered as sqlite_sql_workflow.
  • examples/grpo_sqlite_sql/: README, data script (BIRD -> taskset), config (BIRD train, Mini-Dev eval).

How to test: pytest tests/common/sqlite_sql_env_test.py (13 tests: parsing, explore-then-answer,
wrong answer, writes / ATTACH / PRAGMA / multi-statement rejected without touching the DB, timeout,
invalid format, broken/empty reference). I also exercised the workflow loop with a scripted model
(explore -> answer, no submission with/without auto_submit, write attempt as error observation).

Checklist

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

flyingdoubleG and others added 2 commits October 18, 2026 21:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflow called chat_async with n=1 only, so per-task rollout_args such
as the eval taskset's temperature 0.0 in the example config were ignored.
Forward asdict(task.rollout_args) like the frozen_lake workflow does, keeping
n=1 since each turn needs a single response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Docker-free multi-turn text-to-SQL workflow on SQLite (BIRD / Spider)

1 participant