
N8AI SQL Chat Bot
Django, OpenAI, JavaScript, SQL, Python
Project
Overview
Excited to share a project I’ve been working on: an AI-powered SQL chatbot for data warehouses, built with Django, OpenAI, and PostgreSQL!
This application empowers users—regardless of SQL expertise—to interact with their data warehouse using natural language. Users can ask questions like“How many home runs did the Detroit Tigers hit this year?” and instantly receive safe, read-only SQL queries and results, all within a modern web interface.
The system leverages OpenAI’s language models to translate user queries into optimized SQL, while enforcing strict rules for security and accuracy (e.g., only generating SELECT
statements, using the correct fact tables for stats, and never exposing sensitive operations).
Key features include:
- Natural Language to SQL: Type questions in plain English; the AI generates and executes SQL, then returns results and a human-readable summary.
- Contextual Awareness: Maintains chat history and schema context for follow-up questions in a natural flow.
- Admin Tools: Manage chat sessions, view query logs, update schema files, and monitor database health from a dedicated panel.
- Schema-Driven Intelligence: Uses a YAML schema file to understand table relationships and business logic, ensuring accurate queries.
- Security First: Enforces read-only access and validates queries to prevent unsafe operations.
- User Experience: Clean, responsive UI with chat history, message copying, and robust error handling.
Whether you’re a data analyst, business user, or developer, this tool makes exploring your data warehouse as easy as having a conversation. If you’re interested in AI-driven analytics or want to see a demo, let’s connect!
Here are some additional pictures of some cool questions I asked the chat bot. Hope you enjoy!







Technologies
Django
OpenAI
JavaScript
SQL
Python