Skip to content

feat(pubmed): add workflow presets and richer article metadata#1778

Open
pi-dal wants to merge 1 commit into
jackwener:mainfrom
pi-dal:feat/pubmed-workflows-and-article-metadata
Open

feat(pubmed): add workflow presets and richer article metadata#1778
pi-dal wants to merge 1 commit into
jackwener:mainfrom
pi-dal:feat/pubmed-workflows-and-article-metadata

Conversation

@pi-dal
Copy link
Copy Markdown
Contributor

@pi-dal pi-dal commented May 29, 2026

Summary

This PR expands the built-in PubMed adapter from basic retrieval into a more useful research workflow surface for both humans and agents.

The built-in adapter already covered the core retrieval chain, but it still had two practical gaps:

  1. Agents had to handcraft common high-frequency PubMed queries for workflows such as clinical-trial screening and review-paper search.
  2. Single-article output was still too thin for downstream summarization, evidence triage, and research-context inspection.

This change improves the built-in adapter directly instead of creating a separate duplicate PubMed plugin.

Why we should do this

1. Preserve one canonical PubMed entrypoint

OpenCLI already ships a built-in pubmed adapter. Extending that adapter is better than creating a parallel plugin with overlapping commands, because it keeps discovery, maintenance, and user expectations simple.

2. Turn common PubMed workflows into stable commands

clinical-trial and review are not cosmetic aliases for search. They encode high-frequency research presets that agents would otherwise have to reconstruct by manually composing PubMed query syntax every time.

3. Make article detail output more useful for downstream automation

A single structured record is easier to consume than field/value rows in JSON, plain, table, and markdown flows. Adding affiliations and grants also exposes higher-value research context without requiring another follow-up command.

What changed

New PubMed workflow presets

  • Added opencli pubmed mesh <term> for MeSH-term driven search.
  • Added opencli pubmed journal <journal> for journal-scoped search.
  • Added opencli pubmed clinical-trial <query> as a preset over:
    • Clinical Trial[PT]
    • humans[mesh]
  • Added opencli pubmed review <query> as a preset over:
    • Review[PT]

Richer single-article output

  • Reshaped opencli pubmed article <pmid> from field/value rows into one structured record.
  • Extended article output with:
    • affiliations
    • grants
  • Kept --full-abstract so callers can choose between truncated and full abstract output.

Docs and registry updates

  • Updated the PubMed adapter docs.
  • Updated the adapter index.
  • Regenerated cli-manifest.json.

Files changed

  • clis/pubmed/article.js
  • clis/pubmed/clinical-trial.js
  • clis/pubmed/journal.js
  • clis/pubmed/mesh.js
  • clis/pubmed/pubmed.test.js
  • clis/pubmed/review.js
  • clis/pubmed/utils.js
  • docs/adapters/browser/pubmed.md
  • docs/adapters/index.md
  • cli-manifest.json

Test Plan

I ran the following verification commands locally:

  • npm test -- clis/pubmed/pubmed.test.js
  • npm run build-manifest
  • npm run typecheck
  • npm run check:silent-column-drop
  • npm run check:typed-error-lint

Observed results:

  • PubMed adapter tests passed: 26 passed
  • Manifest regenerated successfully: Manifest compiled: 904 entries
  • TypeScript typecheck passed
  • Silent-column-drop check reported no new violations
  • Typed-error lint reported no new violations

Notes

  • During live smoke validation, the public NCBI API occasionally returned 429 on the first attempt and succeeded on retry. This appears to be public API rate limiting behavior rather than a regression introduced by this PR.

Expand the built-in PubMed adapter from basic retrieval into a more useful research workflow surface.

Why:
- The existing adapter already covered the core retrieval chain, but it still required agents to handcraft common high-frequency PubMed queries.
- Single-article output was also still too thin for downstream summarization and evidence triage.
- The goal of this change is to improve agent-facing research ergonomics without introducing a separate duplicate plugin.

What changed:
- add `pubmed mesh <term>` for MeSH-term driven search
- add `pubmed journal <journal>` for journal-scoped search
- add `pubmed clinical-trial <query>` as a preset over Clinical Trial + humans filters
- add `pubmed review <query>` as a preset over Review article filtering
- reshape `pubmed article <pmid>` into a single structured record instead of field/value rows
- extend article detail output with `affiliations` and `grants`
- update PubMed adapter docs and adapter index
- regenerate `cli-manifest.json`

Verification:
- npm test -- clis/pubmed/pubmed.test.js
- npm run build-manifest
- npm run typecheck
- npm run check:silent-column-drop
- npm run check:typed-error-lint
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