
🗣 📊Chat2Data is tool for interacting with databases, supporting MySQL, PostgreSQL, SQLite3, and CSV files, HTML page.
Feature
- 🗣 Easy Interaction: Chat2Data lets you chat with your databases, making it intuitive to use.
- 🔗 Multiple Databases: It supports MySQL, PostgreSQL, SQLite3, and CSV files.
- 🐳 Docker Support: It provides a Docker image for easy deployment.
- 💻 CLI and Web UI: It offers both a command line and a web interface.
- ⚙️ Simple Installation: It's easy to install with Go command.
- 🧠 AI Integration: It leverages OpenAI API for advanced natural language processing.
Preview

Install
Download
Releases Page
Go install
go install github.com/byebyebruce/chat2data/cmd/chat2data@latest
Quick Run
OPENAI_API_KEY=xxx ./chat2data db -c ./testdata/world_happiness_2015.db
Ask: Which is the highest happiness country?
docker run --rm -it -e OPENAI_API_KEY=xxx -p 8088:8088 bailu1901/chat2data html 'https://github.com/byebyebruce/chat2data
Open http://localhost:8088 in browser, then ask: What is the feature of chat2data?
Config
- Use local
.env file ./cp .env.template .env then edit it.
- You can also use
export OPENAI_API_KEY=xxx to specify the environment variables.
- Or run with env
OPENAI_API_KEY=xxx OPENAI_BASE_URL=https://api.openai.com ./chat2data db root:pwd@tcp(localhost:3306)/mydb
Usage
- help
./chat2data --help
global flags
--web -w web ui port
--cli -c cli mode
- Run CLI(command line interface)
- mysql
./chat2data db -c root:pwd@tcp(localhost:3306)/mydb
- postgre
./chat2data db -c postgres://db_user:mysecretpassword@localhost:5438/test?sslmode=disable
- sqlite3
./chat2data db -c ./sqlite.db
- csv
./chat2data csv -c ./csvfile.csv or ./chat2data csv ./csvdir
- html
./chat2data html -c https://github.com/byebyebruce/chat2data
- with env
OPENAI_API_KEY=xxx chat2data db -c root:pwd@tcp(localhost:3306)/mydb
- Run Web UI
- mysql
./chat2data db root:example@tcp(10.12.21.101:3306)/mydb
- html
./chat2data html https://github.com/byebyebruce/chat2data
- sqlite3
./chat2data db -w=:0.0.0.0:8088 ./mytest.db
Build
git clone github.com/byebyebruce/chat2data
make build
docker build -t chat2data .
TODO
- Support Docker
- Support Postgre Database
- Support load csv
- Add Web ui
- Local vector database
- Support load html
- Doc QA
- Beautiful CLI
Special Thanks
