Spaces:
Sleeping
Sleeping
Commit History
-
feat: Implement Free Tier synthesis using HuggingFace Inference
- Added a new synthesis method in the JudgeHandler to utilize free HuggingFace Inference for narrative generation in Free Tier mode. - Updated the Orchestrator to check for the judge's synthesis method, ensuring consistent behavior across judging and synthesis. - Enhanced integration and unit tests to verify the correct usage of the new synthesis method and fallback mechanisms. - Documented the bug related to synthesis incorrectly using server-side API keys, outlining the root cause and potential fixes. This change addresses user confusion and improves the Free Tier experience by ensuring expected functionality without requiring an API key.e18ea9a -
fix: P0 provider mismatch and code quality audit fixes (#102)
Unverified signature* refactor: replace hacky try/except with proper pydantic validation PROBLEM: - CodeRabbit recommended try/except for ADVANCED_MAX_ROUNDS parsing - This is hacky defensive programming, not Clean Code - Silent fallbacks mask configuration errors SOLUTION (Uncle Bob approved): 1. Add advanced_max_rounds to Settings with pydantic Field validation: - ge=1, le=20 bounds checking - Fails fast at startup with clear error message 2. Add advanced_timeout to Settings (60-900 seconds) 3. Remove os.getenv + try/except hack from advanced.py - Now uses settings.advanced_max_rounds directly 4. Fix domain.py: invalid domain strings now raise ValueError - Shows valid options in error message - Previously silently fell back to default 5. Update tests: 18 tests verifying fail-fast behavior - TestSettingsValidation: type errors, bounds violations all raise - TestGetDomainConfig: invalid strings raise with helpful message PHILOSOPHY: "If someone configures your app wrong, tell t…599a754 -
feat: SPEC_15 Advanced Mode Performance Optimization (#101)
Unverified signatureSPEC_15 Advanced Mode Performance Optimization + CodeRabbit fixes3cb2e43 -
feat(clinicaltrials): SPEC_14 Outcome Measures (#100)
Unverified signature* feat: add outcome measures to ClinicalTrials.gov tool - Add OutcomesModule and HasResults to FIELDS constant - Extract primary outcomes with measure and timeFrame - Show results availability status with posted date - Boost relevance for trials with results (0.90 vs 0.85) - Add 4 unit tests per SPEC_14 Closes #95 * fix: address CodeRabbit review feedback for SPEC_14 - Fix unconditional ellipsis: Only add "..." when summary > 400 chars - Refine primary outcome truncation: Build full string before truncating - Extract _extract_primary_outcome() helper to reduce statement count - Add identificationModule to test mock for completeness Addresses review comments on PR #100. * test: add pytest.skip for API flakiness resilience Add defensive skip if ClinicalTrials.gov API returns no results, making the integration test more resilient to external API changes. Addresses CodeRabbit review feedback on PR #100.de1af88 -
feat(search): SPEC_13 Evidence Deduplication (#98)
Unverified signature* feat(search): implement evidence deduplication (SPEC_13) - Add PMID extraction to OpenAlex tool (from ids.pmid) - Implement deduplicate_evidence and extract_paper_id in SearchHandler - Support deduplication across PubMed, Europe PMC (MED, PMC, PPR, PAT), OpenAlex, and ClinicalTrials - Add comprehensive unit tests for deduplication logic * test: complete SPEC_13 test coverage (senior review findings) Missing tests added per spec: - test_extracts_europepmc_pat_id_eu_format (EP patent format) - test_preserves_openalex_without_pmid (critical edge case) - test_keeps_unidentifiable_evidence (conservative behavior) - test_clinicaltrials_unique_per_nct (NCT uniqueness) - test_preprints_preserved_separately (PPR vs PMID) - test_extracts_pmid_from_ids_object (OpenAlex PMID extraction) - test_pmid_is_none_when_not_present (null case) Code improvements: - Move `import re` to module level in openalex.py (efficiency) - Add SAMPLE_OPENALEX_WITH_PMID fixture for cross-dedup testing All 35 tests…2c5db87 -
fix: use logger.error with stack trace for synthesis failures (CodeRabbit)
Changed logger.warning → logger.error with exc_info=True for better production debugging when LLM synthesis falls back to template.84a8bce -
fix(ui): CSS autofill override and text centering
- Add -webkit-autofill selectors to prevent white background on focus - Add :focus-visible for better accessibility - Split description into two centered divs with styled HR - HR element was breaking text-align inheritance Fixes issue where API key input turned white when browser autofilled and text after HR was left-aligned instead of centered.36b8ff4 -
fix(ui): resolve Gradio 6 breaking change and align text
9b8af35 -
feat(ui): force dark mode for api key input and enhance synthesis error handling
ad823e0 -
fix(SPEC_11): address CodeRabbit review feedback (#92)
Unverified signature* fix(SPEC_11): address CodeRabbit review feedback - Update run_full.py docstring to reference sexual health pipeline (not drug repurposing) - Update run_full.py help text to use sexual health query example - Fix app.py domain display to show "Sexual Health" (not "Sexual_Health") - Update test_nodes.py mock data to use sexual health terms (Testosterone, Androgen Receptor) - Add @pytest.mark.unit markers to test_judges.py test classes - Add specific assertion for next_search_queries in test_judges.py - Add missing @pytest.mark.asyncio marker to test_mcp_tools.py - Update test_mcp_tools.py and test_clinicaltrials.py to use sexual health queries - Fix SPEC_12 markdown bare code fence (MD040) * fix(SPEC_11): comprehensive domain alignment audit Second pass of CodeRabbit review fixes - found additional domain mismatches: - examples/search_demo/run_search.py: Update docstring from "drug repurposing" to "sexual health" - examples/orchestrator_demo/run_agent.py: Update help text from "metf…89f1173 -
feat(SPEC_11): finalize transition to Sexual Health Research Specialist
This commit completes the transition of DeepBoner to a dedicated Sexual Health Research Agent by removing all references to "general" and "drug repurposing" domains. Key changes include: - Updated domain defaults to exclusively use "sexual_health". - Replaced all example queries and documentation to reflect a focus on sexual health topics. - Removed any lingering references to non-sexual health concepts in code and tests. - Ensured all tests are aligned with the new domain focus, passing successfully. This change reinforces the project's identity and simplifies the codebase, enhancing clarity and usability for users focused on sexual health research. Closes #89.fa696e8 -
feat(SPEC_11): narrow scope to sexual health only
BREAKING CHANGE: Remove GENERAL and DRUG_REPURPOSING domains DeepBoner is now a focused Sexual Health Research Specialist, not a general-purpose research agent. Changes: - Remove ResearchDomain.GENERAL and ResearchDomain.DRUG_REPURPOSING - Remove GENERAL_CONFIG and DRUG_REPURPOSING_CONFIG from domain.py - Set DEFAULT_DOMAIN = ResearchDomain.SEXUAL_HEALTH - Update Gradio examples (remove Metformin/Alzheimer's) - New example: "Testosterone therapy for hypoactive sexual desire disorder?" - Hide domain dropdown (only one option now) - Update all domain-related tests Closes #89627c291 -
feat: SPEC_10 - Domain-Agnostic Refactor + License Fix (#87)
Unverified signature* feat: implement SPEC_10 domain-agnostic refactor * fix: complete SPEC_10 audit - license + HierarchicalOrchestrator domain License Fixes: - LICENSE: Fix copyright "Antibody Training Pipeline ESM" → "DeepBoner Contributors" - pyproject.toml: Add missing license = "Apache-2.0" field - README.md: Fix frontmatter license: mit → apache-2.0 Domain Threading Fixes: - hierarchical.py: Add domain param to __init__ and pass to ResearchTeam - factory.py: Pass domain to HierarchicalOrchestrator All 237 tests pass. Domain now properly threaded through all orchestrators. * test: enhance domain handling in orchestrators and judges - Updated unit tests for `configure_orchestrator` to include mock mode and free tier scenarios, ensuring the domain is correctly passed to handlers. - Refactored tests for `JudgeHandler` to mock model retrieval, allowing for domain acceptance without API key requirements. - Improved `AdvancedOrchestrator` tests to mock API key validation and ensure domain handling i…fd1472e -
ci: upgrade to ironclad CI/CD configuration
- Upgrade setup-uv@v4 → v7 with built-in caching (removes cache warning) - Pin uv version to 0.5.6 for reproducible builds - Add ruff format --check (enforces consistent formatting) - Add --locked to uv sync (ensures lockfile integrity) - Auto-format 4 files to pass new format checke70a3b7 -
feat: Wire LlamaIndex RAG into Simple Mode (Tiered Embedding) (#83)
Unverified signature* feat: wire LlamaIndex RAG service into embedding infrastructure This PR implements tiered embedding service selection per NEXT_TASK.md: ## Changes - Add EmbeddingServiceProtocol (embedding_protocol.py) for unified interface - Add async wrappers to LlamaIndexRAGService (add_evidence, search_similar, deduplicate) - Update service_loader.py with get_embedding_service() factory method - Update ResearchMemory to use service_loader instead of direct EmbeddingService - Update orchestrators to use EmbeddingServiceProtocol type hints ## Design Patterns Applied - Strategy Pattern: Tiered service selection (LlamaIndex or local) - Factory Method: get_embedding_service() creates appropriate service - Protocol Pattern: Structural typing for service interface - Dependency Injection: ResearchMemory accepts any protocol-compatible service ## Tiered Selection - Premium tier (OPENAI_API_KEY present): LlamaIndexRAGService with: - OpenAI embeddings (text-embedding-3-small) - Persistent ChromaDB s…7baf8ba
-
fix: add future annotations to workflow.py for runtime type compatibility
The string annotation "BaseCheckpointSaver[Any]" | None failed at runtime because Python can't use | with string literals. Adding `from __future__ import annotations` makes all annotations strings evaluated lazily, fixing the TypeError. Also removed now-unnecessary quotes per ruff UP037.586a3f1 -
feat(SPEC-08): Integrate shared memory layer + CodeRabbit fixes (#74)
Unverified signature## Summary - SPEC-08: Shared memory layer integration - CodeRabbit critical fix: async add_evidence() with proper deduplication - Security: Fixed CVEs in langgraph-checkpoint and urllib3 - CI: Hardened to fail on security vulnerabilities - Docstrings: 80%+ coverage All 178 tests pass. No known vulnerabilities.e0c585c -
fix: implement proper hypothesis conversion in synthesize_node
The previous implementation left hypotheses=[] in synthesize_node with a comment "Relies on evidence for now as state mapping is complex". This fix: - Adds _convert_hypothesis_to_mechanism() helper function - Properly converts state Hypothesis → MechanismHypothesis - Parses "drug -> target -> pathway -> effect" format back to fields - Enables report generation to use generated hypotheses The conversion is actually straightforward - parse the statement format and map supporting/contradicting evidence IDs.7719726 -
feat: Enhance research workflow with embedding service integration
- Updated graph nodes to accept an optional EmbeddingService for improved evidence handling and deduplication. - Refactored search, judge, resolve, and synthesize nodes to utilize the embedding service for enhanced functionality. - Modified the research graph creation to bind the embedding service to worker nodes, ensuring seamless integration. - Added logging for better traceability during node execution. - Expanded unit and integration tests to cover new embedding service interactions and ensure robust functionality.f160233 -
feat: Integrate LangGraph for enhanced research orchestration
- Added LangGraph dependencies to pyproject.toml and uv.lock for improved state management and orchestration capabilities. - Implemented LangGraph-based orchestrator in src/orchestrators/langgraph_orchestrator.py, enabling structured research workflows. - Developed graph nodes and state management in src/agents/graph, including search, judge, and synthesis functionalities. - Updated app.py to support new "god" mode for advanced orchestration. - Enhanced documentation for active bugs and architectural gaps related to LangGraph integration. - Added unit and integration tests to ensure functionality and reliability of the new features.a820b5b -
fix(P0): Implement SPEC_06 - Simple Mode Synthesis Fix (#71)
Unverified signature* feat: implement SPEC_06 fixes for simple mode synthesis Implements research-backed architecture changes for Simple mode: - Diverse evidence selection with lost-in-the-middle mitigation - Debiased judge prompt (scoring only, no decision making) - Code-enforced termination criteria (prevents infinite loops) - Real partial synthesis with drug candidates when max iterations reached - Unit and integration tests for all new logic * fix: address CodeRabbit review feedback - Fix type annotation: recommendation str -> Literal["continue", "synthesize"] - Add @pytest.mark.unit markers to unit tests - Add @pytest.mark.integration markers to integration tests - Simplify early/late evidence assertions using set intersection - Replace next() with explicit filtering for clearer test diagnostics - Extract hardcoded thresholds (50, 30) to TERMINATION_CRITERIA - Fix e2e mock to accept iteration/max_iterations parameters All 177 tests pass, mypy clean, ruff clean. * docs: add P3 architectural gap r…5cac97d -
feat: add service loader + SPEC_06 + P0 bug report
Service Loader: - Create src/utils/service_loader.py for centralized lazy loading - All orchestrators now use centralized service loading - Enforces OrchestratorProtocol on Advanced and Hierarchical SPEC_06 (Simple Mode Synthesis - not yet implemented): - Research-backed spec for fixing Simple mode never synthesizing - Identifies 6 root causes with November 2025 LLM-as-Judge research - Separates scoring from decision-making (debiased architecture) P0 Bug Report: - Documents Simple mode producing only citations (no synthesis) - Confidence dropping to 0% in late iterations (context overflow) - Judge never recommending "synthesize" even with 455 sources CodeRabbit concerns from PR #70 addressed.9639483 -
fix: Address audit findings in orchestrators package
ClaudeCRITICAL fixes: - HierarchicalOrchestrator now accepts config parameter and uses max_iterations - Added timeout protection (DEFAULT_TIMEOUT_SECONDS = 300.0) HIGH priority fixes: - Added OrchestratorProtocol to base.py for type safety - Factory returns OrchestratorProtocol instead of Any MEDIUM priority fixes: - Added deprecation warnings for MagenticOrchestrator class alias - Added deprecation warning for get_magentic_orchestrator() function - Improved error handling with separate ImportError/Exception blocks - Added null check before calling analyzer.analyze() in simple.py Type safety improvements: - simple.py uses proper StatisticalAnalyzer/EmbeddingService types via TYPE_CHECKING - All public API functions have proper return type annotations - Sorted __all__ alphabetically per ruff RUF022 All 147 tests pass, linting and mypy clean.11888fc -
refactor: Organize orchestrators into dedicated package
Claude- Create src/orchestrators/ package with proper module structure - base.py: Shared protocols (SearchHandlerProtocol, JudgeHandlerProtocol) - simple.py: Basic search-judge loop orchestrator (was orchestrator.py) - advanced.py: Multi-agent MS Agent Framework orchestrator (was orchestrator_magentic.py) - hierarchical.py: Sub-iteration middleware orchestrator - factory.py: Factory pattern for orchestrator creation - __init__.py: Clean public API with facade pattern Design principles applied: - Single Responsibility (SRP): Each file has one clear job - Interface Segregation (ISP): Protocols in base.py - Factory Pattern (GoF): Centralized creation logic - Facade Pattern: Clean public imports via __init__.py All imports updated across: - src/app.py, src/agents/ - tests/unit/, tests/e2e/, tests/integration/ - examples/orchestrator_demo/ All 147 tests pass, linting and typecheck clean.e82d9c9 -
fix: implement SPEC_04 (Magentic UX) and SPEC_05 (cleanup)
SPEC_04: - P0: Preserve chat history on timeout (app.py) - P1: Increase default timeout to 600s - P1: Add MAGENTIC_TIMEOUT env var config SPEC_05: - Delete empty src/orchestrator/ folder - Delete unused orchestrator_hierarchical.py (0% coverage) All 162 tests pass.cb46aac -
feat(tools): add OpenAlex integration with citation-based ranking
- Implemented OpenAlexTool in src/tools/openalex.py - Added comprehensive unit and integration tests in tests/unit/tools/test_openalex.py - Updated src/tools/__init__.py to export the new tool - Updated SPEC_03 with final implementation details and test patterns - Features: Citation count sorting, abstract reconstruction, concept tagging, OA links - Verified with 100% test pass rate and clean lint/type checksfd28242 -
fix: address CodeRabbit review feedback
SPEC_02 (CRITICAL): - Update code examples to match actual implementation - Replace non-existent create_test_orchestrator() with real pattern - Show actual pytest fixtures (mock_search_handler, mock_judge_handler) - Change "Files to Create" → "Files Created" orchestrator_magentic.py (nitpick): - Make timeout configurable via constructor parameter - timeout_seconds defaults to 300.0 (5 minutes) All 149 tests passing.97c317b -
feat: Implement SPEC_01 (Termination) and SPEC_02 (E2E Tests)
- SPEC_01: Added timeout (300s) and progress events to MagenticOrchestrator - SPEC_02: Created tests/e2e/ with mocked tests for Simple and Advanced modes - Docs: Updated specs to match codebase stateb1d094d -
refactor: add session reset + document magic number (senior review feedback)
2588375 -
fix: P0 dedup bug + HF judge infinite loop prevention
Bug 1 - Semantic Dedup Removing All Evidence: - Was calling _deduplicate_and_rank(all_evidence) every iteration - Old items already in vector store found THEMSELVES as duplicates - Fix: Only dedup NEW evidence, not entire accumulated list Bug 2 - HF Judge Infinite Loop: - HF Inference failures returned "continue" with 0% confidence - Loop never terminated when API kept failing - Fix: Track consecutive failures, force "synthesize" after 3 failures Both bugs caused Simple mode (free tier) to loop forever with no output. Now: Evidence accumulates properly AND loop terminates gracefully.5e761eb -
fix: simplify HSDD example to fix Gradio click issue (P2)
The third example wasn't filling the chat box when clicked. Likely caused by parentheses in "HSDD (Hypoactive Sexual Desire Disorder)". Fix: Remove abbreviation and parentheses - just use full name. Also more readable since HSDD was getting cut off anyway.2ea01fd -
Merge pull request #62 from The-Obstacle-Is-The-Way/dev
Unverified signaturefix: resolve all P0-P3 bugs (termination, streaming, thinking state)153a9c0 -
fix: remove duplicate backend line (CodeRabbit feedback)
dbe535c -
Fix P3 bug: Guarantee termination event in Magentic mode
- Add fallback yield in MagenticOrchestrator.run when max rounds reached - Track final_event_received flag to prevent double termination - Add unit tests for termination guarantee and normal completiond36ce3c -
fix: P0/P1/P2 - Gradio crash, UX improvements, thinking state (#61)
Unverified signature* fix: handle None parameters from Gradio example caching (P0) Root cause: Gradio passes None for missing example columns during startup caching, overriding Python default values. Line 131 called .strip() on None, crashing the HuggingFace Space. Fix: Add defensive None handling before .strip(): api_key_str = api_key or "" api_key_state_str = api_key_state or "" Added tests to prevent regression. * fix: multiple UX improvements (P1 bugs) 1. HSDD acronym spelled out (Hypoactive Sexual Desire Disorder) 2. Added loading indicator ("Processing...") for immediate feedback 3. Removed temperature settings from magentic agents for reasoning model compatibility (o3, o1 only support temperature=1) 4. Bug report documenting remaining issues (API key persistence) 140 tests passing. * fix: enhance UX with "thinking" state and API key persistence 1. Added a "thinking" state yield before blocking calls in Magentic orchestrator to improve user feedback during long processing times. 2. Up…6b5e05b -
fix: enhance UX with "thinking" state and API key persistence
1. Added a "thinking" state yield before blocking calls in Magentic orchestrator to improve user feedback during long processing times. 2. Updated Gradio examples to include explicit None values for API key inputs, ensuring persistence across example clicks. 3. Set temperature explicitly to 1.0 for compatibility with reasoning models in Magentic agents. All tests passing.3599f0a -
fix: multiple UX improvements (P1 bugs)
1. HSDD acronym spelled out (Hypoactive Sexual Desire Disorder) 2. Added loading indicator ("Processing...") for immediate feedback 3. Removed temperature settings from magentic agents for reasoning model compatibility (o3, o1 only support temperature=1) 4. Bug report documenting remaining issues (API key persistence) 140 tests passing.5441526 -
fix: handle None parameters from Gradio example caching (P0)
Root cause: Gradio passes None for missing example columns during startup caching, overriding Python default values. Line 131 called .strip() on None, crashing the HuggingFace Space. Fix: Add defensive None handling before .strip(): api_key_str = api_key or "" api_key_state_str = api_key_state or "" Added tests to prevent regression.29a6844 -
Merge branch 'dev' - P1 bug fixes + CodeRabbit feedback
8f45b69 -
style: integrate CodeRabbit review feedback
- Add @pytest.mark.unit to streaming fix tests - Simplify API key fallback: nested ternary → (x or y) or None - Clean up commented-out event handler code in app.py - Add language specifiers to markdown code blocks (text, bash) - Remove redundant fallback in judges.py _extract_key_findings All 138 tests passing.82503b1 -
fix: resolve P1 bugs (streaming UX + api key persistence) and update tests/docs
9006d69 -
fix: resolve streaming spam and API key persistence bugs
Bug 1 (Streaming Spam): - Add streaming buffer in app.py to accumulate tokens - Skip yield during streaming, flush on non-streaming events - Reduces O(N²) to O(N) - one message instead of hundreds Bug 2 (API Key Persistence): - Add gr.State component to persist key across example clicks - Fallback logic: use textbox value, else state value - Key survives Gradio's additional_inputs reset behavior Tests: 138 passing (136 original + 2 new validation tests)0c9be4a -
fix: replace deprecated OpenAIModel with OpenAIChatModel
Update pydantic-ai imports to use OpenAIChatModel instead of the deprecated OpenAIModel class. Also adds Bug 3 (deprecation) and Bug 4 (asyncio GC errors) to the integration bug documentation. Files updated: - src/app.py: Import and type annotation - src/utils/llm_factory.py: Import and usage - docs/bugs/P1_MAGENTIC_STREAMING_AND_KEY_PERSISTENCE.md: Add 2 new bugs All 136 tests pass.c881895 -
fix(config): use gpt-5.1 (actually available) not gpt-5 (deprecated)
75bc69f -
fix: P0 bugs + model config stabilization (November 2025) (#59)
Unverified signature* fix(judges): fallback to heuristic extraction when HF quota exhausted * fix(config): update default LLM models to stable Nov 2025 versions * docs: add LLM model defaults (Nov 2025) to agent guidance files * refactor(judges): extract shared title-extraction helper Address CodeRabbit nitpicks: - Add language tag to fenced code block in docs - Extract _extract_titles_from_evidence() to reduce duplication between HFInferenceJudgeHandler and MockJudgeHandler All 136 tests pass.622c8ba -
refactor(judges): extract shared title-extraction helper
Address CodeRabbit nitpicks: - Add language tag to fenced code block in docs - Extract _extract_titles_from_evidence() to reduce duplication between HFInferenceJudgeHandler and MockJudgeHandler All 136 tests pass.b8dbd20 -
fix(config): update default LLM models to stable Nov 2025 versions
bfc953b -
fix(judges): fallback to heuristic extraction when HF quota exhausted
11ad1dd -
fix: resolve all P0 critical bugs blocking demo
Bug 1 - Free Tier Quota Loop (P0): - Detect 402/quota errors in HFInferenceJudgeHandler - Return `sufficient=True` to stop loop gracefully - Show clear "Free Tier Quota Exceeded" message to user Bug 3 - API Key Not Passed to Advanced Mode (P0): - Add `api_key` parameter to `create_orchestrator()` - Pass to `MagenticOrchestrator.__init__()` - Create `OpenAIChatClient` with user's BYOK key Bug 4 - Singleton EmbeddingService Cross-Session Pollution (P0): - Remove singleton pattern from `get_embedding_service()` - Create unique ChromaDB collection per request (uuid) - Keep `SentenceTransformer` model shared for performance Bug 2 was caused by Bug 4 (dedup on polluted collection). All 135 tests pass. Demo is now functional.d1f91a4 -
fix(ui): clarify mode compatibility in radio button info
Old: "⚡ Simple: Fast (Free/Any Key) | 🔬 Advanced: Deep Multi-Agent (OpenAI Key Only)" New: "⚡ Simple: Free/OpenAI/Anthropic | 🔬 Advanced: OpenAI only" Explicitly lists all supported backends for Simple mode so Anthropic users know they're not locked out.87feaa7