OpenParable
Skip to content
← Back to skills

Reference Finder

Research
reference-finder

Reference Finder is an Agent Skill for research published in the aipoch/medical-research-skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/aipoch/medical-research-skills/blob/HEAD/scientific-skills/Evidence Insight/reference-finder/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/reference-finder, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Source: 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)

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)

python scripts/find_refs.py "CRISPR-Cas9 gene editing has revolutionized biomedical research."

CLI (interactive mode)

python scripts/find_refs.py

Example output (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