Add PubMed literature mining API - #1
Open
dainiubi438-debug wants to merge 1 commit into
Open
dainiubi438-debug wants to merge 1 commit into
dainiubi438-debug wants to merge 1 commit into
Conversation
dainiubi438-debug
force-pushed
the
agent/pubmed-literature-mining
branch
from
August 9, 2026 11:36
cb598c6 to
b4ec6be
Compare
dainiubi438-debug
marked this pull request as ready for review
August 9, 2026 11:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
PubMedClientbuilt on the official NCBI E-utilities APIGET /api/pubmedwith validated query and result-limit parametersPUBMED_EMAILandNCBI_API_KEYconfigurationWhy
OpenTCM currently answers from its traditional medicine knowledge graph but has no maintained path for retrieving modern biomedical evidence. This integration provides a small, dependency-neutral backend module that downstream UI and RAG workflows can reuse without coupling PubMed access to the existing LLM implementation.
User and developer impact
Users can retrieve relevant PubMed citations and a lightweight bibliometric summary through a JSON endpoint. Developers can inject a session for testing, configure NCBI identification through environment variables, and handle query errors separately from upstream service failures.
Validation
python -m unittest discover -s tests -v— 8 tests passedpython -m compileall -q pubmed_mining.py app.pyacupuncture osteoarthritis, 2 records returned from 1,456 matchesOperational note
Deployments should set
PUBMED_EMAILand follow the NCBI E-utilities rate limits.NCBI_API_KEYis optional and raises the default request allowance.