HallD commited on
Commit
960cb9f
Β·
verified Β·
1 Parent(s): 0bfa9b9

Update README.md

Browse files

Updated link to the image

Files changed (1) hide show
  1. README.md +253 -253
README.md CHANGED
@@ -1,253 +1,253 @@
1
- ---
2
- title: ShallowCodeResearch
3
- emoji: πŸ“‰
4
- colorFrom: blue
5
- colorTo: pink
6
- sdk: gradio
7
- sdk_version: 5.33.0
8
- app_file: app.py
9
- pinned: false
10
- short_description: Coding research assistant that generates code and tests it
11
- tags:
12
- - mcp
13
- - multi-agent
14
- - research
15
- - code-generation
16
- - ai-assistant
17
- - gradio
18
- - python
19
- - web-search
20
- - llm
21
- - modal
22
- - mcp-server-track
23
- python_version: "3.12"
24
- ---
25
-
26
- # Shallow Research Code Assistant - Multi-Agent AI Code Assistant
27
-
28
- ## Technologies Used
29
-
30
- This is part of the MCP track for the Hackathon (with a smidge of Agents)
31
-
32
- - Gradio for the UI and MCP logic
33
- - Modal AI for spinning up sandboxes for code execution
34
- - Nebius, OpenAI, Anthropic and Hugging Face can be used for LLM calls
35
- - Nebius set by default for inference, with a priority on token speed that can be found on the platform
36
-
37
- ❀️ **A very big thank you to the sponsors for the generous credits for this hackathon and Hugging Face and Gradio for putting this event together** πŸ”₯
38
-
39
-
40
- **Special thanks to Yuvi for putting up with us in the Discord asking for credits πŸ˜‚**
41
-
42
- ## πŸš€ **Multi-agent system for AI-powered search and code generation**
43
-
44
- ## What is the Shallow Research MCP Hub for Code Assistance?
45
-
46
- Shallow Research Code Assistant is a sophisticated multi-agent research and code assistant built using Gradio's Model Context Protocol (MCP) server functionality. It orchestrates specialized AI agents to provide comprehensive research capabilities and generate executable Python code. This "shallow" research tool (Its definitely not deep research) augments
47
- the initial user query to broaden scope before performing web searches for grounding.
48
-
49
- The coding agent then generates the code to answer the user question and checks for errors. To ensure the code is valid, the code is executed in a remote sandbox using the
50
- Modal infrustructure. These sandboxes are spawned when needed with a small footprint (only pandas, numpy, request and scikit-learn are installed).
51
-
52
- However, if additional packages are required, this will be installed prior to execution (some delays expected here depending on the request).
53
-
54
- Once executed the whole process is summarised and returned to the user.
55
-
56
- ---
57
- ## πŸ“Ή Demo Video
58
-
59
- [![MCP Demo Shallow Research Code Assistant](https://img.shields.io/badge/Watch%20Demo-Loom-purple?style=for-the-badge&logo=loom)](https://www.loom.com/share/ea4584bc76c04adabefd6d39a4f8e279?sid=5d2408ff-03d1-421b-b956-9713ae390212)
60
-
61
- *Click the badge above to watch the complete demonstration of the MCP Demo Shallow Research Code Assistant in action*
62
-
63
- ---
64
-
65
- ## Key information
66
-
67
- I've found that whilst using VS Code for the MCP interaction, its useful to type the main agent function name to ensure the right tool is picked.
68
-
69
- For example "agent research request: How do you write a python script to perform scaling of features in a dataframe"
70
-
71
- This is the JSON script required to set up the MCP in VS Code
72
-
73
- ```json
74
- {
75
- "mcp": {
76
- "inputs": [],
77
- "servers": {
78
- "gradiocodeassist": {
79
- "command": "npx",
80
- "args": [
81
- "mcp-remote",
82
- "https://agents-mcp-hackathon-shallowcoderesearch.hf.space/gradio_api/mcp/sse",
83
- ]
84
- }
85
- }
86
- }
87
- ```
88
- This is the JSON script required to set up the MCP Via Cline in VS Code
89
-
90
- ```json
91
- {
92
- "mcpServers": {
93
- "gradiocodeassist": {
94
- "autoApprove": [],
95
- "disabled": false,
96
- "timeout": 300,
97
- "type": "sse",
98
- "url": "https://agents-mcp-hackathon-shallowcoderesearch.hf.space/gradio_api/mcp/sse",
99
- "headers": {}
100
- }
101
- }
102
- }
103
- ```
104
-
105
- ## ✨ Key Features
106
-
107
- - 🧠 **Multi-Agent Architecture**: Specialized agents working in orchestrated workflows
108
- - πŸ” **Intelligent Research**: Web search with automatic summarization and citation formatting
109
- - πŸ’» **Code Generation**: Context-aware Python code creation with secure execution
110
- - πŸ”— **MCP Server**: Built-in MCP server for seamless agent communication
111
- - 🎯 **Multiple LLM Support**: Compatible with Nebius, OpenAI, Anthropic, and HuggingFace (Currently set to Nebius Inference)
112
- - πŸ›‘οΈ **Secure Execution**: Modal sandbox environment for safe code execution
113
- - πŸ“Š **Performance Monitoring**: Advanced metrics collection and health monitoring
114
-
115
- ## πŸ›οΈ MCP Workflow Architecture
116
-
117
- ![MCP Workflow Diagram](static/MCP%20Diagram.png)
118
-
119
- The diagram above illustrates the complete Multi-Agent workflow architecture, showing how different agents communicate through the MCP (Model Context Protocol) server to deliver comprehensive research and code generation capabilities.
120
-
121
-
122
- ## πŸš€ Quick Start
123
-
124
- 1. **Configure your environment** by setting up API keys in the Settings tab
125
- 2. **Choose your LLM provider** Nebius Set By Default in the Space
126
- 3. **Input your research query** in the Orchestrator Flow tab
127
- 4. **Watch the magic happen** as agents collaborate to research and generate code
128
-
129
- ## πŸ—οΈ Architecture
130
-
131
- ### Core Agents
132
-
133
- - **Question Enhancer**: Breaks down complex queries into focused sub-questions
134
- - **Web Search Agent**: Performs targeted searches using Tavily API
135
- - **LLM Processor**: Handles text processing, summarization, and analysis
136
- - **Citation Formatter**: Manages academic citation formatting (APA style)
137
- - **Code Generator**: Creates contextually-aware Python code
138
- - **Code Runner**: Executes code in secure Modal sandboxes
139
- - **Orchestrator**: Coordinates the complete workflow
140
-
141
- ### Workflow Example
142
-
143
- ```
144
- User Query: "Create Python code to analyze Twitter sentiment"
145
- ↓
146
- Question Enhancement: Split into focused sub-questions
147
- ↓
148
- Web Research: Search for Twitter APIs, sentiment libraries, examples
149
- ↓
150
- Context Integration: Combine research into comprehensive context
151
- ↓
152
- Code Generation: Create executable Python script
153
- ↓
154
- Secure Execution: Run code in Modal sandbox
155
- ↓
156
- Results: Code + output + research summary + citations
157
- ```
158
-
159
- ## πŸ› οΈ Setup Requirements
160
-
161
- ### Required API Keys
162
-
163
- - **LLM Provider** (choose one):
164
- - Nebius API (recommended)
165
- - OpenAI API
166
- - Anthropic API
167
- - HuggingFace Inference API
168
- - **Tavily API** (for web search)
169
- - **Modal Account** (for code execution)
170
-
171
- ### Environment Configuration
172
-
173
- Set these environment variables or configure in the app:
174
-
175
- ```bash
176
- LLM_PROVIDER=nebius # Your chosen provider
177
- NEBIUS_API_KEY=your_key_here
178
- TAVILY_API_KEY=your_key_here
179
- MODAL_ID=your-id-here
180
- MODEL_SECRET_TOKEN=your-token-here
181
- ```
182
-
183
- ## 🎯 Use Cases
184
-
185
- ### Code Generation
186
- - **Prototype Development**: Rapidly create functional code based on requirements
187
- - **IDE Integration**: Add this to your IDE for grounded LLM support
188
-
189
- ### Learning & Education
190
- - **Code Examples**: Generate educational code samples with explanations
191
- - **Concept Exploration**: Research and understand complex programming concepts
192
- - **Best Practices**: Learn current industry standards and methodologies
193
-
194
- ## πŸ”§ Advanced Features
195
-
196
- ### Performance Monitoring
197
- - Real-time metrics collection
198
- - Response time tracking
199
- - Success rate monitoring
200
- - Resource usage analytics
201
-
202
- ### Intelligent Caching
203
- - Reduces redundant API calls
204
- - Improves response times
205
- - Configurable TTL settings
206
-
207
- ### Fault Tolerance
208
- - Circuit breaker protection
209
- - Rate limiting management
210
- - Graceful error handling
211
- - Automatic retry mechanisms
212
-
213
- ### Sandbox Pool Management
214
- - Pre-warmed execution environments
215
- - Optimized performance
216
- - Resource pooling
217
- - Automatic scaling
218
-
219
- ## πŸ“± Interface Tabs
220
-
221
- 1. **Orchestrator Flow**: Complete end-to-end workflow
222
- 2. **Individual Agents**: Access each agent separately for specific tasks
223
- 3. **Advanced Features**: System monitoring and performance analytics
224
-
225
- ## 🀝 MCP Integration
226
-
227
- This application demonstrates advanced MCP (Model Context Protocol) implementation:
228
-
229
- - **Server Architecture**: Full MCP server with schema generation
230
- - **Function Registry**: Proper MCP function definitions with typing
231
- - **Multi-Agent Communication**: Structured data flow between agents
232
- - **Error Handling**: Robust error management across agent interactions
233
-
234
- ## πŸ“Š Performance
235
-
236
- - **Response Times**: Optimized for sub-second agent responses
237
- - **Scalability**: Handles concurrent requests efficiently
238
- - **Reliability**: Built-in fault tolerance and monitoring
239
- - **Resource Management**: Intelligent caching and pooling
240
-
241
- ## πŸ” Technical Details
242
-
243
- - **Python**: 3.12+ required
244
- - **Framework**: Gradio with MCP server capabilities
245
- - **Execution**: Modal for secure sandboxed code execution
246
- - **Search**: Tavily API for real-time web research
247
- - **Monitoring**: Comprehensive performance and health tracking
248
-
249
- ---
250
-
251
- **Ready to experience the future of AI-assisted research and development?**
252
-
253
- Start by configuring your API keys and dive into the world of multi-agent AI collaboration! πŸš€
 
1
+ ---
2
+ title: ShallowCodeResearch
3
+ emoji: πŸ“‰
4
+ colorFrom: red
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 5.33.1
8
+ app_file: app.py
9
+ pinned: false
10
+ short_description: Coding research assistant that generates code and tests it
11
+ tags:
12
+ - mcp
13
+ - multi-agent
14
+ - research
15
+ - code-generation
16
+ - ai-assistant
17
+ - gradio
18
+ - python
19
+ - web-search
20
+ - llm
21
+ - modal
22
+ - mcp-server-track
23
+ python_version: '3.12'
24
+ ---
25
+
26
+ # Shallow Research Code Assistant - Multi-Agent AI Code Assistant
27
+
28
+ ## Technologies Used
29
+
30
+ This is part of the MCP track for the Hackathon (with a smidge of Agents)
31
+
32
+ - Gradio for the UI and MCP logic
33
+ - Modal AI for spinning up sandboxes for code execution
34
+ - Nebius, OpenAI, Anthropic and Hugging Face can be used for LLM calls
35
+ - Nebius set by default for inference, with a priority on token speed that can be found on the platform
36
+
37
+ ❀️ **A very big thank you to the sponsors for the generous credits for this hackathon and Hugging Face and Gradio for putting this event together** πŸ”₯
38
+
39
+
40
+ **Special thanks to Yuvi for putting up with us in the Discord asking for credits πŸ˜‚**
41
+
42
+ ## πŸš€ **Multi-agent system for AI-powered search and code generation**
43
+
44
+ ## What is the Shallow Research MCP Hub for Code Assistance?
45
+
46
+ Shallow Research Code Assistant is a sophisticated multi-agent research and code assistant built using Gradio's Model Context Protocol (MCP) server functionality. It orchestrates specialized AI agents to provide comprehensive research capabilities and generate executable Python code. This "shallow" research tool (Its definitely not deep research) augments
47
+ the initial user query to broaden scope before performing web searches for grounding.
48
+
49
+ The coding agent then generates the code to answer the user question and checks for errors. To ensure the code is valid, the code is executed in a remote sandbox using the
50
+ Modal infrustructure. These sandboxes are spawned when needed with a small footprint (only pandas, numpy, request and scikit-learn are installed).
51
+
52
+ However, if additional packages are required, this will be installed prior to execution (some delays expected here depending on the request).
53
+
54
+ Once executed the whole process is summarised and returned to the user.
55
+
56
+ ---
57
+ ## πŸ“Ή Demo Video
58
+
59
+ [![MCP Demo Shallow Research Code Assistant](https://img.shields.io/badge/Watch%20Demo-Loom-purple?style=for-the-badge&logo=loom)](https://www.loom.com/share/ea4584bc76c04adabefd6d39a4f8e279?sid=5d2408ff-03d1-421b-b956-9713ae390212)
60
+
61
+ *Click the badge above to watch the complete demonstration of the MCP Demo Shallow Research Code Assistant in action*
62
+
63
+ ---
64
+
65
+ ## Key information
66
+
67
+ I've found that whilst using VS Code for the MCP interaction, its useful to type the main agent function name to ensure the right tool is picked.
68
+
69
+ For example "agent research request: How do you write a python script to perform scaling of features in a dataframe"
70
+
71
+ This is the JSON script required to set up the MCP in VS Code
72
+
73
+ ```json
74
+ {
75
+ "mcp": {
76
+ "inputs": [],
77
+ "servers": {
78
+ "gradiocodeassist": {
79
+ "command": "npx",
80
+ "args": [
81
+ "mcp-remote",
82
+ "https://agents-mcp-hackathon-shallowcoderesearch.hf.space/gradio_api/mcp/sse",
83
+ ]
84
+ }
85
+ }
86
+ }
87
+ ```
88
+ This is the JSON script required to set up the MCP Via Cline in VS Code
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "gradiocodeassist": {
94
+ "autoApprove": [],
95
+ "disabled": false,
96
+ "timeout": 300,
97
+ "type": "sse",
98
+ "url": "https://agents-mcp-hackathon-shallowcoderesearch.hf.space/gradio_api/mcp/sse",
99
+ "headers": {}
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ ## ✨ Key Features
106
+
107
+ - 🧠 **Multi-Agent Architecture**: Specialized agents working in orchestrated workflows
108
+ - πŸ” **Intelligent Research**: Web search with automatic summarization and citation formatting
109
+ - πŸ’» **Code Generation**: Context-aware Python code creation with secure execution
110
+ - πŸ”— **MCP Server**: Built-in MCP server for seamless agent communication
111
+ - 🎯 **Multiple LLM Support**: Compatible with Nebius, OpenAI, Anthropic, and HuggingFace (Currently set to Nebius Inference)
112
+ - πŸ›‘οΈ **Secure Execution**: Modal sandbox environment for safe code execution
113
+ - πŸ“Š **Performance Monitoring**: Advanced metrics collection and health monitoring
114
+
115
+ ## πŸ›οΈ MCP Workflow Architecture
116
+
117
+ ![MCP Workflow Diagram](static/MCP_Diagram.png)
118
+
119
+ The diagram above illustrates the complete Multi-Agent workflow architecture, showing how different agents communicate through the MCP (Model Context Protocol) server to deliver comprehensive research and code generation capabilities.
120
+
121
+
122
+ ## πŸš€ Quick Start
123
+
124
+ 1. **Configure your environment** by setting up API keys in the Settings tab
125
+ 2. **Choose your LLM provider** Nebius Set By Default in the Space
126
+ 3. **Input your research query** in the Orchestrator Flow tab
127
+ 4. **Watch the magic happen** as agents collaborate to research and generate code
128
+
129
+ ## πŸ—οΈ Architecture
130
+
131
+ ### Core Agents
132
+
133
+ - **Question Enhancer**: Breaks down complex queries into focused sub-questions
134
+ - **Web Search Agent**: Performs targeted searches using Tavily API
135
+ - **LLM Processor**: Handles text processing, summarization, and analysis
136
+ - **Citation Formatter**: Manages academic citation formatting (APA style)
137
+ - **Code Generator**: Creates contextually-aware Python code
138
+ - **Code Runner**: Executes code in secure Modal sandboxes
139
+ - **Orchestrator**: Coordinates the complete workflow
140
+
141
+ ### Workflow Example
142
+
143
+ ```
144
+ User Query: "Create Python code to analyze Twitter sentiment"
145
+ ↓
146
+ Question Enhancement: Split into focused sub-questions
147
+ ↓
148
+ Web Research: Search for Twitter APIs, sentiment libraries, examples
149
+ ↓
150
+ Context Integration: Combine research into comprehensive context
151
+ ↓
152
+ Code Generation: Create executable Python script
153
+ ↓
154
+ Secure Execution: Run code in Modal sandbox
155
+ ↓
156
+ Results: Code + output + research summary + citations
157
+ ```
158
+
159
+ ## πŸ› οΈ Setup Requirements
160
+
161
+ ### Required API Keys
162
+
163
+ - **LLM Provider** (choose one):
164
+ - Nebius API (recommended)
165
+ - OpenAI API
166
+ - Anthropic API
167
+ - HuggingFace Inference API
168
+ - **Tavily API** (for web search)
169
+ - **Modal Account** (for code execution)
170
+
171
+ ### Environment Configuration
172
+
173
+ Set these environment variables or configure in the app:
174
+
175
+ ```bash
176
+ LLM_PROVIDER=nebius # Your chosen provider
177
+ NEBIUS_API_KEY=your_key_here
178
+ TAVILY_API_KEY=your_key_here
179
+ MODAL_ID=your-id-here
180
+ MODEL_SECRET_TOKEN=your-token-here
181
+ ```
182
+
183
+ ## 🎯 Use Cases
184
+
185
+ ### Code Generation
186
+ - **Prototype Development**: Rapidly create functional code based on requirements
187
+ - **IDE Integration**: Add this to your IDE for grounded LLM support
188
+
189
+ ### Learning & Education
190
+ - **Code Examples**: Generate educational code samples with explanations
191
+ - **Concept Exploration**: Research and understand complex programming concepts
192
+ - **Best Practices**: Learn current industry standards and methodologies
193
+
194
+ ## πŸ”§ Advanced Features
195
+
196
+ ### Performance Monitoring
197
+ - Real-time metrics collection
198
+ - Response time tracking
199
+ - Success rate monitoring
200
+ - Resource usage analytics
201
+
202
+ ### Intelligent Caching
203
+ - Reduces redundant API calls
204
+ - Improves response times
205
+ - Configurable TTL settings
206
+
207
+ ### Fault Tolerance
208
+ - Circuit breaker protection
209
+ - Rate limiting management
210
+ - Graceful error handling
211
+ - Automatic retry mechanisms
212
+
213
+ ### Sandbox Pool Management
214
+ - Pre-warmed execution environments
215
+ - Optimized performance
216
+ - Resource pooling
217
+ - Automatic scaling
218
+
219
+ ## πŸ“± Interface Tabs
220
+
221
+ 1. **Orchestrator Flow**: Complete end-to-end workflow
222
+ 2. **Individual Agents**: Access each agent separately for specific tasks
223
+ 3. **Advanced Features**: System monitoring and performance analytics
224
+
225
+ ## 🀝 MCP Integration
226
+
227
+ This application demonstrates advanced MCP (Model Context Protocol) implementation:
228
+
229
+ - **Server Architecture**: Full MCP server with schema generation
230
+ - **Function Registry**: Proper MCP function definitions with typing
231
+ - **Multi-Agent Communication**: Structured data flow between agents
232
+ - **Error Handling**: Robust error management across agent interactions
233
+
234
+ ## πŸ“Š Performance
235
+
236
+ - **Response Times**: Optimized for sub-second agent responses
237
+ - **Scalability**: Handles concurrent requests efficiently
238
+ - **Reliability**: Built-in fault tolerance and monitoring
239
+ - **Resource Management**: Intelligent caching and pooling
240
+
241
+ ## πŸ” Technical Details
242
+
243
+ - **Python**: 3.12+ required
244
+ - **Framework**: Gradio with MCP server capabilities
245
+ - **Execution**: Modal for secure sandboxed code execution
246
+ - **Search**: Tavily API for real-time web research
247
+ - **Monitoring**: Comprehensive performance and health tracking
248
+
249
+ ---
250
+
251
+ **Ready to experience the future of AI-assisted research and development?**
252
+
253
+ Start by configuring your API keys and dive into the world of multi-agent AI collaboration! πŸš€