经 AI Skill Hub 精选评估,DBPLANBENCH 获评「强烈推荐」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
DBPLANBENCH 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
DBPLANBENCH 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install dbplanbench
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install dbplanbench
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/BauplanLabs/DBPLANBENCH
cd DBPLANBENCH
pip install -e .
# 验证安装
python -c "import dbplanbench; print('安装成功')"
# 命令行使用
dbplanbench --help
# 基本用法
dbplanbench input_file -o output_file
# Python 代码中调用
import dbplanbench
# 示例
result = dbplanbench.process("input")
print(result)
# dbplanbench 配置文件示例(config.yml) app: name: "dbplanbench" debug: false log_level: "INFO" # 运行时指定配置文件 dbplanbench --config config.yml # 或通过环境变量配置 export DBPLANBENCH_API_KEY="your-key" export DBPLANBENCH_OUTPUT_DIR="./output"
The Python API runs on your machine and orchestrates the entire pipeline. Modal sandboxes run the patched DataFusion engine (built from the datafusion_patched/ directory in this repo) inside ephemeral cloud containers — they plan, execute, and benchmark queries, writing results to S3. The LLM proposes execution-plan optimizations as JSON Patch operations, which the API validates by sending patched plans back to Modal.
<details> <summary>Show Python environment and env file setup</summary>
<details> <summary>Show AWS S3 setup steps</summary>
Modal sandboxes write results to S3, and the local client retrieves them. Create your own S3 bucket with any name you choose.
1. Create an S3 bucket - Open the S3 console and click Create bucket. - Choose any bucket name (e.g., my-faster-dbs-bucket). - Keep the default settings, and click Create bucket.
2. Set your bucket name in .env
S3_BUCKET_NAME=your-bucket-name-here
3. Create IAM credentials - Open the IAM console and go to Users -> Create user. - On Set permissions, choose Attach policies directly. - Click Create policy, go to the JSON tab, and paste (replace YOUR_BUCKET_NAME with your actual bucket name):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
},
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME"
}
]
}
- Save the policy and attach it to the user. - Finish Review and create to create the user.
4. Add credentials to .env - Go to IAM -> Users -> your user -> Security credentials -> Create access key. - Choose the Local code use case, then create the key. - Copy the Access key ID and Secret access key immediately (they are shown only once). - Add them to .env:
AWS_ACCESS_KEY_ID=your_access_key_id_here
AWS_SECRET_ACCESS_KEY=your_secret_access_key_here
</details>
<details> <summary>Show Modal setup steps</summary>
Create a Modal account and authenticate:
python3 -m modal setup
This creates ~/.modal.toml with your Modal credentials. Open the file, grab the following credentials, and add them to .env:
MODAL_TOKEN_ID=your_token_id_here
MODAL_TOKEN_SECRET=your_token_secret_here
Next, create a Modal secret for AWS on the Modal dashboard so that sandboxes can access your S3 bucket:
s3-aws-credentials.AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, then save.Note: the secret name s3-aws-credentials in Modal must match AWS_SECRET_NAME in src/modal_controller/constants.py.
</details>
<details> <summary>Show LLM setup steps</summary>
This project uses LiteLLM for LLM inference. Add your LLM API key to .env. This project uses GPT-5 by default:
OPENAI_API_KEY=your_openai_api_key_here
For other providers, check the LiteLLM documentation.
</details>
---
from dbplanbench import optimize_queries
QUERY = "SELECT * FROM ... WHERE ... ORDER BY ..."
opt_result = optimize_queries(
queries=[QUERY],
dataset="tpcds",
scale_factor=3,
n_steps=2,
n_samples_per_step=5,
top_k_patches=1,
n_runs=5,
)
single_plan = opt_result.optimization_outcome[0]
best_patch = single_plan.patch[0]
summary = opt_result.summary
See notebooks/examples.ipynb for a self-contained walkthrough that:
improvement_x side-by-sideHere's a condensed version:
from dbplanbench import (
generate_queries,
optimize_queries,
scale_optimizations,
benchmark_plans,
benchmark_queries,
get_engine_plans,
)
from dbplanbench_types import PatchedPlan
Python 3.10 or higher is required. Install dependencies with uv:
uv sync
source .venv/bin/activate
Copy local.env to .env and fill in your values as you complete the setup steps below:
cp local.env .env
local.env lists all required environment variables with placeholder values. .env is gitignored.
</details>
高质量的AI工作流项目
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:DBPLANBENCH 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | DBPLANBENCH |
| Topics | AI工作流数据库优化 |
| GitHub | https://github.com/BauplanLabs/DBPLANBENCH |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-01 · 更新时间:2026-06-01 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端