Ask a question in plain English, get a plain-English answer — from any database connected through Trino (PostgreSQL, MongoDB, MySQL, and more). The app finds the relevant tables, writes one SQL query, runs it, and turns the result into an answer.
- Trino — query engine every database connects through
- Qdrant — vector store for searchable schema descriptions
- Ollama — generates embeddings for Qdrant
- An LLM via a LiteLLM proxy (or any OpenAI-compatible endpoint)
- Upstash Redis (optional) — session history/memory; falls back to a local JSON file
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in your Trino, Qdrant, Ollama, and LLM detailsIf Trino can connect to it (Postgres, MongoDB, MySQL, Snowflake, and most others):
- Add it to Trino's catalog configuration.
- Add its catalog name to
TRINO_CATALOGSin.env. - Run
python main.py --ingest --force.
If it's not something Trino can connect to (a file upload, a custom API), write a plugin:
- Copy
app/tools/plugin_template.pytoapp/tools/<yourname>_tool.py. - Fill in its
name,description,tool_schema(), andexecute(). - Register it in
app/tools/registry.py.
python main.py --ingest # load your database's structure (once, or whenever it changes)
python main.py # ask questions in the terminal
uvicorn app.api:app --reload # or as a web app at http://localhost:8000