Spaces:
Build error
Build error
Commit History
-
fix interface
Joseph PollackUnverified signature05d4430 -
fix interface
Joseph PollackUnverified signaturecb48bd4 -
ignores ci , hardens gradio select menus
Joseph PollackUnverified signature448c679 -
adds or improves : interface , tests, docs , ci , precommit , build , and demo
Joseph PollackUnverified signaturece644a9 -
demo starts , needs debugging on huggingface spaces
Joseph PollackUnverified signaturec37620b -
demo launches
Joseph PollackUnverified signature53c4c46
-
ruff format check solution
Joseph PollackUnverified signature3ab54ea -
ruff format check solution
Joseph PollackUnverified signature6811b67 -
adds local embeddings and huggingface inference as defaults , adds tests , improves precommit and ci
Joseph PollackUnverified signaturecd46aca -
adds tests , integration tests , github readme , and more!
Joseph PollackUnverified signature96aa062 -
Merge branch 'feature/iterative-deep-research-workflows' of https://github.com/Josephrp/DeepCritical-HFSpace into feature/iterative-deep-research-workflows
Joseph PollackUnverified signature66c7f79 -
adds the initial iterative and deep research workflows
Joseph PollackUnverified signature687a1f1 -
Merge branch 'dev' into feature/iterative-deep-research-workflows
TonicUnverified signaturee6c2142 -
chore: update model names in .env.example and tests
Revised model names in .env.example to reflect new defaults and updated test cases in test_judges_factory.py to match the changes. The OpenAI model is now set to "gpt-5.1" and the Anthropic model to "claude-sonnet-4-5-20250929".58ff8fb -
adds the initial iterative and deep research workflows
Joseph PollackUnverified signature731a241
-
feat: add hierarchical orchestration with web search (integrates PR #44) (#46)
Unverified signature* feat: add hierarchical orchestration with web search (from PR #44) Based on contribution by @EmployeeNo427 with fixes: New features: - WebSearchTool using DuckDuckGo for web searches - SubIterationMiddleware for research loop pattern - HierarchicalOrchestrator with judge-based refinement - RetrievalAgent for web-based evidence gathering - CodeExecutorAgent for Modal sandbox execution - LLMSubIterationJudge for LLM-based assessment - src/state/ package for state management Fixes applied: - Added chroma_db/ to .gitignore (was committed as binaries) - Added structlog logging per coding guidelines - Added pytest markers to new tests - Fixed silent exception swallowing in orchestrator - Preserved dual-mode architecture from PR #45 - Added "web" to SourceName type - Fixed mypy type errors Co-authored-by: EmployeeNo427 <45109567+EmployeeNo427@users.noreply.github.com> * fix: resolve mypy type errors in middleware and agents * fix: remove type argument from SubIterationTeam --------- …20f762e -
feat: implement dual-mode architecture (Simple + Advanced) (#45)
Unverified signature* docs: add dual-mode architecture specification Senior agent reviewed and approved. Key documents: - 00_SITUATION_AND_PLAN.md: Problem analysis, branch states, recommended path - 01_ARCHITECTURE_SPEC.md: Dual-mode architecture (Simple + Advanced) - 02_IMPLEMENTATION_PHASES.md: 6-phase implementation plan - 03_IMMEDIATE_ACTIONS.md: Quick reference checklist Architecture: pydantic-ai (structured outputs) + Microsoft Agent Framework (orchestration) are COMPLEMENTARY, not competing. Dual-mode allows graceful degradation to free tier when no API keys available. * docs: add follow-up review request for senior agent verification * feat: implement dual-mode architecture (Simple + Advanced) Phase 1 - Pydantic-AI Improvements (Simple Mode): - Add HuggingFace provider support in judges.py with get_model() - Add huggingface_model and hf_token config fields - Tests in test_judges_factory.py Phase 2 - Orchestrator Factory: - Implement create_orchestrator() with auto-detection logic - Simple m…b2929fc -
feat: implement async-safe rate limiting (Phase 17) (#40)
Unverified signature- Add 'limits' library dependency - Implement async RateLimiter with finer-grained polling (0.01s) - Refactor PubMedTool to use shared singleton limiter - Add comprehensive unit tests and demo script316dc7d -
fix: mock all agent creation in _build_workflow test
The test calls _build_workflow() which creates agents internally. These agents need OpenAIChatClient which requires OPENAI_API_KEY. Mock all agent creation functions to make test hermetic.7323f55 -
fix: address CodeRabbit feedback and CI failure
- Mock check_magentic_requirements in tests to run without OPENAI_API_KEY - Update stale "biorxiv" comment in models.py per CodeRabbit suggestion CI was failing because MagenticOrchestrator requires OPENAI_API_KEY, which exists locally in .env but not in CI environment.2ff16a3 -
fix(magentic): defensive text extraction & cleanup biorxiv refs
Add _extract_text to fix ChatMessage object output bug. Update bioRxiv strings to Europe PMC. Add regression test.3bfd42c -
fix: update references to Europe PMC in examples and documentation
Replaced mentions of bioRxiv with Europe PMC in the full stack and hypothesis demo scripts to reflect the current data sources. Updated the pyproject.toml to exclude specific directories from mypy checks using regex patterns for better clarity.9d21bf8 -
refactor(tests): add type annotations and clean up test functions
Enhanced test files by adding type annotations to test functions and fixtures for better clarity and type checking. Cleaned up import statements and ensured consistent formatting across test cases.05ffeb4 -
feat(search): implement ClinicalTrials.gov filtering (Phase 03)
Added filters for Interventional studies and Active/Completed status to ClinicalTrials tool. This removes noise from observational or terminated studies.d55440b -
feat(search): implement PubMed query preprocessing (Phase 02)
Added query preprocessing to strip question words and expand medical synonyms (e.g., 'Long COVID' -> 'PASC'). This fixes poor search results for natural language queries.e502f0d -
refactor(tools): replace BioRxiv with Europe PMC (Phase 01)
Replaced broken BioRxivTool with EuropePMCTool which supports keyword search. Updated all agents, MCP tools, and examples to use the new tool. Deleted legacy BioRxiv implementation.2f8ae1f -
fix: address CodeRabbit feedback and P0 blockers
Code Fixes (HIGH priority): - Add API key/provider validation to prevent silent auth failures - Fix hardcoded manager model in orchestrator_magentic.py (now uses settings.openai_model) - Add bounds checking to JSON extraction in judges.py (prevents IndexError) - Fix fragile test assertion in test_judges_hf.py Code Quality (MEDIUM priority): - Add explicit type annotation for models_to_try: list[str] - Fix structured logging (f-string → structured params) - Align fallback query count (3 queries) between handlers Test Improvements: - Add @pytest.mark.unit decorator to TestHFInferenceJudgeHandler Documentation Sync: - Update Phase 3 docs to match actual implementation: - __init__ signature (simplified, no inline imports) - _extract_json (string split with bounds checking) - _call_with_retry (tenacity decorator, asyncio.get_running_loop()) - assess method (simplified model loop) - Update Phase 4 docs with ChatInterface additional_inputs for BYOK All 104 tests pass.f985224 -
feat: implement HFInferenceJudgeHandler for free-tier AI analysis
Replace MockJudgeHandler with real AI analysis using HuggingFace Inference API: - Add HFInferenceJudgeHandler with chat_completion API - Model fallback chain: Llama 3.1 → Mistral → Zephyr (ungated) - Robust JSON extraction (handles markdown blocks, nested braces) - Tenacity retry with exponential backoff for rate limits - Fix app.py to use HF Inference when no paid API keys present Priority: User API key → Env API key → HF Inference (free) Hackathon judges now get real AI analysis without needing API keys. Set HF_TOKEN as Space secret for best model (Llama 3.1).7fab6d4
-
fix: address CodeRabbit review feedback
- Move network reachability check to runtime in test_clinicaltrials.py (avoids 5s delay at test collection time) - Add explicit api_provider validation in app.py (raises ValueError for unsupported providers instead of silent fallback)923641c -
feat: add demo mode warnings and BYOK (Bring Your Own Key) support
ClaudeUnverified signatureChanges: - Add clear "Demo Mode" warning when no API keys are configured - Add BYOK feature allowing users to input their own API key in Gradio UI - Improve MockJudgeHandler to extract meaningful info from real search results instead of hardcoded "Drug A", "Drug B" placeholders - Add API provider selection (OpenAI/Anthropic) for user-provided keys - Skip integration tests when external APIs are unreachable (SSL/network issues) This fixes the issue where users saw mock data ("Drug A", "Drug B", "Finding 1") without any indication they were in demo mode. Now: 1. Users are clearly informed when running in demo mode 2. Users can enter their own API key for full AI-powered analysis 3. Demo mode shows real search results with extracted findings4d87419 -
feat: add smoke tests and fix Gradio 6.x compatibility
- Add smoke tests for app initialization (catches config errors before deploy) - Fix Gradio 6.x breaking changes: - Remove `theme` param from gr.Blocks (removed in 6.x) - Remove `type` param from gr.ChatInterface (removed in 6.x) - Add typer to dev dependencies (required by Gradio CLI for smoke tests) Smoke tests would have caught the previous deployment failures: - Invalid examples format - Gradio API changes 101 tests passing, 71% coverage2bd9462 -
style: add pytest.mark.unit to test_models (CodeRabbit)
6af8268 -
fix: make ResearchReport.references optional with default
The LLM doesn't always return the references field, causing validation failures. Adding default_factory=list makes it optional. TDD: Added tests/unit/utils/test_models.py with coverage for this case. Fixes #23f882609 -
fix: address CodeRabbit review feedback for Phase 13
- Use .get() to prevent KeyError when execution dict lacks 'error' key - Use context manager for file read to prevent resource leak in testf32a2ca -
feat: implement phase 13 modal pipeline integration
7cc8b69 -
feat: enhance Gradio UI with MCP server support and new tool interfaces
- Updated the Gradio app to include support for the MCP server, enabling integration with Claude Desktop. - Added new interfaces for PubMed, Clinical Trials, bioRxiv, and a comprehensive search tool, enhancing the research capabilities. - Modified the demo creation function to reflect these updates and ensure a seamless user experience. Files modified: - src/app.py10e234c -
chore: update Gradio dependency to include MCP extras and version bump
- Modified `pyproject.toml` to specify Gradio with MCP extras and updated the version to 6.0.1. - Updated `uv.lock` to reflect the new Gradio dependency structure and version. - Made minor formatting adjustments in the MCP server documentation for clarity. Files modified: - pyproject.toml - uv.lock - docs/implementation/12_phase_mcp_server.mdf5b2917 -
feat: Phase 11 bioRxiv Preprint Integration (#19)
Unverified signature* feat: Implement Phase 11 (bioRxiv Preprint Integration) * chore: add .mypy_cache to .gitignore * fix: address CodeRabbit review feedback for bioRxiv tool - Catch httpx.RequestError for network failures (major issue) - Use SourceName type alias in Citation model (DRY) - Only add '...' suffix when abstract is truncated - Add test for network error handlinge67c99f -
refactor: address CodeRabbit nitpicks for Phase 10
- Centralize SourceName type alias in models.py - Update search_handler.py to use SourceName (reduces cast brittleness) - Update app.py intro text to mention ClinicalTrials.gov - Update run_search.py docstring for multi-source search - DRY test setup with mock_requests_get fixture - Speed up error test by patching tenacity retry stop condition1bc9785 -
feat: Implement Phase 10 (ClinicalTrials.gov) with requests
4e2ccbf -
feat: Complete Phase 9 Source Cleanup (Remove WebTool) (#14)
* feat: complete Phase 9 source cleanup - Removed WebTool (src/tools/websearch.py) and related tests - Updated SearchHandler and models to support only PubMed - Refactored all examples and tests to remove web search dependencies - Added verification tests to ensure no WebTool references remain - Fixed all unit tests to align with strict 'pubmed' source typing * fix: address CodeRabbit review feedback - Deduplicate tenacity dependency in pyproject.toml - Remove 'and web' from search agent description - Normalize Citation source to 'pubmed' in search agent - Update app.py markdown to remove web search references - Update embeddings demo with realistic PubMed URL/author - Enhance SearchHandler tests to verify multi-tool aggregation * refactor: replace mock data with real PubMed data in embeddings demo * fix: address CodeRabbit review feedback - Fix nested test_search_handler_pubmed_only (was inside another test, never ran) - Improve test_no_webtool_references to catch `from src.tool…cd004e1
-
fix: address all CodeRabbit Phase 8 review feedback
Actionable issue: - Forward additional_properties in run_stream for consistent metadata Nitpicks addressed: - Report event now uses actual agent message instead of hardcoded text - Citation validator: documented in-place mutation, use exact title match - Log truncation uses constant _MAX_URL_DISPLAY_LENGTH - Test asserts final_report is stored - Handle empty lists in markdown (hypotheses, drugs, limitations, refs) - Edge case: show "Untested" when supported==contradicted==0 - Document citations field in ReportSection as reserved for future usef1e4e5b -
fix: apply lazy init pattern and pydantic-ai fixes to ReportAgent (#12)
Applies the same fixes as Phase 7 HypothesisAgent: - Lazy initialization via _get_agent() to avoid API key requirement at import - Use output_type instead of result_type (pydantic-ai API) - Use result.output instead of result.data - Fix line length issues in tests - Proper mocking of get_model in tests3139749 -
fix: mock get_model in tests to avoid API key requirement in CI
ebc6429 -
fix: address CodeRabbit Phase 7 nitpicks
- Add truncation helper to avoid ellipsis on short messages - Verify query and evidence args in test_hypothesis_agenta6398e4 -
feat(phase7): implement Hypothesis Agent for mechanistic reasoning
Add HypothesisAgent that generates Drug → Target → Pathway → Effect hypotheses based on collected evidence. Key features: Models: - MechanismHypothesis: structured hypothesis with confidence scoring - HypothesisAssessment: container for hypotheses with knowledge gaps Utilities: - MMR (Maximal Marginal Relevance) for diverse evidence selection - Sentence-aware truncation for clean text processing Agent: - HypothesisAgent generates 2-4 testable hypotheses per query - Integrated with EmbeddingService for semantic evidence selection Orchestrator: - Refactored MagenticOrchestrator into smaller methods - Added "hypothesizing" event type for UI feedback - Workflow: Search → Hypothesize → Targeted Search → Judge Tests: 53/53 passing, mypy clean, ruff cleanc690006 -
fix: address CodeRabbit Phase 6 review feedback
- Dockerfile: Add curl for HEALTHCHECK, use specific extras (not --all-extras) - app.py: Tighten Magentic mode key detection to require OpenAI specifically - embeddings.py: Move structlog import to module level - test_embeddings.py: Remove redundant numpy import506a9c0 -
feat(phase6): Embeddings & Semantic Search implementation
- Added EmbeddingService with ChromaDB and SentenceTransformers - Updated SearchAgent to support semantic deduplication and search - Updated MagenticOrchestrator to use embeddings if available - Added 100% async-safe implementation with run_in_executor - Added comprehensive unit tests3bacbf8 -
fix(ci): add E402/RUF100 to ignore for cross-env compatibility
- Add E402 to global ignore (pytest.importorskip pattern) - Add RUF100 to global ignore (ruff version differences) - Remove now-unnecessary noqa commentsecbc47b -
fix(ci): skip agent tests when agent-framework not installed
- Remove uv.sources that references local-only reference_repos - Add pytest.importorskip to agent wrapper tests - CI will skip 7 agent tests, run remaining 31 tests5a82171