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(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 -
docs: fix repeated word beginnings in diagnostic steps (CodeRabbit)
d73ddfe -
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 -
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 -
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 -
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
-
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 -
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 -
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 -
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 -
docs: mark SPEC_03/04/05 as IMPLEMENTED with acceptance criteria
All 5 specs now accurately reflect implementation status: - SPEC_01: Demo Termination ✓ - SPEC_02: E2E Testing ✓ - SPEC_03: OpenAlex Integration ✓ - SPEC_04: Magentic UX (P0-P1 complete, P2 future) - SPEC_05: Orchestrator Cleanup ✓ 154 unit tests pass.af7d422 -
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 -
docs: add SPEC_04 (Magentic UX) and SPEC_05 (Orchestrator Cleanup)
SPEC_04: Magentic Mode UX Improvements (#68) - P0: Chat history cleared on timeout (1-line fix) - P1: Timeout too short (300s → 600s) - P1: Timeout not configurable (add env var) - P2: No graceful degradation (future) SPEC_05: Orchestrator Module Cleanup (#67) - Empty src/orchestrator/ folder should be deleted - orchestrator_hierarchical.py is dead code (0% coverage) - Option A (minimal cleanup) recommended for nowc99c9c2 -
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 -
docs: add SPEC_03 for OpenAlex integration (TDD plan)
Ironclad spec for adding OpenAlex as 4th data source: Why OpenAlex: - Citation counts (prioritize authoritative papers) - Concept tagging (hierarchical classification) - Open access links (direct PDF URLs) - FREE API, 209M+ works indexed Architecture: - Implements SearchTool Protocol (DIP) - Returns Evidence with rich metadata - Follows existing tool patterns (SOLID/DRY) TDD Plan: - 10 unit tests covering all functionality - Integration test with real API - Tests written before implementation Groundwork ready: - SourceName already includes "openalex" - Evidence.metadata designed for citation data Closes #51 when implemented.1cd600b -
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 -
docs: fix spec half-measures (line refs, test counts, acceptance criteria)
SPEC_01: - Line reference: 94 → 111 (actual location) - Acceptance criteria: Mark all 4 items as done SPEC_02: - Test count: 140 → 141 - Test Matrix: Mark both modes as IMPLEMENTED - Acceptance criteria: Mark 4/5 items as done Previous agent claimed "updated" but left stale values.10e320d -
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 -
docs: fix spec accuracy (line numbers and test counts)
SPEC_01: Line reference 112 → 110 (actual location of .with_standard_manager) SPEC_02: Test count 142 → 140 (verified with pytest --collect-only) Both specs now match codebase exactly per audit verification.0f049b6 -
docs: add specs for P0 termination fix and P1 E2E testing
SPEC_01: Demo Termination Fix - Investigate if max_round_count actually works - Add hard timeout (5 min) for hackathon - Add round progress indicator SPEC_02: E2E Testing - Smoke tests (does it run?) - Structure tests (is output valid?) - Quality tests (is output useful?) - Must pass BEFORE adding new features (OpenAlex, etc.)9d02fee -
docs: sync documentation with codebase reality
- Fix test count 127→142+ (index.md) - Fix OpenAI model gpt-5.1→gpt-5 to match config.py (CLAUDE.md) - Mark phases 13-14 as COMPLETE (roadmap.md) - Auto-format 2 test files (ruff)864d85d -
docs: mark P0 bugs as fixed
c8d9b90 -
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 -
docs: update ACTIVE_BUGS.md with P2 example fix
d04e93b -
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 -
docs: remove redundant bug docs (P0/P1/P2 already fixed)
a3d157a -
Merge pull request #62 from The-Obstacle-Is-The-Way/dev
Unverified signaturefix: resolve all P0-P3 bugs (termination, streaming, thinking state)153a9c0 -
docs: clean up resolved bug reports, update P3 commit hash
Delete 13 obsolete bug docs (all resolved): - FIX_PLAN_*.md (superseded by implementations) - INVESTIGATION_*.md (completed) - P0_*, P1_*, P2_* (all fixed) - SENIOR_AGENT_*.md (one-time prompts) Update ACTIVE_BUGS.md: - P3 commit hash: (Pending) → d36ce3c - Remove broken link to deleted P1_GRADIO_SETTINGS_CLEANUP.md Bug index now shows all bugs resolved. Zero active bugs.7f11675 -
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 -
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 -
docs: fix misleading claims in bug documentation
The agent's doc claimed 'skip individual streaming events (don't yield)' but the code actually yields for every token (for live typing UX). Updated to accurately describe what the code does: - Yields immediately for each token (UX) - Doesn't append to response_parts (prevents O(N²)) - Each yield has ONE streaming marker (not accumulated) Also noted that API key fix relies on undocumented Gradio behavior.2eaf2d3 -
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 -
docs: add P1 bug report for streaming spam + API key persistence
3d9fb4c -
fix: align all docs/tests to gpt-5.1 (actual current model)
4927db5 -
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