Content
# Mcp-ChatBI
## Introduction
ChatBI, based on the [Mcp](https://mcp-docs.cn/) architecture, is a solution for data analysis agents.
This project mainly addresses three common issues with ChatBI:
+ 1. How to ensure 100% accuracy of the data?
Due to the model's hallucinations, whether it's NL2SQL or NL2Code, it cannot guarantee 100% accuracy of the data. Since data accuracy is a red line for BI systems, this project uses the NL2Tools solution, where Tools can be a Headless BI service or an API.
+ 2. How to query multiple metrics in one conversation?
In the past, only one metric could be queried in a single conversation. If multiple metrics were needed, it required engineering-level disassembly, resulting in high architectural complexity. In this project, the model's task planning and reasoning capabilities are utilized to automatically disassemble multiple metrics, sequentially call Tools, and return results.
+ 3. How to automate the data analysis process?
Common data analysis methods, such as comparative analysis, multidimensional drilling, and attribution calculations, often involve complex logical reasoning. With the rapid advancement of large model capabilities, they now possess the ability to reason through complex problems. Therefore, this project leverages the model's reasoning ability to automatically generate data links, sequentially call Tools, return results, and finally summarize the analysis.
## Deployment
### 1. Environment Configuration
+ Ensure your machine has Python 3.10 - 3.12 installed.
```shell
# Clone the repository
$ git clone https://github.com/dynamiclu/Mcp-ChatBI.git
# Enter the directory
$ cd Mcp-ChatBI
# Install all dependencies
$ pip3 install -r requirements.txt
```
+ Large model configuration
```shell
$ vim config/config.toml
[model]
qwen_api_key = "sk-**********"
qwen_model_name = "qwen-max"
```
### 2. Start the API
```shell
# Start the API
$ python3 main-api.py
```
### 3. Start Gradio
```shell
# Start Gradio
$ python3 main-webui.py
```
### 4. Demo
[https://www.bilibili.com/video/BV1b95vzPEjf/](https://www.bilibili.com/video/BV1b95vzPEjf/)
Connection Info
You Might Also Like
MarkItDown MCP
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
Github
GitHub MCP Server connects AI tools to manage repositories, issues, and workflows.