anurag-deo commited on
Commit
b4a7715
·
verified ·
1 Parent(s): 8ff817c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +280 -277
README.md CHANGED
@@ -1,277 +1,280 @@
1
- ---
2
- title: DS-STAR
3
- emoji: ✨
4
- colorFrom: purple
5
- colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 6.0.1
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- short_description: Multi-Agent AI System for Automated Data Science Tasks
12
- tags:
13
- - mcp-in-action-track-consumer
14
- - langgraph
15
- - multi-agent
16
- - data-science
17
- - automation
18
- ---
19
-
20
- <div align="center">
21
-
22
- # ✨ DS-STAR
23
-
24
- ### **D**ata **S**cience - **S**tructured **T**ask **A**nalysis and **R**esolution
25
-
26
- [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Anurag-Deo/DS-STAR)
27
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
28
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
29
- [![LangGraph](https://img.shields.io/badge/Built%20with-LangGraph-orange)](https://langchain-ai.github.io/langgraph/)
30
-
31
- **A powerful multi-agent AI system that automates data science tasks through intelligent collaboration.**
32
-
33
- [🚀 Try Demo](https://huggingface.co/spaces/Anurag-Deo/DS-STAR) • [📖 Documentation](#-usage) • [🐛 Report Bug](https://github.com/Anurag-Deo/DS-STAR/issues)
34
-
35
- </div>
36
-
37
- ---
38
-
39
- ## 🎯 What is DS-STAR?
40
-
41
- DS-STAR is a **multi-agent AI system** built with LangGraph that takes your natural language questions about data and automatically:
42
-
43
- 1. 📊 **Analyzes** your data files to understand their structure
44
- 2. 📝 **Plans** a step-by-step approach to answer your question
45
- 3. 💻 **Generates** Python code to perform the analysis
46
- 4. **Verifies** the solution meets your requirements
47
- 5. 🔄 **Iterates** with smart backtracking if needed
48
- 6. 🎯 **Delivers** polished, accurate results
49
-
50
- > **Built for the 🤗 Hugging Face MCP 1st Birthday Hackathon**
51
-
52
- ---
53
-
54
- ## ✨ Key Features
55
-
56
- | Feature | Description |
57
- |---------|-------------|
58
- | 🤖 **Multi-Agent Architecture** | Six specialized agents working in harmony |
59
- | 🔄 **Iterative Refinement** | Automatically improves solutions through multiple cycles |
60
- | 🔙 **Smart Backtracking** | Intelligently reverts failed approaches |
61
- | 📊 **Auto Data Analysis** | Understands your data structure automatically |
62
- | 💻 **Code Generation** | Produces clean, executable Python code |
63
- | 🌐 **Multi-Provider Support** | Works with Google, OpenAI, Anthropic, or custom APIs |
64
- | 🎨 **Modern UI** | Beautiful dark-themed Gradio interface |
65
-
66
- ---
67
-
68
- ## 🏗️ Architecture
69
-
70
- DS-STAR uses a sophisticated multi-agent workflow powered by LangGraph:
71
-
72
- ```
73
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
74
- │ Analyzer │────▶│ Planner │────▶│ Coder │
75
- │ 📊 Analyze │ │ 📝 Plan │ │ 💻 Code │
76
- └─────────────┘ └─────────────┘ └─────────────┘
77
-
78
-
79
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
80
- Finalyzer │◀────│ Router │◀────│ Verifier │
81
- │ 🎯 Polish │ │ 🔀 Route │ │ ✅ Verify │
82
- └─────────────┘ └─────────────┘ └─────────────┘
83
-
84
-
85
- ┌─────────────┐
86
- Backtrack │
87
- │ ↩️ Retry │
88
- └─────────────┘
89
- ```
90
-
91
- ### Agent Roles
92
-
93
- | Agent | Role | Description |
94
- |-------|------|-------------|
95
- | **Analyzer** | 📊 | Examines all data files and creates detailed descriptions |
96
- | **Planner** | 📝 | Generates the next logical step in the solution |
97
- | **Coder** | 💻 | Implements the plan as executable Python code |
98
- | **Verifier** | | Validates if the solution answers the query |
99
- | **Router** | 🔀 | Decides to continue, add steps, or backtrack |
100
- | **Finalyzer** | 🎯 | Polishes and formats the final output |
101
-
102
- ---
103
-
104
- ## 🚀 Quick Start
105
-
106
- ### Online Demo
107
-
108
- Try DS-STAR instantly on Hugging Face Spaces:
109
-
110
- 👉 **[Launch DS-STAR Demo](https://huggingface.co/spaces/Anurag-Deo/DS-STAR)**
111
-
112
- ### Local Installation
113
-
114
- ```bash
115
- # Clone the repository
116
- git clone https://github.com/Anurag-Deo/DS-STAR.git
117
- cd DS-STAR
118
-
119
- # Create virtual environment
120
- python -m venv .venv
121
- source .venv/bin/activate # On Windows: .venv\Scripts\activate
122
-
123
- # Install dependencies
124
- pip install -r requirements.txt
125
-
126
- # Run the application
127
- python app.py
128
- ```
129
-
130
- Then open http://localhost:7860 in your browser.
131
-
132
- ---
133
-
134
- ## 💡 Usage
135
-
136
- ### Web Interface
137
-
138
- 1. **Select Provider** — Choose Google, OpenAI, Anthropic, or Custom
139
- 2. **Enter API Key** — Or set via environment variable
140
- 3. **Upload Data** — Drop your CSV, JSON, Excel, or Parquet files
141
- 4. **Ask Questions** — Type your data science question
142
- 5. **Run Analysis** — Click "Run Analysis" and watch the magic!
143
-
144
- ### Example Queries
145
-
146
- ```
147
- 📊 "What percentage of transactions use credit cards?"
148
- 📈 "Show me the distribution of transaction amounts"
149
- 🏆 "Which category has the highest total sales?"
150
- 🔗 "Find correlations between numeric columns"
151
- 📋 "Create a summary statistics report"
152
- ```
153
-
154
- ### Python API
155
-
156
- ```python
157
- from src.graph import run_ds_star
158
- from src.config import get_llm
159
-
160
- # Initialize LLM
161
- llm = get_llm(provider="google", model="gemini-2.0-flash")
162
-
163
- # Run DS-STAR
164
- result = run_ds_star(
165
- query="What is the average transaction amount?",
166
- llm=llm,
167
- max_iterations=20
168
- )
169
- ```
170
-
171
- ---
172
-
173
- ## 🔌 Supported Providers
174
-
175
- | Provider | Models | Environment Variable |
176
- |----------|--------|---------------------|
177
- | **Google** | Gemini 2.0, 1.5 Pro, 1.5 Flash | `GOOGLE_API_KEY` |
178
- | **OpenAI** | GPT-4o, GPT-4, GPT-3.5 | `OPENAI_API_KEY` |
179
- | **Anthropic** | Claude 3.5, Claude 3 | `ANTHROPIC_API_KEY` |
180
- | **Custom** | Any OpenAI-compatible API | Custom Base URL |
181
-
182
- ---
183
-
184
- ## 📁 Project Structure
185
-
186
- ```
187
- DS-STAR/
188
- ├── 📱 app.py # Gradio web application
189
- ├── 📜 main.py # CLI entry point
190
- ├── 📋 requirements.txt # Dependencies
191
- ├── 📂 src/
192
- ├── 🤖 agents/ # Agent implementations
193
- │ │ ├── analyzer_agent.py
194
- │ │ ├── planner_agent.py
195
- ├── coder_agent.py
196
- │ │ ├── verifier_agent.py
197
- │ │ ├── router_agent.py
198
- │ │ └── finalyzer_agent.py
199
- │ ├── 🔧 utils/ # Shared utilities
200
- │ │ ├── state.py # State schema
201
- │ │ ├── formatters.py # Text formatting
202
- │ └── code_execution.py # Safe code execution
203
- │ ├── ⚙️ config/ # Configuration
204
- │ │ └── llm_config.py # LLM setup
205
- │ └── 🔄 graph.py # LangGraph workflow
206
- ├── 🧪 tests/ # Test suite
207
- └── 📊 data/ # Sample data files
208
- ```
209
-
210
- ---
211
-
212
- ## 🧪 Testing
213
-
214
- ```bash
215
- # Run complete workflow test
216
- python tests/test_complete_workflow.py
217
-
218
- # Test individual agents
219
- python -c "from src.agents import test_analyzer; test_analyzer(llm)"
220
- ```
221
-
222
- ---
223
-
224
- ## 🛠️ Configuration
225
-
226
- ### Environment Variables
227
-
228
- ```bash
229
- # Set your API keys
230
- export GOOGLE_API_KEY="your-google-api-key"
231
- export OPENAI_API_KEY="your-openai-api-key"
232
- export ANTHROPIC_API_KEY="your-anthropic-api-key"
233
- ```
234
-
235
- ### Advanced Settings
236
-
237
- | Setting | Default | Description |
238
- |---------|---------|-------------|
239
- | Max Iterations | 20 | Maximum refinement cycles |
240
- | Temperature | 0.0 | LLM temperature (0 = deterministic) |
241
-
242
- ---
243
-
244
- ## 🤝 Contributing
245
-
246
- Contributions are welcome! Please feel free to submit a Pull Request.
247
-
248
- 1. Fork the repository
249
- 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
250
- 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
251
- 4. Push to the branch (`git push origin feature/AmazingFeature`)
252
- 5. Open a Pull Request
253
-
254
- ---
255
-
256
- ## 📄 License
257
-
258
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
259
-
260
- ---
261
-
262
- ## 🙏 Acknowledgments
263
-
264
- - Built with [LangGraph](https://langchain-ai.github.io/langgraph/) by LangChain
265
- - UI powered by [Gradio](https://gradio.app/)
266
- - Created for the [🤗 Hugging Face MCP 1st Birthday Hackathon](https://huggingface.co/)
267
-
268
- ---
269
-
270
- <div align="center">
271
-
272
- **Made with ❤️ by [Anurag Deo](https://github.com/Anurag-Deo)**
273
-
274
- Star this repo if you find it helpful!
275
-
276
- </div>
277
-
 
 
 
 
1
+ ---
2
+ title: DS-STAR
3
+ emoji: ✨
4
+ colorFrom: purple
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: 6.0.1
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ short_description: Multi-Agent AI System for Automated Data Science Tasks
12
+ tags:
13
+ - mcp-in-action-track-consumer
14
+ - langgraph
15
+ - multi-agent
16
+ - data-science
17
+ - automation
18
+ thumbnail: >-
19
+ https://cdn-uploads.huggingface.co/production/uploads/658be22d0ccb77b89a142f5a/t4RLYTRMF0_VHuQm5ZF91.png
20
+ social_media_post: https://x.com/AnuragDeo6/status/1995172899016380619
21
+ ---
22
+
23
+ <div align="center">
24
+
25
+ # ✨ DS-STAR
26
+
27
+ ### **D**ata **S**cience - **S**tructured **T**ask **A**nalysis and **R**esolution
28
+
29
+ [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Anurag-Deo/DS-STAR)
30
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
31
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
32
+ [![LangGraph](https://img.shields.io/badge/Built%20with-LangGraph-orange)](https://langchain-ai.github.io/langgraph/)
33
+
34
+ **A powerful multi-agent AI system that automates data science tasks through intelligent collaboration.**
35
+
36
+ [🚀 Try Demo](https://huggingface.co/spaces/Anurag-Deo/DS-STAR) • [📖 Documentation](#-usage) • [🐛 Report Bug](https://github.com/Anurag-Deo/DS-STAR/issues)
37
+
38
+ </div>
39
+
40
+ ---
41
+
42
+ ## 🎯 What is DS-STAR?
43
+
44
+ DS-STAR is a **multi-agent AI system** built with LangGraph that takes your natural language questions about data and automatically:
45
+
46
+ 1. 📊 **Analyzes** your data files to understand their structure
47
+ 2. 📝 **Plans** a step-by-step approach to answer your question
48
+ 3. 💻 **Generates** Python code to perform the analysis
49
+ 4. ✅ **Verifies** the solution meets your requirements
50
+ 5. 🔄 **Iterates** with smart backtracking if needed
51
+ 6. 🎯 **Delivers** polished, accurate results
52
+
53
+ > **Built for the 🤗 Hugging Face MCP 1st Birthday Hackathon**
54
+
55
+ ---
56
+
57
+ ## ✨ Key Features
58
+
59
+ | Feature | Description |
60
+ |---------|-------------|
61
+ | 🤖 **Multi-Agent Architecture** | Six specialized agents working in harmony |
62
+ | 🔄 **Iterative Refinement** | Automatically improves solutions through multiple cycles |
63
+ | 🔙 **Smart Backtracking** | Intelligently reverts failed approaches |
64
+ | 📊 **Auto Data Analysis** | Understands your data structure automatically |
65
+ | 💻 **Code Generation** | Produces clean, executable Python code |
66
+ | 🌐 **Multi-Provider Support** | Works with Google, OpenAI, Anthropic, or custom APIs |
67
+ | 🎨 **Modern UI** | Beautiful dark-themed Gradio interface |
68
+
69
+ ---
70
+
71
+ ## 🏗️ Architecture
72
+
73
+ DS-STAR uses a sophisticated multi-agent workflow powered by LangGraph:
74
+
75
+ ```
76
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
77
+ Analyzer │────▶│ Planner │────▶│ Coder │
78
+ │ 📊 Analyze │ │ 📝 Plan │ │ 💻 Code │
79
+ └─────────────┘ └─────────────┘ └─────────────┘
80
+
81
+
82
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
83
+ Finalyzer │◀────│ Router │◀────│ Verifier │
84
+ │ 🎯 Polish │ │ 🔀 Route │ │ ✅ Verify │
85
+ └─────────────┘ └─────────────┘ └─────────────┘
86
+
87
+
88
+ ┌─────────────┐
89
+ │ Backtrack │
90
+ │ ↩️ Retry │
91
+ └─────────────┘
92
+ ```
93
+
94
+ ### Agent Roles
95
+
96
+ | Agent | Role | Description |
97
+ |-------|------|-------------|
98
+ | **Analyzer** | 📊 | Examines all data files and creates detailed descriptions |
99
+ | **Planner** | 📝 | Generates the next logical step in the solution |
100
+ | **Coder** | 💻 | Implements the plan as executable Python code |
101
+ | **Verifier** | ✅ | Validates if the solution answers the query |
102
+ | **Router** | 🔀 | Decides to continue, add steps, or backtrack |
103
+ | **Finalyzer** | 🎯 | Polishes and formats the final output |
104
+
105
+ ---
106
+
107
+ ## 🚀 Quick Start
108
+
109
+ ### Online Demo
110
+
111
+ Try DS-STAR instantly on Hugging Face Spaces:
112
+
113
+ 👉 **[Launch DS-STAR Demo](https://huggingface.co/spaces/Anurag-Deo/DS-STAR)**
114
+
115
+ ### Local Installation
116
+
117
+ ```bash
118
+ # Clone the repository
119
+ git clone https://github.com/Anurag-Deo/DS-STAR.git
120
+ cd DS-STAR
121
+
122
+ # Create virtual environment
123
+ python -m venv .venv
124
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
125
+
126
+ # Install dependencies
127
+ pip install -r requirements.txt
128
+
129
+ # Run the application
130
+ python app.py
131
+ ```
132
+
133
+ Then open http://localhost:7860 in your browser.
134
+
135
+ ---
136
+
137
+ ## 💡 Usage
138
+
139
+ ### Web Interface
140
+
141
+ 1. **Select Provider** — Choose Google, OpenAI, Anthropic, or Custom
142
+ 2. **Enter API Key** — Or set via environment variable
143
+ 3. **Upload Data** — Drop your CSV, JSON, Excel, or Parquet files
144
+ 4. **Ask Questions** — Type your data science question
145
+ 5. **Run Analysis** — Click "Run Analysis" and watch the magic!
146
+
147
+ ### Example Queries
148
+
149
+ ```
150
+ 📊 "What percentage of transactions use credit cards?"
151
+ 📈 "Show me the distribution of transaction amounts"
152
+ 🏆 "Which category has the highest total sales?"
153
+ 🔗 "Find correlations between numeric columns"
154
+ 📋 "Create a summary statistics report"
155
+ ```
156
+
157
+ ### Python API
158
+
159
+ ```python
160
+ from src.graph import run_ds_star
161
+ from src.config import get_llm
162
+
163
+ # Initialize LLM
164
+ llm = get_llm(provider="google", model="gemini-2.0-flash")
165
+
166
+ # Run DS-STAR
167
+ result = run_ds_star(
168
+ query="What is the average transaction amount?",
169
+ llm=llm,
170
+ max_iterations=20
171
+ )
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 🔌 Supported Providers
177
+
178
+ | Provider | Models | Environment Variable |
179
+ |----------|--------|---------------------|
180
+ | **Google** | Gemini 2.0, 1.5 Pro, 1.5 Flash | `GOOGLE_API_KEY` |
181
+ | **OpenAI** | GPT-4o, GPT-4, GPT-3.5 | `OPENAI_API_KEY` |
182
+ | **Anthropic** | Claude 3.5, Claude 3 | `ANTHROPIC_API_KEY` |
183
+ | **Custom** | Any OpenAI-compatible API | Custom Base URL |
184
+
185
+ ---
186
+
187
+ ## 📁 Project Structure
188
+
189
+ ```
190
+ DS-STAR/
191
+ ├── 📱 app.py # Gradio web application
192
+ ├── 📜 main.py # CLI entry point
193
+ ├── 📋 requirements.txt # Dependencies
194
+ ├── 📂 src/
195
+ │ ├── 🤖 agents/ # Agent implementations
196
+ │ │ ├── analyzer_agent.py
197
+ │ │ ├── planner_agent.py
198
+ │ │ ├── coder_agent.py
199
+ ├── verifier_agent.py
200
+ │ │ ├── router_agent.py
201
+ │ │ └── finalyzer_agent.py
202
+ ├── 🔧 utils/ # Shared utilities
203
+ ├── state.py # State schema
204
+ │ │ ├── formatters.py # Text formatting
205
+ └── code_execution.py # Safe code execution
206
+ ├── ⚙️ config/ # Configuration
207
+ │ │ └── llm_config.py # LLM setup
208
+ │ └── 🔄 graph.py # LangGraph workflow
209
+ ├── 🧪 tests/ # Test suite
210
+ └── 📊 data/ # Sample data files
211
+ ```
212
+
213
+ ---
214
+
215
+ ## 🧪 Testing
216
+
217
+ ```bash
218
+ # Run complete workflow test
219
+ python tests/test_complete_workflow.py
220
+
221
+ # Test individual agents
222
+ python -c "from src.agents import test_analyzer; test_analyzer(llm)"
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 🛠️ Configuration
228
+
229
+ ### Environment Variables
230
+
231
+ ```bash
232
+ # Set your API keys
233
+ export GOOGLE_API_KEY="your-google-api-key"
234
+ export OPENAI_API_KEY="your-openai-api-key"
235
+ export ANTHROPIC_API_KEY="your-anthropic-api-key"
236
+ ```
237
+
238
+ ### Advanced Settings
239
+
240
+ | Setting | Default | Description |
241
+ |---------|---------|-------------|
242
+ | Max Iterations | 20 | Maximum refinement cycles |
243
+ | Temperature | 0.0 | LLM temperature (0 = deterministic) |
244
+
245
+ ---
246
+
247
+ ## 🤝 Contributing
248
+
249
+ Contributions are welcome! Please feel free to submit a Pull Request.
250
+
251
+ 1. Fork the repository
252
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
253
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
254
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
255
+ 5. Open a Pull Request
256
+
257
+ ---
258
+
259
+ ## 📄 License
260
+
261
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
262
+
263
+ ---
264
+
265
+ ## 🙏 Acknowledgments
266
+
267
+ - Thanks to [DS-STAR](https://arxiv.org/abs/2509.21825) authors for inspiration
268
+ - Built with [LangGraph](https://langchain-ai.github.io/langgraph/) by LangChain
269
+ - UI powered by [Gradio](https://gradio.app/)
270
+ - Created for the [🤗 Hugging Face MCP 1st Birthday Hackathon](https://huggingface.co/)
271
+
272
+ ---
273
+
274
+ <div align="center">
275
+
276
+ **Made with ❤️ by [Anurag Deo](https://github.com/Anurag-Deo)**
277
+
278
+ ⭐ Star this repo if you find it helpful!
279
+
280
+ </div>