Spaces:
Running
Running
Merge branch 'main' into feat/phase13-modal-integration
Browse filesResolved conflicts in AI agent context files, keeping updated versions.
AGENTS.md
CHANGED
|
@@ -35,7 +35,7 @@ uv run pytest -m integration
|
|
| 35 |
|
| 36 |
**Pattern**: Search-and-judge loop with multi-tool orchestration.
|
| 37 |
|
| 38 |
-
```
|
| 39 |
User Question β Orchestrator
|
| 40 |
β
|
| 41 |
Search Loop:
|
|
@@ -49,6 +49,7 @@ Research Report with Citations
|
|
| 49 |
```
|
| 50 |
|
| 51 |
**Key Components**:
|
|
|
|
| 52 |
- `src/orchestrator.py` - Main agent loop
|
| 53 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 54 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
@@ -70,6 +71,7 @@ Research Report with Citations
|
|
| 70 |
## Configuration
|
| 71 |
|
| 72 |
Settings via pydantic-settings from `.env`:
|
|
|
|
| 73 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 74 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 75 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
@@ -79,7 +81,7 @@ Settings via pydantic-settings from `.env`:
|
|
| 79 |
|
| 80 |
## Exception Hierarchy
|
| 81 |
|
| 82 |
-
```
|
| 83 |
DeepCriticalError (base)
|
| 84 |
βββ SearchError
|
| 85 |
β βββ RateLimitError
|
|
@@ -109,6 +111,7 @@ DeepCriticalError (base)
|
|
| 109 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 110 |
|
| 111 |
**HuggingFace Spaces Collaboration:**
|
|
|
|
| 112 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 113 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 114 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|
|
|
|
| 35 |
|
| 36 |
**Pattern**: Search-and-judge loop with multi-tool orchestration.
|
| 37 |
|
| 38 |
+
```text
|
| 39 |
User Question β Orchestrator
|
| 40 |
β
|
| 41 |
Search Loop:
|
|
|
|
| 49 |
```
|
| 50 |
|
| 51 |
**Key Components**:
|
| 52 |
+
|
| 53 |
- `src/orchestrator.py` - Main agent loop
|
| 54 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 55 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
|
|
| 71 |
## Configuration
|
| 72 |
|
| 73 |
Settings via pydantic-settings from `.env`:
|
| 74 |
+
|
| 75 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 76 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 77 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
|
|
| 81 |
|
| 82 |
## Exception Hierarchy
|
| 83 |
|
| 84 |
+
```text
|
| 85 |
DeepCriticalError (base)
|
| 86 |
βββ SearchError
|
| 87 |
β βββ RateLimitError
|
|
|
|
| 111 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 112 |
|
| 113 |
**HuggingFace Spaces Collaboration:**
|
| 114 |
+
|
| 115 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 116 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 117 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|
CLAUDE.md
CHANGED
|
@@ -35,7 +35,7 @@ uv run pytest -m integration
|
|
| 35 |
|
| 36 |
**Pattern**: Search-and-judge loop with multi-tool orchestration.
|
| 37 |
|
| 38 |
-
```
|
| 39 |
User Question β Orchestrator
|
| 40 |
β
|
| 41 |
Search Loop:
|
|
@@ -49,6 +49,7 @@ Research Report with Citations
|
|
| 49 |
```
|
| 50 |
|
| 51 |
**Key Components**:
|
|
|
|
| 52 |
- `src/orchestrator.py` - Main agent loop
|
| 53 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 54 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
@@ -70,6 +71,7 @@ Research Report with Citations
|
|
| 70 |
## Configuration
|
| 71 |
|
| 72 |
Settings via pydantic-settings from `.env`:
|
|
|
|
| 73 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 74 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 75 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
@@ -79,7 +81,7 @@ Settings via pydantic-settings from `.env`:
|
|
| 79 |
|
| 80 |
## Exception Hierarchy
|
| 81 |
|
| 82 |
-
```
|
| 83 |
DeepCriticalError (base)
|
| 84 |
βββ SearchError
|
| 85 |
β βββ RateLimitError
|
|
@@ -102,6 +104,7 @@ DeepCriticalError (base)
|
|
| 102 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 103 |
|
| 104 |
**HuggingFace Spaces Collaboration:**
|
|
|
|
| 105 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 106 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 107 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|
|
|
|
| 35 |
|
| 36 |
**Pattern**: Search-and-judge loop with multi-tool orchestration.
|
| 37 |
|
| 38 |
+
```text
|
| 39 |
User Question β Orchestrator
|
| 40 |
β
|
| 41 |
Search Loop:
|
|
|
|
| 49 |
```
|
| 50 |
|
| 51 |
**Key Components**:
|
| 52 |
+
|
| 53 |
- `src/orchestrator.py` - Main agent loop
|
| 54 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 55 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
|
|
| 71 |
## Configuration
|
| 72 |
|
| 73 |
Settings via pydantic-settings from `.env`:
|
| 74 |
+
|
| 75 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 76 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 77 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
|
|
| 81 |
|
| 82 |
## Exception Hierarchy
|
| 83 |
|
| 84 |
+
```text
|
| 85 |
DeepCriticalError (base)
|
| 86 |
βββ SearchError
|
| 87 |
β βββ RateLimitError
|
|
|
|
| 104 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 105 |
|
| 106 |
**HuggingFace Spaces Collaboration:**
|
| 107 |
+
|
| 108 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 109 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 110 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|
GEMINI.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# DeepCritical Context
|
| 2 |
|
| 3 |
## Project Overview
|
|
|
|
| 4 |
**DeepCritical** is an AI-native Medical Drug Repurposing Research Agent.
|
| 5 |
**Goal:** To accelerate the discovery of new uses for existing drugs by intelligently searching biomedical literature (PubMed, ClinicalTrials.gov, bioRxiv), evaluating evidence, and hypothesizing potential applications.
|
| 6 |
|
|
@@ -8,12 +9,14 @@
|
|
| 8 |
The project follows a **Vertical Slice Architecture** (Search -> Judge -> Orchestrator) and adheres to **Strict TDD** (Test-Driven Development).
|
| 9 |
|
| 10 |
**Current Status:**
|
|
|
|
| 11 |
- **Phases 1-9:** COMPLETE. Foundation, Search, Judge, UI, Orchestrator, Embeddings, Hypothesis, Report, Cleanup.
|
| 12 |
- **Phases 10-11:** COMPLETE. ClinicalTrials.gov and bioRxiv integration.
|
| 13 |
- **Phase 12:** COMPLETE. MCP Server integration (Gradio MCP at `/gradio_api/mcp/`).
|
| 14 |
- **Phase 13:** COMPLETE. Modal sandbox for statistical analysis.
|
| 15 |
|
| 16 |
## Tech Stack & Tooling
|
|
|
|
| 17 |
- **Language:** Python 3.11 (Pinned)
|
| 18 |
- **Package Manager:** `uv` (Rust-based, extremely fast)
|
| 19 |
- **Frameworks:** `pydantic`, `pydantic-ai`, `httpx`, `gradio[mcp]`
|
|
@@ -35,6 +38,7 @@ The project follows a **Vertical Slice Architecture** (Search -> Judge -> Orches
|
|
| 35 |
| `make clean` | Clean up cache and artifacts. |
|
| 36 |
|
| 37 |
## Directory Structure
|
|
|
|
| 38 |
- `src/`: Source code
|
| 39 |
- `utils/`: Shared utilities (`config.py`, `exceptions.py`, `models.py`)
|
| 40 |
- `tools/`: Search tools (`pubmed.py`, `clinicaltrials.py`, `biorxiv.py`, `code_execution.py`)
|
|
@@ -50,6 +54,7 @@ The project follows a **Vertical Slice Architecture** (Search -> Judge -> Orches
|
|
| 50 |
- `examples/`: Working demos for each phase
|
| 51 |
|
| 52 |
## Key Components
|
|
|
|
| 53 |
- `src/orchestrator.py` - Main agent loop
|
| 54 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 55 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
@@ -62,6 +67,7 @@ The project follows a **Vertical Slice Architecture** (Search -> Judge -> Orches
|
|
| 62 |
## Configuration
|
| 63 |
|
| 64 |
Settings via pydantic-settings from `.env`:
|
|
|
|
| 65 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 66 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 67 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
@@ -70,6 +76,7 @@ Settings via pydantic-settings from `.env`:
|
|
| 70 |
- `LOG_LEVEL`: DEBUG, INFO, WARNING, ERROR
|
| 71 |
|
| 72 |
## Development Conventions
|
|
|
|
| 73 |
1. **Strict TDD:** Write failing tests in `tests/unit/` *before* implementing logic in `src/`.
|
| 74 |
2. **Type Safety:** All code must pass `mypy --strict`. Use Pydantic models for data exchange.
|
| 75 |
3. **Linting:** Zero tolerance for Ruff errors.
|
|
@@ -84,6 +91,7 @@ Settings via pydantic-settings from `.env`:
|
|
| 84 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 85 |
|
| 86 |
**HuggingFace Spaces Collaboration:**
|
|
|
|
| 87 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 88 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 89 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|
|
|
|
| 1 |
# DeepCritical Context
|
| 2 |
|
| 3 |
## Project Overview
|
| 4 |
+
|
| 5 |
**DeepCritical** is an AI-native Medical Drug Repurposing Research Agent.
|
| 6 |
**Goal:** To accelerate the discovery of new uses for existing drugs by intelligently searching biomedical literature (PubMed, ClinicalTrials.gov, bioRxiv), evaluating evidence, and hypothesizing potential applications.
|
| 7 |
|
|
|
|
| 9 |
The project follows a **Vertical Slice Architecture** (Search -> Judge -> Orchestrator) and adheres to **Strict TDD** (Test-Driven Development).
|
| 10 |
|
| 11 |
**Current Status:**
|
| 12 |
+
|
| 13 |
- **Phases 1-9:** COMPLETE. Foundation, Search, Judge, UI, Orchestrator, Embeddings, Hypothesis, Report, Cleanup.
|
| 14 |
- **Phases 10-11:** COMPLETE. ClinicalTrials.gov and bioRxiv integration.
|
| 15 |
- **Phase 12:** COMPLETE. MCP Server integration (Gradio MCP at `/gradio_api/mcp/`).
|
| 16 |
- **Phase 13:** COMPLETE. Modal sandbox for statistical analysis.
|
| 17 |
|
| 18 |
## Tech Stack & Tooling
|
| 19 |
+
|
| 20 |
- **Language:** Python 3.11 (Pinned)
|
| 21 |
- **Package Manager:** `uv` (Rust-based, extremely fast)
|
| 22 |
- **Frameworks:** `pydantic`, `pydantic-ai`, `httpx`, `gradio[mcp]`
|
|
|
|
| 38 |
| `make clean` | Clean up cache and artifacts. |
|
| 39 |
|
| 40 |
## Directory Structure
|
| 41 |
+
|
| 42 |
- `src/`: Source code
|
| 43 |
- `utils/`: Shared utilities (`config.py`, `exceptions.py`, `models.py`)
|
| 44 |
- `tools/`: Search tools (`pubmed.py`, `clinicaltrials.py`, `biorxiv.py`, `code_execution.py`)
|
|
|
|
| 54 |
- `examples/`: Working demos for each phase
|
| 55 |
|
| 56 |
## Key Components
|
| 57 |
+
|
| 58 |
- `src/orchestrator.py` - Main agent loop
|
| 59 |
- `src/tools/pubmed.py` - PubMed E-utilities search
|
| 60 |
- `src/tools/clinicaltrials.py` - ClinicalTrials.gov API
|
|
|
|
| 67 |
## Configuration
|
| 68 |
|
| 69 |
Settings via pydantic-settings from `.env`:
|
| 70 |
+
|
| 71 |
- `LLM_PROVIDER`: "openai" or "anthropic"
|
| 72 |
- `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`: LLM keys
|
| 73 |
- `NCBI_API_KEY`: Optional, for higher PubMed rate limits
|
|
|
|
| 76 |
- `LOG_LEVEL`: DEBUG, INFO, WARNING, ERROR
|
| 77 |
|
| 78 |
## Development Conventions
|
| 79 |
+
|
| 80 |
1. **Strict TDD:** Write failing tests in `tests/unit/` *before* implementing logic in `src/`.
|
| 81 |
2. **Type Safety:** All code must pass `mypy --strict`. Use Pydantic models for data exchange.
|
| 82 |
3. **Linting:** Zero tolerance for Ruff errors.
|
|
|
|
| 91 |
- Remote `huggingface-upstream`: HuggingFace Spaces (deployment target)
|
| 92 |
|
| 93 |
**HuggingFace Spaces Collaboration:**
|
| 94 |
+
|
| 95 |
- Each contributor should use their own dev branch: `yourname-dev` (e.g., `vcms-dev`, `mario-dev`)
|
| 96 |
- **DO NOT push directly to `main` or `dev` on HuggingFace** - these can be overwritten easily
|
| 97 |
- GitHub is the source of truth; HuggingFace is for deployment/demo
|