Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,4 +10,57 @@ pinned: false
|
|
| 10 |
short_description: MCP Data Analyst Duo
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
short_description: MCP Data Analyst Duo
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# MCP: Data Analyst Duo
|
| 14 |
+
|
| 15 |
+
A lightweight two-agent pipeline using the **Model Context Protocol (MCP)** to load a CSV, compute statistics & correlations, interpret results with simple rule-based insights, and assemble a Markdown report—all powered by a Gradio interface.
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## 🚀 Features
|
| 20 |
+
|
| 21 |
+
- **ComputeAgent**
|
| 22 |
+
- Loads any publicly-accessible CSV into a pandas DataFrame
|
| 23 |
+
- Computes descriptive statistics (count, mean, std, min, quartiles, max)
|
| 24 |
+
- Computes a Pearson correlation matrix for all numeric columns
|
| 25 |
+
|
| 26 |
+
- **InterpretAgent**
|
| 27 |
+
- Acknowledges each compute result
|
| 28 |
+
- Picks top 3 columns by range and top 3 strongest correlations
|
| 29 |
+
- Formats human-readable insights and a concise summary
|
| 30 |
+
- Assembles a final Markdown report combining preview, metrics, and insights
|
| 31 |
+
|
| 32 |
+
- **Gradio UI**
|
| 33 |
+
1. **Input:** Paste your CSV URL
|
| 34 |
+
2. **Outputs (in order):**
|
| 35 |
+
- First five rows preview
|
| 36 |
+
- JSON statistics
|
| 37 |
+
- JSON correlation matrix
|
| 38 |
+
- ComputeAgent message history
|
| 39 |
+
- InterpretAgent message history
|
| 40 |
+
- Final Markdown report
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 🏗 Architecture
|
| 45 |
+
|
| 46 |
+
1. **MCPMessage**
|
| 47 |
+
- Typed messages (`request_*`, `*_result`, `ack`, `*_interpretation`, `report_result`)
|
| 48 |
+
- Ensures strict request–response semantics
|
| 49 |
+
|
| 50 |
+
2. **ComputeAgent**
|
| 51 |
+
- Handlers for `request_data_load`, `request_statistics`, `request_correlation`
|
| 52 |
+
- Emits `data_load_result`, `statistics_result`, `correlation_result`
|
| 53 |
+
|
| 54 |
+
3. **InterpretAgent**
|
| 55 |
+
- Receives compute results, replies with `ack`
|
| 56 |
+
- Runs `interpret_statistics` & `interpret_correlation` tools
|
| 57 |
+
- Emits `statistics_interpretation`, `correlation_interpretation`
|
| 58 |
+
- On `request_report`, emits `report_result` with assembled Markdown
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 🎛 Usage
|
| 63 |
+
|
| 64 |
+
1. Clone or fork this Space.
|
| 65 |
+
2. Ensure your CSV is publicly
|
| 66 |
+
|