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-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 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 -
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 -
docs: add senior agent audit prompt for comprehensive bug hunt
ae22306 -
docs: add P0 critical bugs report - demo is brokenβ
4 critical bugs identified that make the demo non-functional: 1. **Free Tier LLM Quota Exhausted** (P0) - HuggingFace Inference API returns 402 Payment Required - All 3 fallback models fail (Llama, Mistral, Zephyr) - Judge always returns 0% confidence, loops until max iterations 2. **Evidence Counter Shows 0 After Dedup** (P1) - Deduplication may return empty list silently - Need defensive check to keep original if dedup fails 3. **API Key Not Passed to Advanced Mode** (P0) - User's API key from Gradio form is NEVER passed to MagenticOrchestrator - Agents use settings.openai_api_key (env var) instead 4. **Singleton EmbeddingService Causes Cross-Session Pollution** (P0) - ChromaDB collection persists across ALL requests - Second query marks everything as "duplicate" of first query - Results in "Found 20 new sources (0 total)"37b8559 -
docs: update UI simplification spec with senior review fixesβ
Incorporates all feedback from senior review: - Change 6: Fix Advanced mode check (was using removed param) - Change 7: Remove 'Using your X key' message (would crash) - Change 8: Remove api_provider from function call - All 11 changes now explicitly documented with line numbers - Added GPT-5.1 and Claude Sonnet 4.5 to compatibility matrix - Added comprehensive testing checklistb866967 -
docs: add UI simplification spec for BYOK cleanupβ
Addresses GitHub issues #52 and #53: - Remove api_provider dropdown (auto-detect from key prefix) - Simplify examples table to just query + mode - Clearer free tier messaging Spec: docs/bugs/FIX_UI_SIMPLIFICATION.mddfdeb30 -
docs: reorganize documentation structure for clarityβ
DELETE (duplicates/obsolete): - to_do/REFERENCE_GRADDIO_DEMO_ANALYSIS.md - bugs/P0_MAGENTIC_MODE_BROKEN.md (superseded by FIX_PLAN) CREATE: - future-roadmap/ for planned phases 15-17 - decisions/architecture-2025-11/ for magentic-pydantic docs - bugs/ACTIVE_BUGS.md index MOVE: - DEEP_RESEARCH_ROADMAP.md β future-roadmap/ - 04_OPENALEX_INTEGRATION.md β future-roadmap/ - brainstorming/implementation/*.md β future-roadmap/phases/ - brainstorming/magentic-pydantic/*.md β decisions/architecture-2025-11/ UPDATE: - docs/index.md: Updated links, Europe PMC references, test count631e5fc
-
rebrand: DeepCritical β DeepBoner (sexual health research agent)β
π AI-Native Sexual Health Research Agent - Package renamed: deepcritical β deepboner - New focus: sexual wellness, ED, hormone therapy, libido, reproductive health - Exception class: DeepCriticalError β DeepBonerError (with backwards compat) - UI examples updated for sexual health queries - Modal app renamed: deepboner-code-execution - Fixed pre-existing mypy issue (Modal API: uv_pip_install β pip_install) 46 files updated across: - Core: pyproject.toml, README.md, CLAUDE.md, AGENTS.md, GEMINI.md - Source: app.py, mcp_tools.py, exceptions.py, code_execution.py - Docs: ~25 markdown files - Examples: 8 demo scripts - Tests: exception tests updated All tests passing (102 passed, 6 skipped)5d12635
-
fix: repair Gradio accordion bug and cleanup env varsβ
- Unwrapped ChatInterface from gr.Blocks to fix settings accordion state (fixes P1_GRADIO_SETTINGS_CLEANUP). - Updated .env.example with missing variables and removed dead ones. - Updated documentation for the fix.fcc601a -
docs: update P1 bug report with actual Gradio accordion root cause
a46131e -
fix(magentic): defensive text extraction & cleanup biorxiv refsβ
Add _extract_text to fix ChatMessage object output bug. Update bioRxiv strings to Europe PMC. Add regression test.3bfd42c -
docs: add TDD fix plan for Magentic mode report generation
17d34a8 -
docs: replace completed bug docs with new Magentic bug reportβ
Deleted (all implemented): - P0_ACTIONABLE_FIXES.md - P0_CRITICAL_BUGS.md - P0_MAGENTIC_AND_SEARCH_AUDIT.md - PHASE_00-03 implementation docs Added new bug report for actual issue found: - Magentic mode returns ChatMessage object instead of text - Root cause: event.message.text extraction fails - Max rounds reached before ReportAgent can synthesize OpenAI key works. Simple mode works. The bug is in how the final result event is processed.8a98024 -
refactor(tools): replace BioRxiv with Europe PMC (Phase 01)β
Replaced broken BioRxivTool with EuropePMCTool which supports keyword search. Updated all agents, MCP tools, and examples to use the new tool. Deleted legacy BioRxiv implementation.2f8ae1f -
fix: exclude reference_repos from mypy and cleanupβ
- Add mypy exclude for reference_repos/ and examples/ to prevent scanning of local reference code that isn't part of the project - Fix string concatenation in orchestrator_magentic.py - Fix formatting in examples (spaces around operators) - Remove resolved bug documentation (001, 002, 003)0a480cb -
fix: simplify Gradio UI to fit single viewportβ
- Reduce header to 2 lines (title + one-line description) - Remove MCP Tools tabs UI (MCP server still active at /gradio_api/mcp/) - Simplify examples (just questions, no extra params shown) - Minimal footer with disclaimer and MCP endpoint - Remove unused mcp_tools imports from app.py This fixes the header cutoff issue in HuggingFace Spaces iframe by reducing total content to fit within standard viewport height.8dc3e50 -
chore: remove resolved bug documentationβ
- Delete 005_services_not_integrated.md - embeddings now wired to simple orchestrator (enable_embeddings=True is the default in orchestrator.py) - Delete 006_magentic_mode_broken.md - magentic mode is experimental/optional, documented as requiring OpenAI (not a bug)a941b78