Chat with your database using natural language powered by AI
Database Management Agent is an intelligent Streamlit-based application that allows users to interact with SQLite databases using natural language. Powered by Groq AI and LangChain, it converts your questions and commands into optimized SQL queries, eliminating the need to write SQL manually.
Whether you want to query data, insert records, update information, or analyze your database—just ask in plain English and let the AI handle the rest!
- Ask questions in plain English instead of writing SQL
- Get instant answers from your database
- No SQL knowledge required
- Create new databases instantly with a simple name
- Upload existing
.dbfiles directly from your laptop - Support for
.db,.sqlite, and.sqlite3formats
- SELECT - Query and retrieve data
- INSERT - Add new records
- UPDATE - Modify existing data
- DELETE - Remove records
- ALTER - Modify table structures
- CREATE/DROP - Table management
- Download updated databases with all changes
- Export your modified database back to your computer
- Preserve all AI-made modifications
git clone https://github.com/yourusername/dbma.git
cd dbmapython -m venv .venv
.venv\Scripts\activate # On Windows
source .venv/bin/activate # On macOS/Linuxpip install -r requirements.txt- Download and install Ollama
- Pull the DeepSeek model:
ollama pull deepseek-v3.1:671b-cloud- Start Ollama server (usually runs on port 11434)
Create a .env file (optional):
# Add any configuration here if neededstreamlit run app.pyThe app opens at http://localhost:8501
Step 1: Set up Database
- Choose "Create New Database" or "Load Existing Database"
- If creating: Enter a database name
- If loading: Upload your
.dbfile
Step 2: Ask Questions
- Type your query in the chat box
- Examples:
- "Show me all students"
- "How many records do we have?"
- "Add a new student named John"
- "Update the age for user 5"
- "Delete records older than 2020"
Step 3: Download Results
- After making changes, click "⬇️ Download Database"
- Your updated database is ready to use!
User: "Show me the top 5 students with highest grades"
Agent: Creates SELECT query, retrieves and displays results
User: "Add a new student named Alice, age 20, grade A"
Agent: Constructs INSERT query, adds record, confirms operation
User: "Update John's grade to B+"
Agent: Finds John, updates grade, shows affected rows
User: "How many students are in each class?"
Agent: Creates GROUP BY query, displays summary
dbma/
├── app.py # Main Streamlit application
├── main.py # CLI version of the agent
├── main.ipynb # Jupyter notebook for experimentation
├── requirements.txt # Python dependencies
├── .env # Environment variables (optional)
├── README.md # This file
├── databases/ # Created databases stored here
├── temp/ # Uploaded databases stored here
└── .venv/ # Virtual environment
To use a different AI model, edit line 94 in app.py:
llm = ChatOllama(model="your-model-name", temperature=0)Available Ollama models: ollama.ai/library
Change default result limit in system prompt (currently 5 rows)
Modify in app.py for multi-user scenarios:
st.session_state.config = {"configurable": {"thread_id": "unique_id"}}✨ Data Analysis - Quickly query and analyze database content
📊 Data Management - Insert, update, and manage records without SQL
🔍 Database Exploration - Understand database structure and content
📱 Rapid Prototyping - Quickly test database operations
🎓 Learning - Great tool for beginners to learn databases
🚀 Business Intelligence - Extract insights from data easily
If you find DBMA useful, please star this repository! Your support motivates continued development.
Made with ❤️ for database lovers everywhere
Last Updated: March 2026