Content
# Mcp-ChatBI
## Introduction
ChatBI based on [Mcp](https://mcp-docs.cn/) architecture is a solution for data analysis intelligent agents.
This project mainly solves three common problems of ChatBI:
+ 1. How to ensure 100% accuracy of data?
Due to the hallucination of the model, neither NL2SQL nor NL2Code can guarantee 100% accuracy of the data. And the accuracy of data is the red line of the BI system. Therefore, this project uses the NL2Tools solution. Tools can be Headless BI services or APIs.
+ 2. How to query multiple indicators in one conversation?
In the past, only one indicator could be queried in one conversation. If multiple indicators need to be disassembled at the engineering level, the complexity of the architecture is very high. In this project, the model's task planning and reasoning capabilities are used. The model automatically disassembles multiple indicators and calls Tools in order, and returns the results.
+ 3. How to automate the data analysis process?
Common data analysis methods, such as comparative analysis, multi-dimensional drill-down, and attribution calculation, are often accompanied by complex logical reasoning. The current large model capabilities are advancing by leaps and bounds and already have the reasoning ability for complex problems. Therefore, this project uses model reasoning capabilities to automatically generate data links, call Tools sequentially, return results, and finally summarize the analysis.
## Deployment
### 1. Environment Configuration
+ Make sure your machine has Python 3.10 - 3.12 installed
```shell
# Pull 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 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
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents 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.