Content
# My DB Mate
[English](README.en.md) |
**Chat with your database.** Ask in natural language, get answers based on real SQL, no need to write queries by hand.

---
## Why I created this product
This product is for DevOps/DBAs managing large databases in production, who daily receive ad-hoc data requests from business, product, and finance teams. Available dashboards are often rigid and lack the specific data slices needed. Writing SQL queries manually each time is time-consuming, especially in systems with multiple tables and overlapping business logic.
The problem isn't converting questions into SQL; Large Language Models (LLMs) already do that quite well. The issue is providing context for the AI to generate accurate results: What does `usr_stat_cd` mean? How does "active customer" map to the DB structure? These conventions are often only known to DBAs and aren't captured in the schema. While LLMs can infer common abbreviations, they can't understand opaque enum codes or the specific knowledge of each system. This context must be built up by users over time; no LLM can self-supply it.
So, My DB Mate doesn't rely on text-to-SQL. Instead, it focuses on a layer of context (glossary, schema annotations, verified queries) that you build over time, helping AI understand your system better.
And because this is a production DB, safety is a mandatory condition, not an added feature: read-only access at multiple layers, all queries go through a review point, encrypted credentials, and audit logs for every run.
---
## Getting Started
| You are… | Read this file |
|---|---|
| **A user** who wants to self-install & use | [User Guide](docs/user-guide.md) |
| **An AI agent** to help with setup ("read this file, then install and guide me") | [`docs/agent-setup.md`](docs/agent-setup.md) |
| Want to see **capabilities + tech stack + safety model** | [Features & Technical Reference](docs/features.md) |
Quick setup (requires Docker):
```bash
./setup.sh # create .env, generate encryption keys, prompt for OpenRouter key
docker compose --profile full up # app + DB + auto-migrate → http://localhost:3000
```
---
## License
Released under the **[PolyForm Noncommercial License 1.0.0](LICENSE.md)** — free to use, modify, and share for all **non-commercial** purposes (personal, educational, research, nonprofit organizations).
**Commercial use requires a separate license — contact the author at phucnt0@gmail.com.**
Copyright © 2026 Trong Phuc ([phuc-nt](https://github.com/phuc-nt)).