Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Intelligent-Database-Query-Assistant

A conversational AI-powered assistant that allows users to query relational databases using natural language β€” no SQL knowledge required! Built using LangChain, OpenAI, and MySQL, this system bridges the gap between non-technical users and structured data access.

πŸš€ Features

  • πŸ” Query relational databases using plain English
  • 🧠 Converts natural language to SQL using LangChain + OpenAI
  • πŸ—ƒοΈ Executes real-time queries on a MySQL database
  • πŸ’¬ Provides natural language responses and displays SQL on request
  • πŸ•˜ Maintains session-based chat history
  • πŸ› οΈ Handles errors and unclear queries with clarification prompts

πŸ”§ Installation

Prerequisites:

  • Python 3.8+
  • MySQL Server
  • OpenAI API key
  • (Optional) LangChain key if applicable

Setup:

git clone https://github.com/your-username/database-query-assistant.git
cd database-query-assistant
pip install -r requirements.txt

Update config.py with:

OPENAI_API_KEY = "your_openai_key"
DATABASE = {
    "host": "localhost",
    "user": "your_db_user",
    "password": "your_password",
    "database": "your_db_name"
}

Run the application:

python app.py

Access the interface at http://localhost:5000.

πŸ§ͺ Testing

  • Manual backend SQL verification using MySQL Workbench
  • Query response validation through UI
  • Chat history and clarification tested across multiple sessions

🐞 Known Issues

Bug ID Description Status
BUG-001 No error message on incorrect DB credentials Fixed
BUG-002 Some chat histories fail to load completely Under Fix

πŸ› οΈ Built With

πŸ“ˆ Future Scope

  • πŸ”„ Multi-turn conversation support
  • πŸŽ™οΈ Voice input capabilities
  • πŸ“Š Data visualization integration
  • πŸ” Role-based access control
  • 🌐 Cross-database compatibility (PostgreSQL, NoSQL)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages