Chatdb
Chat with your Database, no more writing SQL queries
Install / Use
/learn @apurv101/ChatdbREADME
ChatDB - RDS Database Chat App
ChatDB - an RDS Database Chat App is a Streamlit-based application that allows you to connect and communicate with any database. You can run this app using Docker for easy deployment. With this app, you can start a conversation with your database and retrieve information as needed. This app performs way better than langchain's SQL agent and cost way less.
Disclaimer
It is recommended that you create a user without write permissions to connect with this agent, since this agent might perform DML statements on your database. Use with care!!
Environment Configuration
-
Clone the repo to your local machine and navigate to the app directory by running the following commands:
git clone https://github.com/chatdbtech/chatdb.git cd chatdb -
Create a
.envfile in the root directory of the app if it doesn't already exist. -
Open the
.envfile and add the following line with your OpenAI API key:OPENAI_API_KEY=your-openai-key
Docker Setup
To run the app in a Docker container, follow these instructions:
-
Make sure you have Docker installed on your system.
-
Build the Docker image by running the following command in the same directory as your Dockerfile:
docker build -t chatdb .
- Once the image is built, you can run the container using the following command:
docker run -d -p 8501:8501 chatdb
This will start the app inside a Docker container and expose it on port 8501.
Alternative Installation without Docker
-
Install Miniconda depending on your OS from https://docs.conda.io/projects/miniconda/en/latest/index.html
-
Create a conda environment named
chatdb-venvusing the commandconda create --name chatdb-venv python=3.8 -
Activate the environment using
conda activate chatdb-venv -
Within the root directory run
pip install -r requirements.txt -
Run the application using
streamlit run app.py
Using ChatDB
ChatDB is designed to connect to your database and allow you to communicate with it. Here are the steps to get started:
Instructions
-
Enter the URI of your RDS Database in the text box provided. The format is generally this
postgres://username:password@host:port/databasefor a postgres database. -
Click the Start Chat button to initiate the chat with your database.
-
Enter your message in the text box below and press Enter to send the message to the API.
Chat with the API
- Enter your message in the chat input box, and the app will display the response from your database. You can have a conversation with the database by entering messages and receiving replies.
Chatting with a sample database
-
Clone this repository https://github.com/morenoh149/postgresDBSamples. It has several sample databases. We will dump the
worldDB-1.0into postgres in local system and try to chat with it. -
Ensure you have PostgreSQL installed in your system. Run this in terminal to ensure it
psql postgres. -
Create a database named
worlddbusing commandcreate database worlddb. -
Navigate to the folder
worldDB-1.0and runpsql -U your_username -d worlddb -W -
Within postgres cli run
\i world.sql. This will dump the data. -
Navigate to streamlit app and Enter the URI. It should look like this
postgres://apoorvagarwal@localhost:5432/worlddb. Here replaceapoorvagarwalwith your username. -
Here is how it looks.

-
Here we ask some questions.

Contact Us
If you have any questions, comments, or suggestions about this app, please feel free to contact us.
Enjoy using the ChatDB to interact with your database through a user-friendly interface!
Related Skills
feishu-drive
347.0k|
things-mac
347.0kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
347.0kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
codebase-memory-mcp
1.2kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 66 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
