Spaces:
Build error
Build error
Commit History
-
docs: add AI agent context files for team collaborationβ
Added AGENTS.md, CLAUDE.md, GEMINI.md - AI-assisted scoping documents that help AI coding tools understand the project architecture, coding standards, and development workflow. Requested by @Tonic for team acceleration.5e7604a -
fix: wire analyze_hypothesis MCP tool into Gradio appβ
Senior review found that analyze_hypothesis existed in mcp_tools.py but wasn't exposed through the Gradio MCP interface. Fixed.521d97d -
feat: implement phase 13 modal pipeline integration
7cc8b69 -
Merge pull request #20 from The-Obstacle-Is-The-Way/feat/phase12-mcp-serverβ
Unverified signaturefeat(phase12): MCP Server Integration - Track 2 Compliance5264b25 -
docs: address CodeRabbit feedback for Phase 12 PRβ
- Add `text` fence language to architecture diagrams (MD040) - Update roadmap directory structure (remove websearch, add clinicaltrials/biorxiv) - Mark Phase 12 as COMPLETE in roadmap - Rename test_mcp_server.py to test_mcp_tools_live.py for clarity - Update hackathon requirements with MCP implementation status - Fix async pattern in Modal integration docf9cb2b7 -
docs: update MCP server integration documentation and statusβ
- Revised the documentation for the MCP server integration, confirming its implementation in Phase 12. - Updated the priority summary to reflect the MCP server as working and compliant with Track 2 requirements. - Enhanced testing instructions for the MCP server, including starting the server via the Gradio app and checking the MCP schema. - Documented files created during the integration, including `src/mcp_tools.py` and `src/app.py`, along with their respective functionalities. Files modified: - docs/pending/00_priority_summary.md - docs/pending/02_mcp_server_integration.mdcde8f48 -
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 -
feat: add MCP tool wrappers for biomedical search toolsβ
- Introduced a new module `mcp_tools.py` that provides asynchronous search functions for PubMed, ClinicalTrials.gov, and bioRxiv. - Each function includes detailed Google-style docstrings and type hints, ensuring clarity and usability. - Implemented a comprehensive search function that aggregates results from all sources, enhancing the search capabilities for biomedical literature. Files added: - src/mcp_tools.pyc114650 -
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 -
docs: enhance Phase 13 Modal integration documentationβ
- Updated the documentation to reflect the new `StatisticalAnalyzer` service, which decouples Modal execution from the `agent_framework`, ensuring no dependencies for the simple orchestrator. - Revised the flow diagrams to illustrate the integration of the `StatisticalAnalyzer` and its role in the analysis phase. - Added detailed sections on the implementation, configuration updates, and integration points for the new service. - Included unit and integration tests for the `StatisticalAnalyzer`, ensuring functionality without the `agent_framework`. - Updated demo scripts to showcase the new analysis capabilities and verification of Modal sandbox execution. Files modified: - docs/implementation/13_phase_modal_integration.md - src/services/statistical_analyzer.py - src/orchestrator.py - src/agents/analysis_agent.py - src/mcp_tools.py - examples/modal_demo/run_analysis.py - examples/modal_demo/verify_sandbox.py - tests/unit/services/test_statistical_analyzer.py - tests/integration/test_moβ¦0d84878 -
docs: add Phase 14 Demo Video & Hackathon Submission specificationβ
- Created documentation for the demo video and hackathon submission process, outlining goals, requirements, and deadlines. - Included detailed specifications for the demo video format, content, and recommended tools. - Established a checklist for submission requirements, including social media posts and HuggingFace Space configuration. - Summarized prize eligibility and potential awards based on completed phases. Files added: - docs/implementation/14_phase_demo_submission.mde16b9e6 -
docs: add Phase 12 MCP Server Integration specificationβ
- Introduced detailed documentation for the MCP server integration, outlining goals, implementation options, and technical specifications. - Created MCP tool wrappers for PubMed, ClinicalTrials, and bioRxiv, enabling compliance with Track 2 requirements. - Updated Gradio app to support MCP server functionality, including new tool interfaces. - Added unit and integration tests to ensure functionality and compliance with MCP standards. Files added: - docs/implementation/12_phase_mcp_server.md - src/mcp_tools.py - src/app.py - tests/unit/test_mcp_tools.py - tests/integration/test_mcp_server.py - Updated pyproject.toml for MCP dependenciesdd587c9 -
docs: add comprehensive hackathon documentation and integration plansβ
- 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.md7b20f5d -
docs: update demos to use all 3 search sourcesβ
- Remove stale DuckDuckGo references from README - Update all demos to use PubMed + ClinicalTrials + bioRxiv - Update docstrings and summary messages - All 76 tests passing Files updated: - examples/README.md - examples/full_stack_demo/run_full.py - examples/hypothesis_demo/run_hypothesis.py - examples/orchestrator_demo/run_agent.py - examples/orchestrator_demo/run_magentic.py8625ded -
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 -
Merge pull request #16 from The-Obstacle-Is-The-Way/feat/mario-integrationβ
Unverified signaturefeat: Integrate Mario's Modal code execution + LlamaIndex RAG31809fa -
refactor: centralize embedding configuration in Settingsβ
- Add openai_embedding_model and local_embedding_model to Settings - Update LlamaIndexRAGService to use settings.openai_embedding_model - Update EmbeddingService to use settings.local_embedding_model - Both services now read from centralized config instead of hardcoding - Constraint (OpenAI-only for cloud embeddings) is now explicit in config20c7bad -
refactor: address final CodeRabbit feedbackβ
- Fix Windows path escaping in verify_sandbox.py using .as_posix() - Improve verdict detection with robust regex matching (avoid false positives) - Wire allow_network parameter to Modal sandbox block_network - Add finally block for sandbox resource cleanup - Use lru_cache for thread-safe singleton pattern - Add OpenAI-only note to LlamaIndexRAGService docstringb50fffd -
fix(rag): address remaining CodeRabbit feedbackβ
- Validate OPENAI_API_KEY before creating LLM/embedding instances - Re-raise exceptions in retrieve() instead of returning empty list - Re-raise exceptions in query() instead of returning error string2f0030b -
refactor: address CodeRabbit review feedback for Mario integrationβ
CRITICAL fix: - Centralize sandbox library versions (SANDBOX_LIBRARIES constant) - Use shared config for both Modal image and LLM prompts - Prevent version mismatch between generated code and execution MAJOR fixes: - Use run_in_executor() for blocking Modal calls in async context - Lazy initialize code executor to avoid failing on import - Remove redundant hypothesis check (unreachable code) - Simplify semantic search placeholder (dead code paths) Minor fixes: - Update docs: Docker β Modal Sandbox terminology - Fix docstring claiming ConfigurationError (only warns)cbd94a4 -
fix(rag): use get_content() for BaseNode compatibility
3f90da8 -
fix(rag): apply lazy imports and use centralized configβ
- Remove unused TYPE_CHECKING block (imports are in __init__) - Use settings.openai_model instead of hard-coded "gpt-4o-mini" - Fix line length in clear_collection() method - Change Document type hint to Any for lazy import compatibility055a3a7 -
feat: Integrate Mario's Modal code execution + LlamaIndex RAGβ
Cherry-picked from mario-dev branch: - src/tools/code_execution.py: Modal sandbox for LLM-generated code - src/services/llamaindex_rag.py: LlamaIndex + ChromaDB RAG service - src/agents/analysis_agent.py: Statistical analysis agent - examples/modal_demo/: Demo scripts for code execution - docs/workflow-diagrams.md: Architecture documentation Dependencies added as optional [modal] group: - modal>=0.63.0, llama-index, chromadb Config additions: - MODAL_TOKEN_ID, MODAL_TOKEN_SECRET, CHROMA_DB_PATH Co-authored-by: Mario <mario@contributor>3aa91e9 -
Merge pull request #15 from The-Obstacle-Is-The-Way/feat/phase10-clinicaltrialsβ
Unverified signaturefeat: Phase 10 - ClinicalTrials.gov Integration17bd211 -
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 -
chore: Update httpx dependency and remove unused extras in pyproject.toml and uv.lockβ
- Changed httpx dependency to remove the http2 extra, now specifying only the base package. - Updated comments in dependencies to clarify usage for PubMed and ClinicalTrials.gov. - Removed unused package entries for h2, hpack, and hyperframe from uv.lock to streamline dependencies.1efef06 -
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
-
feat(docs): update implementation roadmap and add specs for Phases 9-11β
- Updated the implementation roadmap to reflect the completion of Phases 1-8. - Added detailed specifications for Phase 9: Remove DuckDuckGo, Phase 10: ClinicalTrials.gov Integration, and Phase 11: bioRxiv Preprint Integration. - Enhanced the status section to indicate the completion of Phases 1-8 and readiness for Phases 9-11.3fcd8e7 -
Merge pull request #13 from The-Obstacle-Is-The-Way/devβ
feat(examples): Phase 6-8 demos for full stack demonstration388cd05 -
fix(report): add explicit JSON structure guidance in promptβ
The LLM was returning incorrect JSON structures: - hypotheses_tested: dict instead of list - references: string URLs instead of list of dicts Added explicit format examples in SYSTEM_PROMPT to guide the LLM to produce valid structured output that passes Pydantic validation. This fixes the full_stack_demo ReportAgent validation errors.d01e70d -
refactor(examples): apply CodeRabbit feedback (validations, complexity, formatting)
cd11dad -
refactor(examples): purge all mocks - real API calls onlyβ
NO MOCKS. NO FAKE DATA. REAL SCIENCE. Changes: - hypothesis_demo: Now does REAL search before hypothesis generation - full_stack_demo: Removed run_mock_demo(), create_mock_*() functions - orchestrator_demo: Removed --mock flag and MockJudgeHandler - README: Updated to reflect "Real or Nothing" philosophy All examples now require API keys and make real API calls. Mocks belong in tests/unit/, not in demos.cfb473d -
feat(examples): add Phase 6-8 demos for full stack demonstrationβ
- Add embeddings_demo: semantic search & deduplication (no API keys) - Add hypothesis_demo: mechanistic reasoning (requires LLM) - Add full_stack_demo: complete pipeline with mock and real modes - Update examples README with comprehensive documentation Examples demonstrate: - Text embedding with sentence-transformers - ChromaDB vector storage and similarity search - Semantic deduplication by meaning - Drug -> Target -> Pathway -> Effect hypothesis generation - Structured scientific report generation0efdc2f -
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 -
Merge pull request #11 from The-Obstacle-Is-The-Way/feat/phase7-hypothesis-agentβ
feat(phase7): Hypothesis Agent for mechanistic reasoninge993253 -
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 -
fix: address CodeRabbit Phase 7 review feedbackβ
- Lazy initialize HypothesisAgent's pydantic-ai Agent to avoid requiring API keys at import time (fixes CI failure) - Add explicit default=None to primary_hypothesis field for Pydantic v2 compliancebc74531 -
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 -
Merge pull request #10 from The-Obstacle-Is-The-Way/feat/phase6-embeddingsβ
feat(phase6): Embeddings & Semantic Searchb25ffdb -
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 -
fix: address CodeRabbit Phase 5 review feedbackβ
Critical fixes: - Fix invalid model names (gpt-5.1 β gpt-4o, claude-sonnet-4-5 β claude-sonnet-4-20250514) - Add OpenAI key validation in MagenticOrchestrator with clear error message - Document Magentic mode's OpenAI-only requirement Nitpicks: - Add streaming icon to AgentEvent.to_markdown() - Use exact equality for PubMed placeholder detection - Update app.py info text for API key requirements - Add language identifiers to markdown code blocks in docsd247864 -
fix(phase6): critical fixes from senior auditβ
- Fix Dockerfile cache ownership (run model download as appuser) - Store full citation metadata in vector DB (title, date, authors) - Remove fragile locals() hack in search_agent.py - Add try/except in deduplicate loop for resilience - Document threshold semantics (cosine distance math) - Clean up redundant list() calls59afc84 -
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 -
Merge main: Phase 5 + Phase 6-8 doc revisions
24a5878 -
docs: comprehensive Phase 6-8 spec revisions (Senior Architect audit)β
Phase 6 (Embeddings): - Add async/executor pattern for all embedding methods - Add HuggingFace Spaces deployment notes for model caching - Update tests to be async Phase 7 (Hypothesis): - Add text utilities: truncate_at_sentence(), select_diverse_evidence() - Replace arbitrary evidence[:10] with MMR (Maximal Marginal Relevance) - Sentence-boundary-aware truncation Phase 8 (Report) - CRITICAL: - Add citation validation to prevent LLM hallucination - Add validate_references() function spec - Update SYSTEM_PROMPT with strict citation requirements - Add comprehensive citation validation tests All changes address issues identified in the "Senior Architect" audit: - Event loop blocking from sync sentence-transformers - Arbitrary truncation losing important evidence - Hallucinated citations in medical research reportsec3d7dc -
feat(architecture): update system design and roadmap for Phases 1-8β
- Revised high-level design to include detailed phases and components of the Magentic system. - Introduced new agents: Magentic Manager, SearchAgent, HypothesisAgent, JudgeAgent, and ReportAgent, each with specific roles in the research process. - Updated success criteria to reflect completion of Phases 1-5 and outlined specifications for Phases 6-8. - Enhanced documentation for clarity on system architecture and agent interactions.2dc022a -
feat(phase8): implement Report Agent for structured scientific report generationβ
- Introduced `ReportAgent` to generate comprehensive research reports from evidence and hypotheses. - Added `ResearchReport` model with sections for executive summary, methodology, findings, limitations, and references. - Updated MagenticOrchestrator to include ReportAgent as the final synthesis step in the workflow. - Implemented report generation flow and markdown rendering for output. - Added unit tests to ensure functionality of ReportAgent and report generation process.2763672