SchemaFlow: Agentic Database Change Impact Analysis, SQL Generation, and Eval Guardrails
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending
.mdto the page URL.
This cookbook walks through an end-to-end AI-assisted database change workflow using the OpenAI Agents SDK.
It demonstrates how OpenAI’s tooling ecosystem can be applied to orchestrate complex, data-intensive workflows across modern enterprise infrastructures. While the current implementation focuses on a retail-oriented schema change and impact-analysis use case, the underlying architectural patterns are domain-agnostic and extensible. The same workflow design can be adapted across industries such as manufacturing, pharmaceuticals, healthcare, logistics, finance, and supply chain operations — wherever structured data workflows, operational reasoning, retrieval-augmented analysis, and automated validation are required.
The running example is a retail loyalty-tier change, but the same pattern applies to many database-change requests where teams need traceable impact analysis and reviewable implementation output.
The workflow starts from a natural-language database change request, converts it into structured JSON, optionally grounds impact analysis with PDF-based File Search context, generates a safe rollout plan, drafts SQL across data platform layers, validates the output with deterministic guardrails, saves a reusable artifact, and optionally evaluates the flow with Promptfoo.
The notebook is intentionally self-contained: all core workflow logic, prompts, guardrails, artifact generation, and eval runtime files are created from notebook cells.
本篇目录
- Overview
- Why This Matters
- Key Benefits
- What You'll Build
- Introduction: Use Case and Solution
- Workflow Overview
- Table of Contents
- Architecture - Design Patterns
- System Design
- Execution Workflow
- 1) Environment Setup
- 2) Input
- 3) Optional PDF RAG Context
- 4) Stages 1-2 - Parse Change Request + Impact Analysis
- 5) Stages 3-4 - Execution Plan + SQL Generation
- 6) Stage 5 - Lightweight SQL Sanity Checks
- 7) Final Bundle
- 8) Save Artifact
- 9) Optional Cleanup
- 10) Evaluate the Flow with Promptfoo
- 11) Optional Neo4j Knowledge Graph & Dashboard
- Notes, Assumptions, and Extension Points
- Contributors