2026
AI Database Administrator
Ask a database a question in plain English and get the SQL and the answer back. A Streamlit chat sends the question to llama3 through Ollama with the table schema, a strict “SQL only” instruction and one worked example. It pulls the SELECT out of the reply, runs it on SQLite, and shows the query alongside the result.
- A sidebar health panel shows database size, table and record counts, and the schema viewer.
- A department chart is built with Matplotlib from a live aggregate query.
- Chat history persists for the session. 1,000 employee records were loaded from Excel.
What I'd change: extract SQL across line breaks (the third example shows why), run generated SQL through a read-only connection with an allow-list, and support multi-table schemas.
- Python
- Streamlit
- Ollama · llama3
- SQLite
- pandas
You asked
who has highest salary
llama3 wrote
SELECT * FROM employees ORDER BY salary DESC LIMIT 1;
SQLite returned
| id | name | department | salary |
|---|---|---|---|
| 290 | Suresh289 | Sales | 299953 |
Real runs of the project's own code against its database, captured while building this page.