Skip to content

mathncode-sid/chat_DB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatDB: AI-Powered SQLite Database Q&A

ChatDB is a Python application that lets you ask natural language questions about a SQLite music store database. It uses OpenAI's GPT-4o model to interpret your questions and provide answers based on the database schema and sample data.

Features

  • Connects to a local SQLite database (chinook.sqlite)
  • Automatically fetches schema and sample data from all tables
  • Uses OpenAI GPT-4o for natural language Q&A
  • Interactive chat interface powered by Chainlit

Requirements

Installation

  1. Clone the repository:
    git clone https://github.com/mathncode-sid/chat_DB.git
    cd chat_DB
  2. Install dependencies:
pip install -r requirements.txt
  1. Place your chinook.sqlite file in the project directory.

  2. Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY=your-api-key

Usage

  1. Start the Chainlit app:
chainlit run app.py
  1. Open the provided URL in your browser and start asking questions about the database, such as: "List the top 5 artists by album count." "What genres are available in the store?" The AI is tailored to only answer questions from the Database

Project Structure

i) app.py — Main application logic
ii) chinook.sqlite — SQLite database file
iii) requirements.txt — Python dependencies

What's Next

  • Expand core chat features and improve user experience
  • Integrate new database options and optimize existing queries
  • Add advanced user authentication and role management
  • Enhance testing coverage and automation
  • Improve documentation with usage examples and deployment guides
  • Explore deployment to cloud platforms and containerization

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages