Natural Language to SQL
Powered by Claude AI

Transform complex business questions into optimized SQL queries instantly. Connect to real Firebolt databases and get insights in natural language.

🎯 What This Demo Does

A complete natural language interface for SQL query generation and execution

Complete Analytics Workflow

This demo showcases a production-ready natural language to SQL system that connects to real Firebolt databases, generates optimized queries, and provides interactive visualizations.

1. Natural Language Input

Ask business questions in plain English

"Show me revenue by country for premium players this quarter"

2. AI-Powered SQL Generation

Claude AI analyzes your question and database schema

Generates optimized SQL with proper JOINs, aggregations, and filtering

3. Real Database Execution

Connects to live Firebolt database via MCP protocol

Sub-second query execution on columnar data warehouse

4. Interactive Visualization

Automatic chart generation with Plotly integration

Bar charts, line graphs, pie charts, and scatter plots

🚀 Key Features

Production-ready capabilities for enterprise analytics

Sub-Second Performance

Firebolt's columnar engine delivers lightning-fast query execution with automatic optimization and intelligent caching.

Intelligent SQL Generation

Claude 3.5 Sonnet understands business context and generates complex SQL queries with proper JOINs and aggregations.

Real Database Connectivity

Direct integration with Firebolt databases through secure MCP protocol with credential management.

Auto Visualization

Intelligent chart type selection and automatic visualization generation based on query results and data types.

SQL Editing

Review and modify generated SQL queries before execution with syntax highlighting and validation.

Performance Metrics

Real-time execution statistics including Firebolt engine time, network overhead, and query optimization insights.

💡 Example Queries

Try these sample questions to explore the demo's capabilities

Revenue Analysis

"Show me total revenue by country for the last 6 months"
Geographic revenue analysis with time filtering
"What's the average revenue per user by player tier?"
Player segmentation and monetization metrics

Player Analytics

"How many active players do we have by game type?"
Player engagement across different game categories
"Show me player retention rates by signup month"
Cohort analysis and retention tracking

Performance Metrics

"What are the top 10 highest-scoring players this month?"
Leaderboard and competitive analysis
"Show me game session duration trends over time"
Engagement patterns and time-series analysis

🛠️ Setup Instructions

Get the Natural Language to SQL demo running locally

1

Prerequisites

  • Docker Desktop installed and running
  • Python 3.8+ with pip
  • Anthropic API key (Claude access)
  • Firebolt account with service account credentials
2

Clone and Install

git clone https://github.com/asimrout-eng/mcp-agenticai.git cd mcp-nl-devrel pip install -r requirements.txt
3

Configure Credentials

# Set your Anthropic API key export ANTHROPIC_API_KEY="your_api_key_here" # Configure Firebolt credentials (optional - can set in UI) export FIREBOLT_MCP_CLIENT_ID="your_service_account_id" export FIREBOLT_MCP_CLIENT_SECRET="your_service_account_secret"
4

Launch Demo

# Run the Natural Language to SQL demo ./run.sh your_anthropic_api_key # Access at: http://localhost:8504

Demo Tips

  • Connection: Use the UI to enter Firebolt credentials or set environment variables
  • Questions: Start with simple queries and progress to complex multi-table joins
  • SQL Editing: Review and modify generated SQL before execution
  • Visualizations: Experiment with different chart types for your data
  • Performance: Check Firebolt engine times to see sub-second execution

🏗️ Architecture

How the Natural Language to SQL system works

User Input

Natural language business questions

Claude AI

Schema-aware SQL generation

MCP Protocol

Secure database connection

Firebolt DB

Lightning-fast query execution

Visualization

Interactive charts and insights