Skip to content

Muhammad-Adil-code/Klean-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Klean Data

Chat with your databases using natural language β€” powered by AI

MIT License Python React FastAPI

Klean Data Demo


What is Klean Data?

Klean Data lets you connect any database or upload a spreadsheet and talk to your data in plain English. Ask questions, get SQL or MongoDB queries generated automatically, review the plan, and approve before anything runs.

No SQL knowledge required. Your data never leaves your machine.


Screenshots

Login Sign Up
Login Signup
AI Chat Connectors Grid
Chat Connectors
Add Database AI Configuration
Add Connector AI Config
Notifications Popover
Notifications

Features

AI Chat

  • Ask anything about your data in plain English
  • AI generates a step-by-step action plan β€” you approve before anything runs
  • Thumbs up / down feedback on responses
  • Copy answer button on every response
  • Regenerate last response
  • Voice input β€” click the mic, speak your query
  • Upload files directly from the chat bar (CSV, Excel)

Data Connectors

  • PostgreSQL, MySQL, SQLite, MongoDB
  • CSV and Excel file upload
  • Auto-detects schema β€” tables, columns, row counts
  • Card grid layout β€” active source glows orange
  • Test connection before querying

AI Configuration

  • Add your own API keys (OpenAI, Gemini, DeepSeek, OpenRouter)
  • Add any OpenAI-compatible endpoint (Ollama, LM Studio, etc.)
  • Test keys before saving
  • Falls back to free rotating community keys if no key is set

UI / UX

  • 3-panel layout: dark sidebar + white chat area + history panel
  • History panel β€” search past queries, checkbox select, clear
  • Notifications bell with contextual alerts
  • Info popover β€” connection status, message stats, keyboard shortcuts
  • Login & Sign Up pages
  • PRO Plan card with Coming Soon modal
  • PRO badges on Templates, My Projects, Statistics

Tech Stack

Layer Technology
Frontend React 18 + TypeScript + Vite
Routing React Router v6
Backend FastAPI + Python 3.10+
Databases psycopg2, pymongo, mysql-connector, sqlite3
AI OpenAI-compatible API (any provider)

Quick Start

1. Backend

cd backend
pip install -r requirements.txt
uvicorn main:app --port 8766 --reload

2. Frontend

npm install
npm run dev

Open http://localhost:5173


Configuration

Environment Variables

Variable Default Description
OPENAI_API_KEY β€” Your own OpenAI key (optional)
OPENAI_BASE_URL deepseek API Base URL for AI requests
OPENAI_MODEL deepseek-chat Model name

Adding Your Own API Key (Recommended)

  1. Open the app β†’ AI Config tab in the sidebar
  2. Pick a provider (OpenAI, Gemini, DeepSeek, OpenRouter) or add a custom one
  3. Paste your API key β†’ click Test β†’ Save

The app uses your key first and falls back to free rotating community keys.


Project Structure

datalib/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Chat.tsx            # Main chat interface
β”‚   β”‚   β”œβ”€β”€ ConnectorsPanel.tsx # Database connector grid
β”‚   β”‚   β”œβ”€β”€ HistoryPanel.tsx    # Right-side history panel
β”‚   β”‚   β”œβ”€β”€ KdLogo.tsx          # KD geometric SVG logo
β”‚   β”‚   β”œβ”€β”€ ProModal.tsx        # Coming Soon modal
β”‚   β”‚   β”œβ”€β”€ SettingsPanel.tsx   # AI Config panel
β”‚   β”‚   └── Sidebar.tsx         # Dark left sidebar
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Login.tsx
β”‚   β”‚   └── Signup.tsx
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── DataLibContext.tsx  # Global state
β”‚   └── App.tsx                 # Router + layout
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                 # FastAPI app + endpoints
β”‚   β”œβ”€β”€ nlq_engine.py           # Natural language to query engine
β”‚   β”œβ”€β”€ key_manager.py          # API key rotation
β”‚   β”œβ”€β”€ key_fetcher.py          # Community key updater
β”‚   └── user_settings.py        # User API key storage
└── screenshots/
    └── demo.gif

Keyboard Shortcuts

Key Action
Enter Send message
Shift + Enter New line in input

License

MIT β€” free to use, modify, and distribute.


Built with love by Klean Data

About

πŸ—„οΈ Chat with your databases using AI β€” natural language to SQL, no SQL skills needed. Supports PostgreSQL, MySQL, SQLite, MongoDB, CSV & Excel.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors