Spaces:
Build error
Build error
Commit ·
7b20f5d
1
Parent(s): 8625ded
docs: add comprehensive hackathon documentation and integration plans
Browse files- Introduced detailed priority summaries for hackathon tasks, including deadlines and current stack status.
- Documented requirements for Track 2 (MCP in Action) and outlined necessary actions for integration.
- Added specific integration plans for MCP server and Modal, including implementation options and demo scripts.
- Created submission checklists and prize opportunity analyses to guide project completion.
Files added:
- docs/pending/00_priority_summary.md
- docs/pending/01_hackathon_requirements.md
- docs/pending/02_mcp_server_integration.md
- docs/pending/03_modal_integration.md
Files changed (4)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113# DeepCritical Hackathon Priority Summary
## 4 Days Left (Deadline: Nov 30, 2025 11:59 PM UTC)
---
## Git Contribution Analysis
```The-Obstacle-Is-The-Way: 20+ commits (Phases 1-11, all demos, all fixes)MarioAderman: 3 commits (Modal, LlamaIndex, PubMed fix)JJ (Maintainer): 0 code commits (merge button only)```
**Conclusion:** You built 90%+ of this codebase.
---
## Current Stack (What We Have)
| Component | Status | Files ||-----------|--------|-------|| PubMed Search | ✅ Working | `src/tools/pubmed.py` || ClinicalTrials Search | ✅ Working | `src/tools/clinicaltrials.py` || bioRxiv Search | ✅ Working | `src/tools/biorxiv.py` || Search Handler | ✅ Working | `src/tools/search_handler.py` || Embeddings/ChromaDB | ✅ Working | `src/services/embeddings.py` || LlamaIndex RAG | ✅ Working | `src/services/llamaindex_rag.py` || Hypothesis Agent | ✅ Working | `src/agents/hypothesis_agent.py` || Report Agent | ✅ Working | `src/agents/report_agent.py` || Judge Agent | ✅ Working | `src/agents/judge_agent.py` || Orchestrator | ✅ Working | `src/orchestrator.py` || Gradio UI | ✅ Working | `src/app.py` || Modal Code Execution | ⚠️ Built, not wired | `src/tools/code_execution.py` || **MCP Server** | ❌ **MISSING** | Need to create |
---
## What's Required for Track 2 (MCP in Action)
| Requirement | Have It? | Priority ||-------------|----------|----------|| Autonomous agent behavior | ✅ Yes | - || Must use MCP servers as tools | ❌ **NO** | **P0** || Must be Gradio app | ✅ Yes | - || Planning/reasoning/execution | ✅ Yes | - |
**Bottom Line:** Without MCP server, we're potentially disqualified from Track 2.
---
## 3 Things To Do (In Order)
### 1. MCP Server (P0 - Required)- **File:** `src/mcp_server.py`- **Time:** 2-4 hours- **Doc:** `02_mcp_server_integration.md`- **Why:** Required for Track 2. No MCP = no entry.
### 2. Modal Wiring (P1 - $2,500 Prize)- **File:** Update `src/agents/analysis_agent.py`- **Time:** 2-3 hours- **Doc:** `03_modal_integration.md`- **Why:** Modal Innovation Award is $2,500
### 3. Demo Video + Submission (P0 - Required)- **Time:** 1-2 hours- **Why:** Required for all submissions
---
## Submission Checklist
- [ ] Space in MCP-1st-Birthday org- [ ] Tag: `mcp-in-action-track-enterprise`- [ ] Social media post link- [ ] Demo video (1-5 min)- [ ] MCP server working- [ ] All tests passing
---
## Prize Math
| Award | Amount | Eligible? ||-------|--------|-----------|| Track 2 1st Place | $2,500 | If MCP works || Modal Innovation | $2,500 | If Modal wired || LlamaIndex | $1,000 | Yes (have it) || Community Choice | $1,000 | Maybe || **Total Potential** | **$7,000** | With MCP + Modal |
---
## Next Actions
```bash# 1. Read MCP integration doccat docs/pending/02_mcp_server_integration.md
# 2. Create MCP server# (implement based on doc)
# 3. Test MCP worksuv run python src/mcp_server.py
# 4. Wire Modal into pipeline# (see 03_modal_integration.md)
# 5. Record demo video
# 6. Submit to MCP-1st-Birthday org```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697# MCP's 1st Birthday Hackathon - Requirements Analysis
## Deadline: November 30, 2025 11:59 PM UTC
---
## Track Selection: MCP in Action (Track 2)
DeepCritical fits **Track 2: MCP in Action** - AI agent applications.
### Required Tags (pick one)```yamltags: - mcp-in-action-track-enterprise # Drug repurposing = enterprise/healthcare # OR - mcp-in-action-track-consumer # If targeting patients/consumers```
### Track 2 Requirements
| Requirement | DeepCritical Status | Action Needed ||-------------|---------------------|---------------|| Autonomous Agent behavior | ✅ Have it | Search-Judge-Synthesize loop || Must use MCP servers as tools | ❌ **MISSING** | Add MCP server wrapper || Must be a Gradio app | ✅ Have it | `src/app.py` || Planning, reasoning, execution | ✅ Have it | Orchestrator + Judge || Context Engineering / RAG | ✅ Have it | LlamaIndex + ChromaDB |
---
## Prize Opportunities
### Current Eligibility vs With MCP Integration
| Award | Prize | Current | With MCP ||-------|-------|---------|----------|| MCP in Action (1st) | $2,500 | ✅ Eligible | ✅ STRONGER || Modal Innovation | $2,500 | ❌ Not using | ✅ ELIGIBLE (code execution) || Blaxel Choice | $2,500 | ❌ Not using | ⚠️ Could integrate || LlamaIndex | $1,000 | ✅ Using (Mario's code) | ✅ ELIGIBLE || Google Gemini | $10K credits | ❌ Not using | ⚠️ Could add || Community Choice | $1,000 | ⚠️ Possible | ✅ Better demo helps || **TOTAL POTENTIAL** | | ~$2,500 | **$8,500+** |
---
## Submission Checklist
- [ ] HuggingFace Space in `MCP-1st-Birthday` organization- [ ] Track tags in Space README.md- [ ] Social media post link (X, LinkedIn)- [ ] Demo video (1-5 minutes)- [ ] All team members registered- [ ] Original work (Nov 14-30)
---
## Priority Integration Order
### P0 - MUST HAVE (Required for Track 2)1. **MCP Server Wrapper** - Expose search tools as MCP servers - See: `02_mcp_server_integration.md`
### P1 - HIGH VALUE ($2,500 each)2. **Modal Integration** - Already have code, need to wire up - See: `03_modal_integration.md`
### P2 - NICE TO HAVE3. **Blaxel** - MCP hosting platform (if time permits)4. **Gemini API** - Add as LLM option for Google prize
---
## What MCP Actually Means for Us
MCP (Model Context Protocol) is Anthropic's standard for connecting AI to tools.
**Current state:**- We have `PubMedTool`, `ClinicalTrialsTool`, `BioRxivTool`- They're Python classes with `search()` methods
**What we need:**- Wrap these as MCP servers- So Claude Desktop, Cursor, or any MCP client can use them
**Why this matters:**- Judges will test if our tools work with Claude Desktop- No MCP = disqualified from Track 2
---
## Reference Links
- [Hackathon Page](https://huggingface.co/MCP-1st-Birthday)- [MCP Documentation](https://modelcontextprotocol.io/)- [Gradio MCP Guide](https://www.gradio.app/guides/building-mcp-server-with-gradio)- [Discord: #agents-mcp-hackathon-winter25](https://discord.gg/huggingface)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164# MCP Server Integration
## Priority: P0 - REQUIRED FOR TRACK 2
---
## What We Need
Expose our search tools as MCP servers so Claude Desktop/Cursor can use them.
### Current Tools to Expose
| Tool | File | MCP Tool Name ||------|------|---------------|| PubMed Search | `src/tools/pubmed.py` | `search_pubmed` || ClinicalTrials Search | `src/tools/clinicaltrials.py` | `search_clinical_trials` || bioRxiv Search | `src/tools/biorxiv.py` | `search_biorxiv` || Combined Search | `src/tools/search_handler.py` | `search_all_sources` |
---
## Implementation Options
### Option 1: Gradio MCP (Recommended)
Gradio 5.0+ can expose any Gradio app as an MCP server automatically.
```python# src/mcp_server.pyimport gradio as grfrom src.tools.pubmed import PubMedToolfrom src.tools.clinicaltrials import ClinicalTrialsToolfrom src.tools.biorxiv import BioRxivTool
pubmed = PubMedTool()trials = ClinicalTrialsTool()biorxiv = BioRxivTool()
async def search_pubmed(query: str, max_results: int = 10) -> str: """Search PubMed for biomedical literature.""" results = await pubmed.search(query, max_results) return "\n\n".join([f"**{e.citation.title}**\n{e.content}" for e in results])
async def search_clinical_trials(query: str, max_results: int = 10) -> str: """Search ClinicalTrials.gov for clinical trial data.""" results = await trials.search(query, max_results) return "\n\n".join([f"**{e.citation.title}**\n{e.content}" for e in results])
async def search_biorxiv(query: str, max_results: int = 10) -> str: """Search bioRxiv/medRxiv for preprints.""" results = await biorxiv.search(query, max_results) return "\n\n".join([f"**{e.citation.title}**\n{e.content}" for e in results])
# Create Gradio interfacedemo = gr.Interface( fn=[search_pubmed, search_clinical_trials, search_biorxiv], inputs=[gr.Textbox(label="Query"), gr.Number(label="Max Results", value=10)], outputs=gr.Textbox(label="Results"),)
# Launch as MCP serverif __name__ == "__main__": demo.launch(mcp_server=True) # Gradio 5.0+ feature```
### Option 2: Native MCP SDK
Use the official MCP Python SDK:
```bashuv add mcp```
```python# src/mcp_server.pyfrom mcp.server import Serverfrom mcp.types import Tool, TextContent
from src.tools.pubmed import PubMedToolfrom src.tools.clinicaltrials import ClinicalTrialsToolfrom src.tools.biorxiv import BioRxivTool
server = Server("deepcritical-research")
@server.tool()async def search_pubmed(query: str, max_results: int = 10) -> list[TextContent]: """Search PubMed for biomedical literature on drug repurposing.""" tool = PubMedTool() results = await tool.search(query, max_results) return [TextContent(type="text", text=e.content) for e in results]
@server.tool()async def search_clinical_trials(query: str, max_results: int = 10) -> list[TextContent]: """Search ClinicalTrials.gov for clinical trials.""" tool = ClinicalTrialsTool() results = await tool.search(query, max_results) return [TextContent(type="text", text=e.content) for e in results]
@server.tool()async def search_biorxiv(query: str, max_results: int = 10) -> list[TextContent]: """Search bioRxiv/medRxiv for preprints (not peer-reviewed).""" tool = BioRxivTool() results = await tool.search(query, max_results) return [TextContent(type="text", text=e.content) for e in results]
if __name__ == "__main__": server.run()```
---
## Claude Desktop Configuration
After implementing, users add to `claude_desktop_config.json`:
```json{ "mcpServers": { "deepcritical": { "command": "uv", "args": ["run", "python", "src/mcp_server.py"], "cwd": "/path/to/DeepCritical-1" } }}```
---
## Testing MCP Server
1. Start the MCP server:```bashuv run python src/mcp_server.py```
2. Test with Claude Desktop or MCP Inspector:```bashnpx @anthropic/mcp-inspector```
3. Verify tools appear and work
---
## Demo Video Script
For the hackathon submission video:
1. Show Claude Desktop with DeepCritical MCP tools2. Ask: "Search PubMed for metformin Alzheimer's"3. Show real results appearing4. Ask: "Now search clinical trials for the same"5. Show combined analysis
This proves MCP integration works.
---
## Files to Create
- [ ] `src/mcp_server.py` - MCP server implementation- [ ] `examples/mcp_demo/test_mcp.py` - Test script- [ ] Update `README.md` with MCP usage instructions123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156# Modal Integration
## Priority: P1 - HIGH VALUE ($2,500 Modal Innovation Award)
---
## What Modal Is For
Modal provides serverless GPU/CPU compute. For DeepCritical:
### Current Use Case (Mario's Code)- `src/tools/code_execution.py` - Run LLM-generated analysis code in sandboxes- Scientific computing (pandas, scipy, numpy) in isolated containers
### Potential Additional Use Cases
| Use Case | Benefit | Complexity ||----------|---------|------------|| Code Execution Sandbox | Run statistical analysis safely | ✅ Already built || LLM Inference | Run local models (no API costs) | Medium || Batch Processing | Process many papers in parallel | Medium || Embedding Generation | GPU-accelerated embeddings | Low |
---
## Current State
Mario implemented `src/tools/code_execution.py`:
```python# Already exists - ModalCodeExecutorexecutor = get_code_executor()result = executor.execute("""import pandas as pdimport numpy as np# LLM-generated statistical analysis""")```
### What's Missing
1. **Not wired into the main pipeline** - The executor exists but isn't used2. **No Modal tokens configured** - Needs MODAL_TOKEN_ID/MODAL_TOKEN_SECRET3. **No demo showing it works** - Judges need to see it
---
## Integration Plan
### Step 1: Wire Into Agent Pipeline
Add a `StatisticalAnalysisAgent` that uses Modal:
```python# src/agents/analysis_agent.pyfrom src.tools.code_execution import get_code_executor
class AnalysisAgent: """Run statistical analysis on evidence using Modal sandbox."""
async def analyze(self, evidence: list[Evidence], query: str) -> str: # 1. LLM generates analysis code code = await self._generate_analysis_code(evidence, query)
# 2. Execute in Modal sandbox executor = get_code_executor() result = executor.execute(code)
# 3. Return results return result["stdout"]```
### Step 2: Add to Orchestrator
```python# In orchestrator, after gathering evidence:if settings.enable_modal_analysis: analysis_agent = AnalysisAgent() stats_results = await analysis_agent.analyze(evidence, query)```
### Step 3: Create Demo
```python# examples/modal_demo/run_analysis.py"""Demo: Modal-powered statistical analysis of drug evidence."""
# Show:# 1. Gather evidence from PubMed# 2. Generate analysis code with LLM# 3. Execute in Modal sandbox# 4. Return statistical insights```
---
## Modal Setup
### 1. Install Modal CLI```bashpip install modalmodal setup # Authenticates with Modal```
### 2. Set Environment Variables```bash# In .envMODAL_TOKEN_ID=your-token-idMODAL_TOKEN_SECRET=your-token-secret```
### 3. Deploy (Optional)```bashmodal deploy src/tools/code_execution.py```
---
## What to Show Judges
For the Modal Innovation Award ($2,500):
1. **Sandbox Isolation** - Code runs in container, not local2. **Scientific Computing** - Real pandas/scipy analysis3. **Safety** - Can't access local filesystem4. **Speed** - Modal's fast cold starts
### Demo Script
```bash# Run the Modal verification scriptuv run python examples/modal_demo/verify_sandbox.py```
This proves code runs in Modal, not locally.
---
## Files to Update
- [ ] Wire `code_execution.py` into pipeline- [ ] Create `src/agents/analysis_agent.py`- [ ] Update `examples/modal_demo/` with working demo- [ ] Add Modal setup to README- [ ] Test with real Modal account
---
## Cost Estimate
Modal pricing for our use case:- CPU sandbox: ~$0.0001 per execution- For demo/judging: < $1 total- Free tier: 30 hours/month
Not a cost concern.docs/pending/00_priority_summary.mdAdded+113
docs/pending/01_hackathon_requirements.mdAdded+97
docs/pending/02_mcp_server_integration.mdAdded+164
docs/pending/03_modal_integration.mdAdded+156