Spaces:
Sleeping
Sleeping
Commit History
-
fix: Resolve Free Tier synthesis issue with server-side API keys
- Marked the bug regarding Free Tier synthesis using server-side API keys as resolved. - Implemented a new `synthesize()` method in `HFInferenceJudgeHandler` to ensure proper usage of the free HuggingFace Inference API. - Updated orchestration logic to check for the presence of the `synthesize` method, allowing for correct fallback behavior. - Enhanced unit and integration tests to verify the new functionality and ensure consistent behavior across different tiers. - Documented the resolution and verification steps in the relevant markdown files.a205fc5 -
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 -
Merge branch 'main' into dev
04336d8 -
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 -
Merge branch 'main' into dev
ab1309f -
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 -
Merge remote-tracking branch 'origin/main' into dev
18f0000 -
Merge pull request #93 from The-Obstacle-Is-The-Way/feat/sexual-health-spec-11
Unverified signaturefeat: Finalize Sexual Health Spec 11 & UI Polish91a017e -
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 -
docs: fix repeated word beginnings in diagnostic steps (CodeRabbit)
d73ddfe -
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 -
docs: organize root files and add P1 synthesis fallback bug report
MOVED to proper locations: - SPEC_12_NARRATIVE_SYNTHESIS.md → docs/specs/ - BRAINSTORM_EMBEDDINGS_META.md → docs/brainstorming/ KEPT in root (per project convention): - TOOL_ANALYSIS_CRITICAL.md - CLAUDE.md, AGENTS.md, GEMINI.md, README.md NEW bug report: - P1_NARRATIVE_SYNTHESIS_FALLBACK.md - Documents why SPEC_12's LLM synthesis silently falls back to template output. Root cause is exception handling that catches all errors without user feedback. LLM synthesis works locally with API keys; HF deployment needs secrets. Updated ACTIVE_BUGS.md index with new P1 bug.1d32642 -
Merge pull request #91 from The-Obstacle-Is-The-Way/main
Unverified signaturefeat(SPEC_11): Sexual Health Research Specialist + SPEC_12 docs016fbea -
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 -
docs: ironclad SPEC_12 for narrative synthesis implementation
Deep audit against Microsoft Agent Framework patterns: - Identified root cause: _generate_synthesis() has NO LLM call - Maps exactly to codebase with line numbers - Complete implementation plan with code examples - Test criteria included - Ready for async agent implementation Key changes needed: 1. NEW: src/prompts/synthesis.py (narrative prompts) 2. MODIFY: src/orchestrators/simple.py (add LLM call) 3. NEW: tests/unit/prompts/test_synthesis.py 4. NEW: tests/unit/orchestrators/test_simple_synthesis.py MS Agent Framework reference pattern: concurrent_custom_aggregator.py shows LLM-based aggregation vs our current string templating approach0049ad7 -
feat(SPEC_12): implement narrative report synthesis using LLM
This commit introduces the `SynthesisAgent` for generating narrative research reports from structured data, addressing the issue of outputting synthesized prose instead of structured metadata. Key changes include: - Creation of `SynthesisAgent` in `src/agents/synthesis.py` for LLM-based synthesis. - Addition of synthesis prompts and a few-shot example in `src/prompts/synthesis.py`. - Modification of the orchestrator to call the new `SynthesisAgent` for report generation. - Implementation of tests to ensure narrative output structure and reference accuracy. This enhancement aligns with the project's focus on sexual health research and improves the quality of report generation. Closes #85, #86.c8f7161 -
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 -
docs: add SPEC_12 for narrative report synthesis
Detailed spec for fixing issue #85 - reports output structured metadata instead of synthesized prose narrative. Key findings: - Current `_generate_synthesis()` is string templating with NO LLM call - Microsoft agent-framework shows custom aggregator pattern - Need dedicated SynthesisAgent with LLM-based prose generation Implementation plan: 1. Create SynthesisAgent (`src/agents/synthesis.py`) 2. Add synthesis prompts with few-shot examples 3. Update orchestrators to call SynthesisAgent 4. Add proper test coverage References Microsoft agent-framework patterns: - concurrent_custom_aggregator.py - fan_out_fan_in_edges.py25c3ff9 -
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 -
docs: SPEC_10 audit - add 16th location and test updates
Senior agent audit findings: - Added src/agent_factory/judges.py (16th hardcoded location) - Added domain threading: JudgeHandler → format_user_prompt - Added tests/e2e/test_simple_mode.py to update list - Made get_domain_config() accept strings for UI compatibility - Clarified migration phases with JudgeHandler dependency0e1abcc -
docs: add SPEC_10 for domain-agnostic refactor
Addresses #75 (Domain Identity Crisis) and #76 (Hardcoded Prompts). Creates ironclad specification for: - Centralized DomainConfig in src/config/domain.py - 15 hardcoded locations to update - Testing strategy and migration path - Backwards-compatible rollout Key insight: Make agent GENERAL by default, with domain presets for specialization (drug_repurposing, sexual_health, etc.)cb24279 -
fix: align pre-commit hook versions with CI
BREAKING: Pre-commit was using ancient tool versions causing divergence: - ruff: v0.4.4 → v0.14.7 (10 minor versions behind!) - mypy: v1.10.0 → v1.19.0 (9 minor versions behind!) This caused CI to fail because ruff formatting behavior changed significantly between versions. Now pre-commit and CI use same versions. Also reformatted 2 test files that had version-specific formatting.4b245e3 -
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 -
Merge branch 'dev'
c66250f -
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
-
Merge branch 'dev'
5004ba0 -
docs: add NEXT_TASK.md for LlamaIndex integration
Priority infrastructure task for async AI agent: - Wire LlamaIndexRAGService into service loader - Tiered upgrade: free (local) → premium (OpenAI + persistence) - Addresses issues #54 and #64 See file for full implementation spec.ee2c527 -
Merge branch 'dev'
7443f20 -
fix: add LangGraph deps to requirements.txt for HuggingFace Spaces
HuggingFace Spaces uses requirements.txt, not pyproject.toml. Missing langchain-core caused "No module named 'langchain_core'" error. Added: - langgraph, langchain, langchain-core, langchain-huggingface - langgraph-checkpoint-sqlite>=3.0.0 (security fix) - urllib3>=2.5.0 (security fix) - huggingface-hub5068f9a -
Merge branch 'dev'
6ccc865 -
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 -
Merge pull request #72 from The-Obstacle-Is-The-Way/dev
Unverified signature## Summary Merges dev → main with complete SPEC-07 + SPEC-08 implementation. ### Included: - SPEC-07: LangGraph Cognitive Memory Architecture - SPEC-08: Shared Memory Layer Integration - CodeRabbit critical fixes (async add_evidence with proper deduplication) - Security: CVE fixes for langgraph-checkpoint and urllib3 - CI hardening: Security scans now fail on vulnerabilities All 178 tests pass. No known vulnerabilities.2c12244 -
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 -
docs: add SPEC_08 for memory layer integration
SPEC_08 documents the plan to integrate the structured memory layer (built in SPEC_07 as "God Mode") into Simple and Advanced modes. Key points: - Memory should be a shared LAYER, not a separate MODE - Extract ResearchMemory service from LangGraph nodes - Wire into existing orchestrators - Remove "God Mode" from UI post-integration Also updates ACTIVE_BUGS.md to track this as P1 post-hackathon work. Related: Issue #73, PR #72b074f88 -
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 -
fix: Update test for judge node initialization with improved mocking
- Replaced the mock for the pydantic_ai Agent with a mock for get_model to avoid real API key requirements. - Enhanced the test by mocking the Agent class entirely to ensure proper behavior during initialization. - Adjusted the test setup to maintain functionality while improving isolation from external dependencies.46b9533 -
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 -
Merge branch 'main' into dev
912218f -
docs: add SPEC_07 LangGraph Memory Architecture + update bug docs
NEW DOCS: - SPEC_07_LANGGRAPH_MEMORY_ARCH.md: Ironclad spec for structured cognitive memory using LangGraph (Nov 2025 best practices) - P3_ARCHITECTURAL_GAP_STRUCTURED_MEMORY.md: Bug report documenting missing hypothesis/conflict tracking in AdvancedOrchestrator Based on deep codebase audit and web search (Nov 2025): - LangGraph chosen over Mem0 for orchestration (Mem0 better for personalization) - Works with HuggingFace Inference API (Llama 3.1) - no OpenAI required - Includes SQLite checkpointer for dev, MongoDB for prod UPDATED: - ACTIVE_BUGS.md: Added P3 architecture gaps, marked P0 Simple Mode as FIXED3d25956 -
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 -
fix: force HuggingFace rebuild after orchestrator refactor
The Space showed 'application does not appear to be initialized' error. Local testing confirms app starts correctly. Issue is stale Docker cache. Adding build version comment to trigger fresh rebuild.d2ad6f5 -
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