reference-finder
/reference-finder
Automatically finds and ranks PubMed references for each sentence in scientific text; use when you need titles, DOIs, and brief recommendation reasons from the PubMed E-utilities API.
- Author
- aipoch ↗
- Repository
- medical-research-skills ↗
- Licence
- MIT
- Last repository change
- 17.09.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 7
No signals detected. Repository changed on 17.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/find_refs.py
What it does and when to use it
Automatically finds and ranks PubMed references for each sentence in scientific text; use when you need titles, DOIs, and brief recommendation reasons from the PubMed E-utilities API.
Original author description
Automatically finds and ranks PubMed references for each sentence in scientific text; use when you need titles, DOIs, and brief recommendation reasons from the PubMed E-utilities API.
How it works
- When to Use
- Key Features
- Dependencies
- Example Usage
- Implementation Details
SKILL.md preview
---
name: reference-finder
description: Automatically finds and ranks PubMed references for each sentence in scientific text; use when you need titles, DOIs, and brief recommendation reasons from the PubMed E-utilities API.
license: MIT
author: AIPOCH
---
> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
## When to Use
- You have a scientific paragraph and want suggested PubMed papers for **each sentence**.
- You need **top-ranked references** with **title, DOI, PMID, year**, and a short **why recommended** explanation.
- You are drafting or reviewing a manuscript and want quick **literature grounding** for key claims.
- You want a lightweight reference matcher that uses **only the official PubMed E-utilities API** (no third-party services).
- You need a scriptable tool for batch or CLI workflows to generate candidate citations.
## Key Features
- Sentence-level reference matching for scientific text.
- Returns the **top N (default: 3)** most relevant PubMed records per sentence.
- Outputs structured fields: **title, DOI, PMID, year, recommendation reason**.
- Relevance ranking based on:
- keyword overlap / match strength,
- publication year preference,
- citation-count signal (when available/derivable).
- Safety constraints:
- Network access restricted to `eutils.ncbi.nlm.nih.gov`.
- No local filesystem writes except to `outputs/` during execution.
- Request timeout set to **30 seconds** with clear error messages.
- Supports Python API usage and CLI usage (including interactive mode).
## Dependencies
- Python **3.x** (standard library only; no third-party packages required)
## Example Usage
### Python (direct call)
```python
from reference_finder import find_references
text = "CRISPR-Cas9 gene editing has revolutionized biomedical research."
results = find_references(text)
for ref in results[:3]:
print(f"- {ref['title']} ({ref['year']})")
print(f" DOI: {ref['doi']}")
print(f" PMID: {ref['pmid']}")
print(f" Reason: {ref['reason']}")
```
### CLI (single input)
```bash
python scripts/find_refs.py "CRISPR-Cas9 gene editing has revolutionized biomedical research."
```
### CLI (interactive mode)
```bash
python scripts/find_refs.py
```
### Example output (JSON)
```json
[
{
"pmid": "PMID:",
"title": "A Programmable Dual-RNA-Guided DNA Endonuclease in Vitro",
"doi": "10.1126/science.1225829",
"year": 2012,
"reason": "Highest keyword match for 'CRISPR-Cas9', foundational paper"
}
]
```
## Implementation Details
### Data flow
1. **Sentence splitting**: The input text is split into sentences (implementation-defined; typically punctuation-based).
2. **PubMed search (ESearch)**: For each sentence, a query is sent to:
- `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi`
3. **Record retrieval (EFetch)**: The top candidate PMIDs are fetched via:
- `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi`
4. **Field extraction**: Title, year, PMID, and DOI (when present) are extracted from the returned metadata.
5. **Ranking and selection**: Candidates are scored and the top **N** are returned with a short recommendation reason.
### Ranking signals
- **Keyword match**: Measures overlap between sentence terms and retrieved record metadata (e.g., title/abstract terms when available).
- **Publication year**: Used as a preference signal (e.g., favoring more recent work unless a classic/foundational match is strong).
- **Citation count**: Incorporated when available/derivable; otherwise treated as missing without failing the run.
### Operational constraints and safety
- **Allowed network host**: `eutils.ncbi.nlm.nih.gov` only.
- **Prohibited**: Any third-party URLs.
- **Filesystem**: Do not write outside `outputs/` during execution.
- **Rate limiting**: Use a reasonable request cadence (e.g., **~0.5s** between requests) to respect API limits.
- **Timeout**: **30 seconds** per request.
- **Error handling**: Return semantic, user-readable error messages for network/API/parse failures.
### Defaults
- **Top references per sentence**: 3
- **Endpoints**:
- ESearch: `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi`
- EFetch: `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi`
### Related project files
- Main script: `scripts/find_refs.py`
- Tests: `tests/test_finder.py`
- Evaluation checklist: `references/evaluation-checklist.md`
- PubMed E-utilities documentation: https://www.ncbi.nlm.nih.gov/books/NBK25504/
Files in this package (4)
- SKILL.md 4 KB
- reference-finder_audit_result_v1.json 12 KB
- references/evaluation-checklist.md 3 KB
- scripts/find_refs.py 10 KB
Versions
The database has no other skills named reference-finder.
Database snapshot: 13.11.2026 · package version 35e5c3c758ac (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95pubmed-database
直接使用 PubMed 和 NCBI E-utilities 搜索生物医学文献的工作流,包括 MeSH 查询、PMID 查找、引文检索和 API 支持的文献监控。 - 100scientific-db-pubmed-database
Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring. Use when a task needs biomedical literature from PubMed rather than general web search. - 100pubmed-topic-recommend
Generate ~5 actionable research topic recommendations by querying PubMed E-utilities; use when a user provides a research direction/constraints and needs evidence-backed topic ideas quickly. - 90pubmed-guide
PubMed query syntax, identifier crosswalks, and gates for the pubmed_* tools over PubMed, PubMed Central, Europe PMC, and NIH iCite. Use when building a MeSH-based or systematic search, resolving a reference list or DOIs to PMIDs, judging how cited an article is, getting full… - 100pubmed-bridge
Adds a reproducible, MeSH-aware PubMed search to an lr-ai literature review. lr-ai searches OpenAlex, Semantic Scholar and arXiv only; this skill runs the clinical PubMed search through NCBI E-utilities, removes what the lr-ai run already has, and adds the new DOIs to that run… - 95pubmed-database
Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring. Use when a task needs biomedical literature from PubMed rather than general web search.