Vaibhav More Logo
VAIBHAVMORE
COMPLETED / RAG SYSTEM•
2024

SQL Talker

Natural Language to SQL Assistant using Schema-Aware RAG

LLM and RAG assistant converting natural English questions into valid SQL queries with FAISS schema indexing and HuggingFace embeddings.

GitHub Repository
Category

AI & Machine Learning, Backend Systems

Timeline

2024 Development

Primary Core

LangChain • HuggingFace Embeddings

Platforms

Cross-Platform

PROJECT OVERVIEW & STRATEGY

Problem, Solution & Engineering Scope

The Industry Friction

Operational Challenges & Cloud Fragility

Business stakeholders have to wait for data engineering teams to write ad-hoc SQL queries for routine operational metrics.

The Architectural Solution

Offline-First Zero Latency Local Engine

Built a schema-aware RAG pipeline that accurately identifies relevant tables, joins, and aggregates to generate and run SQL autonomously.

Core Project Objectives
  • 1Schema-aware retrieval using FAISS vector indexing for precise column and table matching
  • 2Converts natural language queries ('Which customer generated the most revenue in Q3?') into valid SQL
  • 3Automated query syntax validation and safe read-only execution harness
  • 4Interactive Streamlit dashboard visualizing SQL query results in real time
Target End-Users
  • Automotive Service Centers & Independent Garages
  • Spare Parts Retailers & Inventory Managers
  • Offline POS Operators needing Zero-Cloud Dependability
Architecture & Modules

Key System Capabilities

Engineered features and deep architectural implementations.

3 Modular Features

Natural Language SQL Generation

Translates complex analytical questions into multi-table JOINs and GROUP BY queries.

FAISS Schema Indexing

Indexes table descriptions and column types, preventing context overflow on large database schemas.

Read-Only Security Guardrails

Restricts execution strictly to SELECT operations, preventing data modification or drops.

Topology & Pipeline

System Architecture & Engineering Design

The user's query is embedded using HuggingFace sentence transformers, compared against the FAISS index of database schemas, and supplied alongside the prompt to the language model to generate syntactically valid SQL queries.

High-Level Distributed System
Interactive Architecture Map
Frontend / UI

Presentation Layer

User interface, client-side state handling, input sanitization, and responsive views.

Main / API

Application Core

Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.

Database

Persistence Layer

Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.

Integrations

External Services

Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.

Frontend Layer

User interface, client-side state handling, input sanitization, and responsive views.

Backend / Logic

Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.

Database Layer

Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.

Integration Layer

Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.

Under The Hood

Technology Stack & Core Tooling

Selected languages, frameworks, runtime environments, and engines.

7 Technologies Identified
LA
Tools

LangChain

Engineered architecture using LangChain

Integratedlangchain
HU
Tools

HuggingFace Embeddings

Engineered architecture using HuggingFace Embeddings

Integratedhuggingfaceembeddings
FA
Tools

FAISS

Engineered architecture using FAISS

Integratedfaiss
Python logo
Backend

Python

Dynamic programming language utilized for data modeling, statistical ARIMA forecasting, and machine learning pipelines.

Integratedpython
SQLite logo
Database

SQLite

Serverless, zero-configuration, transactional local SQL database with ACID guarantees and zero latency.

Integratedsqlite
ST
Tools

Streamlit

Engineered architecture using Streamlit

Integratedstreamlit
LL
Tools

LLM APIs

Engineered architecture using LLM APIs

Integratedllmapis
Problem Solving

Engineering Challenges & Technical Solutions

Complex bottlenecks, concurrency hurdles, and architectural decisions resolved during development.

1 Critical Engineering Trade-offs
Technical Resolution

Constrained generation using strict schema context retrieved from FAISS and validated column names against SQLite metadata.

Authorship & Ownership

Individual Contributions & Architectural Ownership

Core development, system architecture, database schema, and delivery milestones.

Constructed the schema embedding and FAISS vector index pipeline

Engineered LangChain prompt templates and output parsers

Built the interactive UI with SQL preview, schema explorer, and data table rendering

Results & Metrics

Project Outcomes & Benchmarks

Empowered non-technical users to query relational data directly using conversational English with guaranteed schema correctness.

Next Case Studies

Explore Other Architectures

All Projects & Case Studies →
Automation & Utilities

AutoBillDrive

Offline-first desktop billing application for Windows with SQLite persistence, automated PDF generation, Google Drive sync, and WhatsApp delivery.

Explore Architecture
Full-Stack Web

EventApp

Production-ready event registration platform with Spring Boot 3.2, React 18, JWT RBAC, QR-code ticket generation, and async email confirmations.

Explore Architecture