Literature review on a gene (or topic) set

Part 4: Literature, documents and the web

Introduction to agentic AI

About this lecture

A table of what the literature says about a set of things (ten genes, eight teaching methods, a family of materials) is one of the most useful things an agent can build for you. It is also the place where language models fail most visibly: references that look right and do not exist. This unit is about building such a table so that every row can be trusted.

  • Look papers up, do not remember them. The agent writes a script that asks literature databases through their APIs.
  • Keep what came back. Raw downloads are saved, dated and never edited.
  • Every claim carries a quote from the abstract, so it can be checked.
  • Verify in layers: a script resolves every PMID and DOI and compares titles; you read a random sample.
  • Export and publish: BibTeX, Zotero, and the table on your page.

A hands-on unit. Pulling numbers out of the full-text papers comes next (Extracting data from PDFs). Search connectors that plug PubMed straight into the agent come in Making the agent yours.

Ten genes, one week, and a reader who will check every reference

The same job exists in every field: what is known about each item in a set?

Field The set What you want per item
Molecular biology 10 genes from one pathway function, disease links, model organisms
Materials science 8 electrolyte materials conductivity, stability, how measured
Education 8 teaching methods effect on learning, level, kind of study
Ecology 12 invasive species spread, impact, control methods
Public health 6 screening programmes uptake, outcome, country

The worked example uses genes; a teaching-methods version runs alongside it. The method is the same.

Looking papers up beats remembering them

A literature table is built in six steps, and two of them are yours

An API is a web address that returns data instead of a page

Five free literature APIs cover most needs

Database Covers Identifiers Key needed?
PubMed (NCBI E-utilities) biomedicine and life sciences PMID, often DOI no; a free key raises the speed limit
Europe PMC REST API PubMed plus preprints and open-access full text PMID, PMCID, DOI no
OpenAlex all fields, very large DOI, OpenAlex ID no for small searches; a free key for more
Semantic Scholar all fields, citation links DOI, S2 ID no; a key can be requested
Crossref metadata of every DOI registered there DOI no; add your e-mail to get better service

All five are free to use for this kind of work. Each has a rate limit (for example PubMed: 3 requests per second without a key, 10 with one). Limits and terms change: the agent should read the current documentation page, and so should you.

Web search is fine for exploring; the table comes from the APIs

The agent’s web search

  • quick overview, finding the right words
  • results depend on the search engine and the day
  • returns pages, not records
  • easy to pick up a blog, a news story or a predatory journal

A script that calls the APIs

  • one query per item, written down
  • every hit counted, not only the top ten
  • returns records with IDs
  • reruns next year with the same query

Use web search to learn the vocabulary of a new topic. Build the table from the database records.

Be polite to the APIs, and keep keys out of prompts and git

Worked example: ten genes of the Hedgehog signalling pathway

The non-biology version: eight teaching methods, searched in OpenAlex

The set: flipped classroom, peer instruction, retrieval practice, spaced practice, worked examples, problem-based learning, team-based learning, think-pair-share.

  • The question: what evidence is there that each method improves learning in higher education?
  • Databases: OpenAlex for search, Crossref to check DOIs. PubMed covers little of education research.
  • Identifiers: DOI only. No PMIDs.
  • Evidence types: meta-analysis, randomised trial, quasi-experiment, survey, case report from one course.
  • Watch out for: method names that are also everyday words (“worked examples”, “spaced”), and many small single-course reports.

Gene symbols are ambiguous, so the query must handle it

Step 2: the prompt asks for a script, raw downloads and a log

Read search-plan.md. Write a Python script scripts/search.py that runs
the PubMed query in the plan for each of the ten genes, using the NCBI
E-utilities API. Check the current E-utilities documentation first.

- stay under 3 requests per second; set tool and email (read the email
  from the file .env, which is already listed in .gitignore)
- save every raw response under raw/pubmed/<today's date>/, one file per
  gene, plus the abstracts of the top 20 records per gene
- write raw/pubmed/<today's date>/log.txt: query, number of hits and
  number saved for each gene
- never edit files in raw/ after they are written

Do not add any paper from memory. Every record must come from the API.
Show me the log when done.

The agent writes the script, runs it and reports what it found

Raw downloads are kept and never edited

Step 3: each claim comes with the words that support it

Evidence types tell a reader how much a claim can carry

Evidence type Example What it can support
review a narrative review of GLI proteins what the field believes; not new evidence
human genetics variants found in patients with a syndrome a link in people
human tissue or cohort expression in tumour samples and survival association, not cause
animal model knock-out mouse with a bone defect cause, in that animal
cell experiment knock-down in a cell line mechanism, in that system
computational database or network analysis a hypothesis

Agree the categories with the agent before it fills the column. Then check a few: the agent guesses this from the abstract.

The prompt for the table forbids claims without a quote

Build results/literature_table.csv from the saved records in raw/ only.
Columns: gene, claim, pmid, doi, year, title, journal, evidence_type, quote.

