Skip to content

piyush080205/Schema-Assist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Schema Assist

Conversational Data Dictionary Agent for Relational Databases
Ask questions in plain English. Get SQL + interactive charts instantly.


What is Schema Assist?

Schema Assist transforms complex relational databases into a conversational analytics experience.

Instead of writing SQL, users can ask:

  • “Show monthly order trends”
  • “What’s the average delivery time?”
  • “Top 5 cities by revenue?”

The system interprets intent, generates queries, and returns interactive charts powered by Plotly.


Why This Matters

Business users often struggle with:

  • Writing SQL
  • Understanding schema relationships
  • Maintaining data dictionaries
  • Creating meaningful visualizations

Schema Assist solves this by combining:

  • LLM-powered intent parsing
  • Auto-maintained metadata layer
  • Dynamic query generation
  • Real-time visualization

How It Works

User Query
    ↓
Intent Understanding (LLM)
    ↓
Metadata-Aware Query Generation
    ↓
Database Execution
    ↓
Interactive Plotly Visualization
Screenshot 2026-02-22 110221 Screenshot 2026-02-22 110212

Core Architecture

1️ LLM/NLP Engine

Uses Cohere models for intent detection and embedding similarity.

2️ Metadata Layer

Auto-maintained schema descriptions, relationships, and sample values.

3️ Query Generator

Translates natural language → SQL or Pandas queries.

4️ Visualization Engine

Interactive charts using Plotly (line, bar, scatter, map, heatmap).

5️ Interface Layer

Deployable via:

  • React Web App
  • Slack Bot
  • Colab

Tech Stack

Layer Technology
Backend Python, FastAPI, SQLAlchemy
Database PostgreSQL
LLM Cohere Command + Embed
Vector Search FAISS
Visualization Plotly
Frontend React
Notebook Support Google Colab

Dataset Used

Brazilian E-Commerce Public Dataset by Olist

  • ~100k orders (2016–2018)
  • Customers, sellers, products, payments, reviews
  • Multi-table relational structure

Perfect for testing metadata-driven query generation.


Run in Google Colab

Install dependencies

!pip install langchain cohere plotly pandas sqlalchemy faiss-cpu

3. Clone the repository (if available)

!git clone https://github.com/piyush080205/Schema-Assist.git
%cd schema-assist

Usage Examples

User Query Bot Response
“What columns are in the orders table?” Displays table schema with descriptions + sample data
“What’s the average delivery time?” “Average delivery time is 12.3 days” + histogram
“Show me order distribution by state” Interactive Plotly map of Brazil with bubble sizes
“How have sales trended over time?” Plotly line chart with monthly order totals + forecast
“Is there a relationship between price and review score?” Plotly scatter plot with trend line

Demo Scenario

  1. Ask: “What’s in the dataset?” → Agent returns summary of tables and key columns.
  2. Follow‑up: “Show me top 5 product categories by sales” → Bar chart of top categories.
  3. Drill down: “Now filter to just 2018” → Updates chart with 2018 data.
  4. Explore: “Map of customer locations for electronics” → Geographic map of electronics orders.
  5. Analyze: “Correlation between freight cost and review score” → Scatter plot + trend line.

Team

Team Elite
HackFest 2.0 – Round I


License

This project is licensed under the MIT License.


Acknowledgments

  • Olist for the public Brazilian E‑Commerce dataset
  • Cohere for the LLM and embedding APIs
  • Plotly for beautiful interactive charts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors