Content
# Mcp-ChatBI
## Introduction
ChatBI, based on the [Mcp](https://mcp-docs.cn/) architecture, is a solution for data analysis agents.
This project primarily addresses three common issues with ChatBI:
+ 1. How to ensure 100% accuracy of data?
Due to the phenomenon of hallucination in models, whether it's NL2SQL or NL2Code, it is impossible to guarantee 100% accuracy of data. Since data accuracy is a red line for BI systems, this project employs the NL2Tools solution, where Tools can be either Headless BI services or APIs.
+ 2. How to query multiple metrics in a single conversation?
In the past, a single conversation could only query one metric. If multiple metrics were needed, it required engineering efforts to break them down, leading to high architectural complexity. In this project, we utilize the model's task planning and reasoning capabilities to automatically break down 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 advancements in 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
# Navigate to 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/)
You Might Also Like
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.
Github
GitHub MCP Server connects AI tools to GitHub for code management and automation.

apisix
Apache APISIX is an API Gateway for managing APIs and microservices.
opik
Opik is a powerful tool for managing and optimizing machine learning experiments.

MCP Toolbox for Databases
MCP Toolbox for Databases is an open-source server simplifying database tool...

sqlglot
SQLGlot is a no-dependency SQL parser and transpiler supporting 30 dialects.