Skip to content

Talk to your database as if you were chatting with a friend. Turn natural language into powerful SQL queries effortlessly, and get your answers back in a language you understand. No technical jargon—just seamless, intelligent conversation with your data!

License

Notifications You must be signed in to change notification settings

hrithikkoduri/TalkQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TalkQL - Chat with Your Data

Turn conversations into insights with natural database interactions

Next.js React TypeScript Tailwind Framer Motion FastAPI LangChain GPT-4o Multi-DB Visualization

Introduction

TalkQL revolutionizes how you interact with databases by enabling natural language conversations with your data. Simply chat with your database as if you're talking to a friend, and watch as your questions transform into powerful SQL queries. Get answers in plain English, complete with intuitive visualizations and clear explanations.

UI Showcase

Demo

Table of Contents

Features

As referenced in the features component:

  • 🔄 Multi-Database Support: Connect to SQLite, MySQL, PostgreSQL, MS SQL, Snowflake, and CSV files
  • 💬 Natural Language Processing: Convert casual questions into precise SQL queries
  • 📊 Smart Visualizations: Automatic data visualization with context-aware chart selection
  • 📋 Flexible Display Options: Toggle between tabular and narrative formats
  • 🔍 Query Transparency: View and understand the generated SQL
  • 🎨 Modern, Intuitive Interface: Clean design with smooth transitions and animations

Architecture

Frontend

  • Next.js application with React components
  • Real-time chat interface
  • Dynamic visualization rendering
  • Responsive design with Tailwind CSS

Backend

  • FastAPI server handling request processing
  • LangChain for natural language processing
  • SQL query generation and optimization
  • Visualization generation with matplotlib/seaborn TalkQL follows a modern client-server architecture:
    graph TB
        subgraph Frontend["Frontend (Next.js)"]
            UI[User Interface]
            Chat[Chat Interface]
            Viz[Visualization Display]
        end
        
        subgraph Backend["Backend (FastAPI)"]
            API[API Layer]
            subgraph Agents["AI Agents"]
                SQL[SQL Agent]
                VIZ[Visualization Agent]
            end
            LLM[LangChain + GPT-4]
        end
        
        subgraph Databases["Database Support"]
            SQLite[(SQLite)]
            MySQL[(MySQL)]
            PostgreSQL[(PostgreSQL)]
            MSSQL[(MS SQL)]
            Snowflake[(Snowflake)]
            CSV[(CSV Files)]
        end
        
        UI --> |User Query| Chat
        Chat --> |HTTP Request| API
        API --> |Natural Language| SQL
        SQL --> |Query Generation| LLM
        LLM --> |SQL Query| SQL
        SQL --> |Execute Query| Databases
        Databases --> |Results| SQL
        SQL --> |Data| VIZ
        VIZ --> |Generate| LLM
        VIZ --> |Visualization| API
        API --> |Response| Chat
        Chat --> |Display| Viz
Loading

Key Components

  1. SQL Agent: Handles database connections and query processing
  2. Visualization Agent: Creates context-aware data visualizations
  3. Chat Interface: Manages user interactions and message display
  4. Database Connection Hub: Supports multiple database types

Technologies Used

Frontend

  • Next.js 15.0
  • React 18
  • Tailwind CSS
  • Framer Motion
  • TypeScript
  • React Markdown

Backend

  • Python 3.8+
  • FastAPI
  • LangChain
  • OpenAI GPT-4
  • SQLAlchemy
  • Matplotlib/Seaborn
  • Pandas

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/TalkQL.git
    cd talkql
  1. Install backend dependencies:
    cd backend
    python -m venv venv
    source venv/bin/activate # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  1. Install frontend dependencies:
    cd frontend
    npm install
  1. Set up environment variables: (.env)
    OPENAI_API_KEY=your_api_key

Usage

  1. Start the backend server:
    cd backend
    uvicorn api:app --reload
  1. Start the frontend development server:
    cd frontend
    npm run dev
  1. Open your browser and navigate to http://localhost:3000

  2. Connect your database using the connection interface

  3. Start chatting with your data!

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgements

  • OpenAI for GPT-4 API
  • LangChain community
  • All our contributors and users

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️

About

Talk to your database as if you were chatting with a friend. Turn natural language into powerful SQL queries effortlessly, and get your answers back in a language you understand. No technical jargon—just seamless, intelligent conversation with your data!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published