Skip to content

feat(knowledge): PubMed evidence integration (B2)#117

Merged
EduardPetraeus merged 1 commit intomainfrom
feature/b2-pubmed-evidence-integration
Mar 8, 2026
Merged

feat(knowledge): PubMed evidence integration (B2)#117
EduardPetraeus merged 1 commit intomainfrom
feature/b2-pubmed-evidence-integration

Conversation

@EduardPetraeus
Copy link
Owner

Summary

  • PubMed E-utilities client (pubmed_client.py): esearch + efetch, XML parsing, rate limiting, GRADE-inspired evidence hierarchy scoring
  • Evidence cache store (evidence_store.py): cache-first strategy with DuckDB agent.evidence_cache table, 90-day TTL
  • MCP tool Add SQL safety comment to ingestion_engine #10 (search_evidence): AI agents can search PubMed for peer-reviewed evidence supporting health claims
  • Chat engine integration: automatic keyword-to-PubMed mapping (22 keywords, incl. Danish), <evidence> XML context injection with PMID citations
  • Schema: agent.evidence_cache table + 3 evidence columns on health_graph_edges

Test plan

  • 36 new tests passing (pubmed client, evidence store, MCP tool, chat evidence)
  • All PubMed API calls mocked — no external dependencies in tests
  • Pre-commit hooks passing (black, ruff, gitleaks)
  • Manual: start MCP server, call search_evidence("HRV sleep quality")
  • Manual: hit /v1/chat with health question, verify PMID citations in response

Generated with Claude Code

Add PubMed E-utilities client, evidence cache store with DuckDB backend,
MCP tool #10 (search_evidence), and chat engine integration with automatic
keyword-to-PubMed mapping. GRADE-inspired evidence hierarchy scoring.

- New: PubMedClient (esearch + efetch, rate limiting, XML parsing)
- New: EvidenceStore (cache-first strategy, 90-day TTL, DuckDB storage)
- New: search_evidence MCP tool for AI agents
- Modified: chat_engine with evidence context injection (<evidence> tags)
- Modified: create_agent_schema.sql with evidence_cache table
- Modified: setup_agent_schema.py with health_graph_edges evidence columns
- Tests: 36 new tests covering client, store, tool, and chat integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@EduardPetraeus EduardPetraeus merged commit e6e3ea1 into main Mar 8, 2026
6 of 8 checks passed
@EduardPetraeus EduardPetraeus deleted the feature/b2-pubmed-evidence-integration branch March 8, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant