DB Intelligence Pipeline
Sources: Antigravity, 2026-07-05 Raw: DB Intelligence Pipeline Source
DB Intelligence Pipeline
SequentialAgent containing 6 specialist LLM agents translates natural language into safe SQL with validation and explicit approval preparation before execution, followed by chart-spec generation. Lanes: Agents, Safety Gate.
flowchart TD
subgraph LANE_AG["Lane: Pipeline agents"]
SD["schema_discovery_agent (flash-lite)
get_database_schema"]
NL["nl_to_sql_agent (pro)
generate_sql"]
EX["query_executor_agent (pro)"]
IC["insight_chart_agent (pro)
generate_chart_spec, save_query_to_memory"]
end
subgraph LANE_GATE["Lane: Safety gate"]
SV{sql_validator_agent (flash-lite)
validate_sql_safety}
APPR{sql_preview_approval_agent (pro)
approve_sql_preview}
end
START([Natural-language question]) --> SD --> NL --> SV
SV -->|unsafe| REJ([Rejected + logged])
SV -->|safe| APPR
APPR -->|direct| RUN["execute_clinical_query"]
APPR -->|preview approved| RUN2["execute_approved_clinical_query"]
RUN --> IC
RUN2 --> IC
IC --> DONE([Table / chart / CSV export + history + audit])
Key facts:
- SQL never executes without passing
validate_sql_safety; the product exposes a read-only SQL preview with an explicit execution boundary ([[Problem and Solution]]). - The executor is
pro-customtoolstier; generation isprotier ([[Model Registry]]). - Results feed
generate_chart_specfor visual output, and the query is persisted to memory (save_query_to_memory) for later recall. - Schema and query engine live in
clinical_schemas.pyanddatabase.py([[Module Reference]]).
Related: [[Agent Architecture]] · [[End-to-End Request Flow]]