convez.ai
PluginDados & AnalyticsIntermediário
janga-ai

Chat With Your Data — Text2SQL Analytics

janga-ai/chat-with-your-data

Pergunte em português, obtenha SQL e gráficos em tempo real

Ver no GitHub
InicialPluginScore · de 0 a 100

Interface de analytics em linguagem natural que converte perguntas de negócio em SQL executável e gera gráficos automaticamente. Utiliza Claude Sonnet para geração de queries, Streamlit para a UI e suporta SQLite ou Databricks Delta Lake como backend de dados.

Instalação

$npx convez-ai janga-ai/chat-with-your-data

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
28%
Último commit
há 7 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Executivos consultarem dados sem conhecer SQL
  • Analistas de dados acelerarem exploração de datasets
  • Dashboards self-service com análises ad-hoc

Veredito

Plugin prático e bem arquitetado que democratiza acesso a dados via linguagem natural. Claude Sonnet com loop de reflexão integrado reduz alucinações SQL; a geração automática de charts agrega valor real. Ideal para equipes que precisam de analytics self-service sem DBA envolvido.

README

A tradução para o português deste README ainda está na fila.

🔍 Chat With Your Data — Text2SQL Analytics

Ask business questions in plain English. Get live SQL results with charts — powered by Claude Sonnet.

Python Streamlit Claude Deployed


🚀 Live Demo

🔗 chat-with-your-data.up.railway.app


📌 What It Does

Type a business question in plain English — Claude Sonnet converts it to SQL, runs it live against the database, and returns formatted results with an auto-generated chart.

Example questions:

  • "Which manufacturer sold the most units in 2025-Q1?"
  • "Average range by segment — SUV vs Sedan vs Truck"
  • "Top 5 countries by total EV units sold"
  • "How does Tesla's MSRP compare to BYD across quarters?"
  • "Which models qualify for a government subsidy above $5,000?"
  • "Monthly sales trend for Hyundai Ioniq 6 across all regions"
  • "Countries with the highest average charging stations nearby"
  • "Show battery capacity vs range for all models"

✨ Key Features

FeatureDescription
Natural Language → SQLClaude Sonnet converts plain English to executable SQL
Schema-Aware PromptingDelta Lake table schemas injected dynamically into Claude's context window — accurate multi-table joins, no hallucination
Error Reflection LoopIf SQL fails, Claude automatically receives the error and self-corrects — no user intervention needed
Auto Chart GenerationClaude picks the best chart type (bar, line, scatter, pie) based on the question and result shape
Query HistoryAll queries and results persist in the session
CSV ExportOne-click download of any result set

🏗️ Architecture

User Question
     │
     ▼
Schema Injector  ──►  Claude Sonnet (SQL Generation)
                              │
                              ▼
                       SQL Query
                              │
                         ┌────┴────┐
                         │ Execute │
                         └────┬────┘
                         Success?
                        ╱         ╲
                      Yes          No
                       │            │
                       │     Claude Sonnet
                       │    (Reflection Loop)
                       │            │
                       └─────┬──────┘
                             ▼
                    Results + Auto Chart

🛠️ Tech Stack

  • LLM: Anthropic Claude Sonnet — SQL generation + error reflection
  • Frontend: Streamlit — chat UI, results table, session history
  • Database: SQLite (mock demo) → Databricks Delta Lake (production)
  • Charts: Matplotlib
  • Deployment: Railway

📁 Project Structure

chat-with-your-data/
├── app.py               # Streamlit UI — chat, results, charts
├── sql_generator.py     # Claude API — SQL generation + reflection loop
├── schema_loader.py     # Schema injector for Claude's context window
├── database.py          # Query executor (SQLite / Databricks)
├── ev_mock_data.py      # In-memory SQLite seed data (2,970 rows)
├── requirements.txt
├── Procfile             # Railway deployment
└── .streamlit/
    └── config.toml

⚡ Run Locally

# 1. Clone the repo
git clone https://github.com/limbarajjanga-spec/chat-with-your-data.git
cd chat-with-your-data

# 2. Install dependencies
pip install -r requirements.txt

# 3. Add your API key
echo "ANTHROPIC_API_KEY=your_key_here" > .env

# 4. Run
streamlit run app.py

Open http://localhost:8501


🔄 Switching to Databricks (Production)

  1. Install connector: pip install databricks-sql-connector
  2. Add env vars:
DATABRICKS_SERVER_HOSTNAME=your-workspace.azuredatabricks.net
DATABRICKS_HTTP_PATH=/sql/1.0/warehouses/your_id
DATABRICKS_ACCESS_TOKEN=dapi...
  1. Uncomment Databricks block in database.py
  2. Set mode="databricks" in app.py

Everything else — SQL generation, reflection, charts — works identically.


👤 Author

Limba Raj Janga
AI Engineer | Ex-ICICI Bank | IIT Kharagpur
LinkedIn · GitHub

Ver o original no GitHub

Bom para

Relacionados