Spaces:
Build error
Build error
Commit History
-
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 -
fix: skip Modal integration tests when package not installed
The test was only checking for Modal credentials but not whether the modal package itself was installed, causing test failures in environments without the optional dependency.4e785f8 -
style: auto-format 4 files (ruff)
a805769 -
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
-
fix: add missing packages to requirements.txt for HuggingFace Spaces
Adds agent-framework-core and duckduckgo-search to requirements.txt. These were in pyproject.toml but missing from requirements.txt, causing: - Advanced mode to fail with "agent-framework-core not found" - Web search to be unavailable Fixes #504e438f3 -
fix: add limits package to requirements.txt for HuggingFace Spaces
The `limits` package was added in Phase 17 (rate limiting) to pyproject.toml but not to requirements.txt. HuggingFace Spaces uses requirements.txt, causing the Space to crash with ModuleNotFoundError.4fb11a9 -
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 -
Merge branch 'dev'
b72f9f1 -
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 -
feat: add roadmap summary and detailed improvement plans for data sources
- Introduced new documentation files outlining the current state and future improvements for DeepCritical's data sources: PubMed, ClinicalTrials.gov, Europe PMC, and OpenAlex. - Each document includes sections on current implementation, strengths, limitations, recommended improvements, and integration opportunities. - Added a comprehensive roadmap summary to guide future maintainers and enhance project maintainability.9286db5 -
fix: address CodeRabbit feedback
- Sort .env.example model keys alphabetically. - Narrow return type of create_demo() to gr.ChatInterface. - Confirmed embedding model vars are already wired in src/utils/config.py.be7e1a2 -
fix: repair Gradio accordion bug and cleanup env vars
- Unwrapped ChatInterface from gr.Blocks to fix settings accordion state (fixes P1_GRADIO_SETTINGS_CLEANUP). - Updated .env.example with missing variables and removed dead ones. - Updated documentation for the fix.fcc601a -
Merge pull request #38 from The-Obstacle-Is-The-Way/dev
Unverified signaturefix(magentic): defensive text extraction for ChatMessage objects5b5d2ca -
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 -
docs: update P1 bug report with actual Gradio accordion root cause
a46131e -
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 -
docs: add TDD fix plan for Magentic mode report generation
17d34a8 -
docs: replace completed bug docs with new Magentic bug report
Deleted (all implemented): - P0_ACTIONABLE_FIXES.md - P0_CRITICAL_BUGS.md - P0_MAGENTIC_AND_SEARCH_AUDIT.md - PHASE_00-03 implementation docs Added new bug report for actual issue found: - Magentic mode returns ChatMessage object instead of text - Root cause: event.message.text extraction fails - Max rounds reached before ReportAgent can synthesize OpenAI key works. Simple mode works. The bug is in how the final result event is processed.8a98024 -
fix: update remaining bioRxiv references to Europe PMC in examples
- examples/orchestrator_demo/run_agent.py: Update comments (3 places) - examples/README.md: Update documentation (4 places) All examples now consistently reference Europe PMC instead of bioRxiv.1515e72 -
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 -
fix(config): increase max iterations to 10
Addressed P0-004 by increasing default max_iterations from 5 to 10 to allow deep search loops to complete successfully.72b2667 -
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: exclude reference_repos from mypy and cleanup
- Add mypy exclude for reference_repos/ and examples/ to prevent scanning of local reference code that isn't part of the project - Fix string concatenation in orchestrator_magentic.py - Fix formatting in examples (spaces around operators) - Remove resolved bug documentation (001, 002, 003)0a480cb -
refactor: enhance Gradio UI for improved user experience
- Updated header to include a more descriptive title and streamlined text. - Enhanced chat interface with clearer example prompts and added settings accordion for configuration. - Improved footer to clarify research tool limitations and active MCP server connection. These changes aim to provide a more intuitive and informative interface for users interacting with the drug repurposing research agent.291b9e6 -
fix: simplify Gradio UI to fit single viewport
- Reduce header to 2 lines (title + one-line description) - Remove MCP Tools tabs UI (MCP server still active at /gradio_api/mcp/) - Simplify examples (just questions, no extra params shown) - Minimal footer with disclaimer and MCP endpoint - Remove unused mcp_tools imports from app.py This fixes the header cutoff issue in HuggingFace Spaces iframe by reducing total content to fit within standard viewport height.8dc3e50 -
Merge branch 'main' into dev
8036817 -
feat: HFInferenceJudgeHandler - Free AI analysis for hackathon judges (#36)
Unverified signature* 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). * feat: add documentation for Magentic mode bug and implementation spec - Introduced a new bug report for Magentic mode, detailing its non-functionality and root causes. - Updated the implementation specification for Magentic integration, emphasizing the architecture, critical insights, and necessary changes for agent coordination. - Enhanced clarity on t…b115229 -
chore: remove resolved bug documentation
- Delete 005_services_not_integrated.md - embeddings now wired to simple orchestrator (enable_embeddings=True is the default in orchestrator.py) - Delete 006_magentic_mode_broken.md - magentic mode is experimental/optional, documented as requiring OpenAI (not a bug)a941b78 -
fix: pin agent-framework-core and remove resolved bug doc
- Pin agent-framework-core>=1.0.0b251120,<2.0.0 to prevent breaking changes - Remove docs/bugs/007_magentic_p0_blockers.md - all issues resolved: - Issue 1 (hardcoded models): Already fixed in previous commit - Issue 2 (dependency unpinned): Fixed in this commit - Issue 3 (no free tier): Working as Designed474538c -
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 -
docs: add P0 blockers documentation for Magentic mode implementation
- Introduced a new markdown document outlining critical blockers in the Magentic mode implementation. - Highlighted issues such as hardcoded OpenAI models, dependency source ambiguity, and the lack of a "Free Tier" for users. - Provided detailed impacts and required fixes for each identified issue to ensure a stable deployment. This documentation aims to facilitate resolution of critical issues and improve the overall user experience in Magentic mode.c2f7da2 -
feat: implement Magentic ChatAgent pattern with semantic state management
- Add src/agents/state.py: Thread-safe MagenticState with contextvars - Evidence store for structured citation access - EmbeddingService integration for semantic deduplication - Add src/agents/tools.py: AIFunction tools that update shared state - search_pubmed, search_clinical_trials, search_preprints - get_bibliography for ReportAgent citations - Tools return strings to LLM AND update state - Add src/agents/magentic_agents.py: ChatAgent factories - SearchAgent with search tools - JudgeAgent, HypothesisAgent, ReportAgent - Each agent has internal OpenAIChatClient - Update src/orchestrator_magentic.py: Use ChatAgent pattern - Initialize MagenticState at workflow start - Properly stream events from MagenticBuilder - Fix type errors for pre-commit mypy compatibility Implements Phase 5 spec for correct Microsoft Agent Framework integration.645a051 -
feat: add documentation for Magentic mode bug and implementation spec
- Introduced a new bug report for Magentic mode, detailing its non-functionality and root causes. - Updated the implementation specification for Magentic integration, emphasizing the architecture, critical insights, and necessary changes for agent coordination. - Enhanced clarity on the roles of various agents and their interactions within the Magentic workflow. - Provided recommendations for fixing or abandoning the Magentic mode based on observed issues. This commit aims to improve understanding and troubleshooting of the Magentic mode within the project.fb7b8d7 -
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: wire EmbeddingService to simple orchestrator + improve search quality
Major fixes: - Wire EmbeddingService to simple orchestrator for semantic deduplication (was built but not connected - see docs/bugs/005) - Expand BioRxiv stop words (~100) and require minimum 2 term matches to filter out irrelevant papers - Fix MockJudgeHandler to return honest message instead of garbage drug candidates extracted via broken heuristics The simple orchestrator now uses local sentence-transformers for semantic deduplication without requiring any API keys. Bug documentation added in docs/bugs/005_services_not_integrated.md2e4a760 -
fix: disable ssr_mode to resolve intermittent gradio hydration issues
420d8ba -
docs: add bug report for intermittent gradio loading issues
b9919fb -
chore: trigger HF rebuild
39b452a -
fix: remove header: mini from README to resolve desktop overlay issues
f9c67ed -
Merge pull request #35 from The-Obstacle-Is-The-Way/fix/gradio-ui-final
Unverified signaturefix: Gradio UI layout - title visible above ChatInterfaced7ef283 -
chore: update .env.example and config.py for LLM and agent settings
- Updated LLM provider and model names in .env.example to reflect new defaults. - Adjusted config.py to use the updated model names and added SEARCH_TIMEOUT setting. - Cleaned up comments for clarity regarding external services and modal integration.9dd37c6 -
fix: resolve Gradio UI cutoff by removing fill_height=True and restructuring layout
87de5ef