Natural Language to SQL, Built for Enterprise

Turn business questions into traceable SQL workflows

Text2SQL transforms business questions into executable, auditable, and governable SQL with multi-source access, RAG context, LangGraph orchestration, safety controls, and streaming delivery.

Live Query Console
Natural language question run_01H8Z...

How many orders and how much revenue did each region generate last month? Sort by revenue descending.

RAG Context
orders schemaregion dimensionhistorical SQL snippet+4 more
Generated SQL
SELECT
  region,
  COUNT(*) AS order_count,
  SUM(amount) AS sales_amount
FROM orders
WHERE created_at >= date_trunc('month', now() - interval '1 month')
GROUP BY region
ORDER BY sales_amount DESC;
Safety Check Passed
Read-onlyAllowed tablesRow-level policyTime range limit
Result Preview
regionorder_countsales_amount
East China12801,294,567.00
South China950987,654.00
North China860765,432.00

TRUSTED TECHNOLOGY

  • N Next.js
  • N NestJS
  • L LangGraph
  • P PostgreSQL
  • R Redis
  • S SSE

Multi-source Sessions

Unify SQLite, MySQL, PostgreSQL, CSV, and Excel while binding every session to the right data source.

RAG Semantic Context

Hybrid retrieval, RRF fusion, and reranking inject business terms, schemas, historical SQL, and relations into generation.

LangGraph Orchestration

clarify -> retrieve -> planning -> generate-sql -> safety-check -> execute -> format-answer.

Fail-Closed Governance

Read-only SQL, table permissions, workspace isolation, and deny-by-default controls keep data access safe.

Streaming UX & Tool Calls

SSE streams tool-call, tool-result, tool-error, and answer events with observable progress.

Traceable & Replayable

runId binds trace steps, delivery evidence, and replay so every generation can be reviewed.

Domain-aware modeling

Help database tables understand the business domain

Beyond schemas and fields, Text2SQL organizes business terms, entity relations, historical SQL, and data assets into reasoning-ready semantic context.

Business Term Mapping

Map orders, users, merchants, and GMV to real tables and fields.

Relationship Modeling

Add semantic entity links on top of primary and foreign keys.

Query Memory

Feed high-quality SQL and metric definitions back into domain knowledge.

Generation Injection

selected_context carries schemas and business meaning into SQL reasoning.

text2sql
Retail Domain · Model View
Synced 2 minutes ago

Architecture

An intelligent data analysis system driven by four domains

Every step from user question to executable SQL result is traceable, governed, and explainable.

View full architecture

Frontend

Web AppLive Console

API Gateway

RESTSSE

Conversation Runtime

ClarifyRetrieve KnowledgePlanningGenerate SQLSafety CheckExecute SQLFormat Answer

Knowledge & Governance

WorkspacePermissionsRAG PipelineAudit TrailMetadata Store

Delivery

StreamingQuery ResultTrace / Replay

Workflow

A standard path from question to answer

01

Clarify

Understand and clarify intent

02

Retrieve Knowledge

Fetch relevant knowledge and context

03

Planning

Plan the SQL generation strategy

04

Generate SQL

Produce candidate SQL

05

Safety Check

Validate safety and permissions

06

Execute SQL

Run read-only queries

07

Format Answer

Return an explainable answer

RAG Intelligence

Three retrieval routes for sharper generation

Lexical, dense, and graph retrieval combine through RRF fusion and reranking, then inject precise selected_context into SQL generation.

Explore RAG details
User Question Orders and revenue by region last month?
Lexical Search BM25
0.82
Dense Search Embedding
0.91
Graph Search Relations & rules
0.88
RRF FusionRerankContext InjectionSQL Generation

Governance

Safety governance that denies by default

Workspace

Datasource binding keeps sessions isolated.

Table-level

Permissions control which tables can be queried.

Policy Version

Rules are versioned for rollout and review.

Audit Trail

Audit events record the full query path.

Fail-Closed

Unknown or risky requests are denied by default.

Roadmap

Continuous evolution for enterprise data assistants

We will keep expanding the capability boundary for safer, more extensible data analysis.

  1. MCP Tool Ecosystem

    Connect MCP tools for more internal and external automation.

    2026 Q3
  2. Embedded Web Bot

    Embed data Q&A into websites, admin panels, and BI pages.

    2026 Q4
  3. More Data Connectors

    Add warehouses, object storage, and internal APIs.

    2027 Q1
  4. ChatBI Artifacts

    Generate tables, charts, SQL previews, and diagnostic panels.

    2027 Q2
  5. Eval & Rollout Gates

    Evaluate SQL accuracy, safety, and rollback risk before release.

    2027 Q3

From demo to governable data assistant

Built for developer and team analytics workflows: safe, controllable, and extensible.