- at most 4 papers per gene, following the rules in search-plan.md
- claim: one sentence, no stronger than the abstract (keep "associated",
  "may", "in mice")
- quote: the sentence(s) from the abstract that support the claim,
  copied exactly, character for character
- evidence_type: one of review, human genetics, human tissue or cohort,
  animal model, cell experiment, computational
- pmid, doi, year, title, journal: copied from the record, never typed
If no abstract supports a useful claim, leave the gene with fewer rows
and say so. List every row you were unsure about.

Verification has five layers, and a script can do three of them

The verification script resolves every ID and compares titles

A real quote can still carry a wrong claim

Read a random sample yourself, and act on what you find

Retracted papers and preprints need a flag

  • Retractions. PubMed marks retracted papers with the publication type Retracted Publication, and the retraction notice as Retraction of Publication. The verification script should flag both.
  • Corrections and expressions of concern are linked from the PubMed record. Worth a look for any paper the table leans on.
  • Preprints (bioRxiv, medRxiv, and in Europe PMC and OpenAlex) are not peer-reviewed. Mark them in their own column, or leave them out by rule in the search plan.
  • Predatory journals turn up in OpenAlex and web search more than in PubMed. If you do not know a journal, look it up before you cite it.

The agent can check flags in the records. Whether a journal is trustworthy is your call.

Step 5: BibTeX for writing, Zotero for keeping

The teaching-methods version: same steps, other database, other evidence

Step Hedgehog genes Teaching methods
Plan one query per gene, symbol and full name one query per method, with synonyms (“flipped classroom” OR “inverted classroom”) and “higher education”
Search PubMed E-utilities OpenAlex works search
Raw raw/pubmed/<date>/ raw/openalex/<date>/
Abstracts in the PubMed record in OpenAlex for many, not all papers; the rest have none
Identifier PMID and DOI DOI (check it at Crossref)
Evidence types review, human genetics, … meta-analysis, randomised trial, quasi-experiment, survey, single-course report
Typical trap symbol clash (SMO) everyday words, single-course reports presented as general findings

Connectors and skills can do the searching later

  • An MCP connector gives the agent a ready-made tool, for example “search PubMed”, without a script.
  • A skill stores your search-and-verify workflow, so the next gene set takes one sentence.
  • Both come in Making the agent yours (Part 5).
  • They change how the agent searches, not whether you check. The verification script and the random sample stay.

Today we use scripts, because a script shows every step and leaves a record you can read and rerun.

Your session will look different, and so will the database next month

  • The agent may write the script in Python or R, name things differently, choose other papers.
  • The same query gives more hits next month: databases grow every day.
  • “Reproducible” here means: the query, the date, the raw records and the scripts are saved, so anyone can see what you did and rerun it.
  • Compare your table with a neighbour’s: overlapping papers, different claims? That is a good discussion, not an error.

This is a structured search, not a systematic review

This unit A systematic review
Protocol search-plan.md registered in advance (e.g. PROSPERO)
Databases one or two several, chosen for coverage
Screening agent drafts, you check a sample two people independently, every record
Reporting README and method lines on the page PRISMA flow diagram and checklist
Good for an overview, a grant background, a teaching page clinical guidance, a publishable review

The agent can help with a systematic review, but the rules of that method still apply.

Where this goes wrong

  • Papers from memory. One famous paper “added for completeness” without a database record. Forbid it; the verification script finds it.
  • Real ID, wrong paper. The ID exists, the title does not match. Only a title check catches it.
  • Overstated claims. “Associated” becomes “causes”; “in mice” disappears. Compare claim with quote.
  • Abstract ≠ paper. Abstracts oversell. Read the sample in full when you can.
  • Bad query. Symbol clashes, missing synonyms, a too-narrow filter. Read the hit counts.
  • Silent gaps. A gene with no rows, not reported. Count rows per item.
  • Keys in the wrong place. In the prompt, in the script, on GitHub.
  • Trusting the agent’s own check. “All references verified” is a claim. Read the report and the sample yourself.

Summary

Concept Key fact
Look up, do not remember every row comes from a database record, via a script
API a web address that returns data for programs; PubMed, Europe PMC, OpenAlex, Semantic Scholar, Crossref are free
Politeness and keys respect rate limits; keys in .env, never in prompts, scripts or git
Search plan question, queries (symbol and full name), limits, rules, date, written first
Raw folder what the database said that day; never edited

Summary (continued)

Concept Key fact
Claim + quote the quote is copied exactly, so a script can find it
Evidence type a fixed list; tells the reader how much a claim can carry
Verification script: IDs resolve, titles match, quotes found, retractions flagged; you: claims vs quotes, random sample
Export BibTeX from the DOIs; Zotero by import or by identifier
Publish the table on your page, a link per row, method and AI use stated

Next (Extracting data from PDFs): from abstracts to full text: pull one number out of the open-access papers you just found, with the page it came from, and check it with a second agent.