A chat-based BI tool that writes SQL and asks for context
It wires LangGraph agents to your data warehouse so you can ask questions in plain English instead of writing SQL.

What it does
OpenChatBI is an open-source chat interface for business intelligence. It connects to databases like Presto, Trino, or MySQL and uses LLM-driven agents to turn natural language questions into SQL queries, execute them, and return answers with Plotly visualizations. The system also handles catalog management, indexing table schemas and business definitions to improve query accuracy.
The interesting bit
Instead of a single prompt-to-SQL pipeline, it orchestrates multi-step workflows through LangGraph state machines, complete with persistent SQLite-backed memory, proactive clarification when user questions are ambiguous, and sandboxed Python execution for custom analysis. It also layers in time-series forecasting and optional MCP tool integrations, making it less a simple text-to-SQL wrapper and more a modular analyst agent.
Key highlights
- Text2SQL with schema linking: Uses dedicated workflows with schema linking and prompt engineering to generate SQL, rather than naive prompt wrapping.
- Flexible catalog retrieval: Automatically indexes database structures and supports both vector-based and BM25-based retrieval for business metadata; if embeddings aren’t available, it falls back gracefully.
- Persistent memory: Conversations and user characteristics are stored via LangGraph checkpointing, so the agent remembers context across sessions.
- Sandboxed execution: Runs Python code in a restricted environment or Docker container for data analysis and visualization beyond static SQL results.
- MCP and knowledge base support: Can pull in external knowledge bases and MCP tools to answer questions that go beyond the raw database schema.
Caveats
- The README notes a hard dependency on LangGraph v1 (
langgraph==1.1.10) and the LangChain 1.x ecosystem; if you need earlier versions, you must pin tov0.2.2or below. - Chinese text segmentation relies on
jieba, which is incompatible with Python 3.12+, forcing a fallback to simple punctuation-based splitting on newer runtimes.
Verdict
Worth exploring if you need a self-hosted conversational SQL analyst with memory and tool use. Probably overkill if you just need a basic text-to-SQL snippet, and shops averse to LangGraph v1 lock-in should proceed with caution.
Frequently asked
- What is zhongyu09/openchatbi?
- It wires LangGraph agents to your data warehouse so you can ask questions in plain English instead of writing SQL.
- Is openchatbi open source?
- Yes — zhongyu09/openchatbi is open source, released under the MIT license.
- What language is openchatbi written in?
- zhongyu09/openchatbi is primarily written in Python.
- How popular is openchatbi?
- zhongyu09/openchatbi has 605 stars on GitHub.
- Where can I find openchatbi?
- zhongyu09/openchatbi is on GitHub at https://github.com/zhongyu09/openchatbi.