Spaces:
Running
Running
DeepCritical Context
Project Overview
DeepCritical is an AI-native Medical Drug Repurposing Research Agent. Goal: To accelerate the discovery of new uses for existing drugs by intelligently searching biomedical literature (PubMed), evaluating evidence, and hypothesizing potential applications.
Architecture: The project follows a Vertical Slice Architecture (Search -> Judge -> Orchestrator) and adheres to Strict TDD (Test-Driven Development).
Current Status:
- Phases 1-8: COMPLETE. Foundation, Search, Judge, UI, Orchestrator, Embeddings, Hypothesis, Report.
- Phase 9 (Source Cleanup): COMPLETE. Removed DuckDuckGo web search (unreliable for scientific research).
- Phase 10-11: PLANNED. ClinicalTrials.gov and bioRxiv integration.
Tech Stack & Tooling
- Language: Python 3.11 (Pinned)
- Package Manager:
uv(Rust-based, extremely fast) - Frameworks:
pydantic,pydantic-ai,httpx,gradio - Vector DB:
chromadbwithsentence-transformersfor semantic search - Testing:
pytest,pytest-asyncio,respx(for mocking) - Quality:
ruff(linting/formatting),mypy(strict type checking),pre-commit
Building & Running
We use a Makefile to standardize developer commands.
| Command | Description |
|---|---|
make install |
Install dependencies and pre-commit hooks. |
make test |
Run unit tests. |
make lint |
Run Ruff linter. |
make format |
Run Ruff formatter. |
make typecheck |
Run Mypy static type checker. |
make check |
The Golden Gate: Runs lint, typecheck, and test. Must pass before committing. |
make clean |
Clean up cache and artifacts. |
Directory Structure
src/: Source codeutils/: Shared utilities (config.py,exceptions.py,models.py)tools/: Search tools (pubmed.py,base.py,search_handler.py)services/: Services (embeddings.py- ChromaDB vector store)agents/: Magentic multi-agent mode agentsagent_factory/: Agent definitions (judges, prompts)
tests/: Test suiteunit/: Isolated unit tests (Mocked)integration/: Real API tests (Marked as slow/integration)
docs/: Documentation and Implementation Specsexamples/: Working demos for each phase
Development Conventions
- Strict TDD: Write failing tests in
tests/unit/before implementing logic insrc/. - Type Safety: All code must pass
mypy --strict. Use Pydantic models for data exchange. - Linting: Zero tolerance for Ruff errors.
- Mocking: Use
respxorunittest.mockfor all external API calls in unit tests. Real calls go intests/integration. - Vertical Slices: Implement features end-to-end (Search -> Judge -> UI) rather than layer-by-layer.