literature-review-agent
Skill2 starsChanged 7 months agoMITView on GitHub
Step 3 of the PaperOrchestra pipeline (arXiv:2604.05018). Execute the literature search strategy from outline.json — discover candidate papers via web search, verify them through Semantic Scholar (Levenshtein > 70 fuzzy title match, temporal cutoff, dedup by paperId), build a BibTeX file, and draft Introduction + Related Work using ≥90% of the verified pool. Runs in parallel with the plotting-agent. TRIGGER when the orchestrator delegates Step 3 or when the user asks to "find citations for my paper", "draft the related work", or "build the bibliography".
- Reads credentials
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- 2023Anita/clinical-ai-agent-skillstheir own version, first seen May 22, 2026
- Ar9av/PaperOrchestraedited, first seen Apr 17, 2026
- Aukexecutivedepartment5152/PaperOrchestraword for word, first seen Apr 17, 2026
Other versions3 projects use a version of this.
Word for word · 1
- Aukexecutivedepartment5152/PaperOrchestra★ 2100% same
Edited · 1
- Ar9av/PaperOrchestra★ 67476% same
Wrote their own version · 1
- 2023Anita/clinical-ai-agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository84 other files it gives its agents.
- skills/rules/common/agents.mdAGENTS.md
- skills/rules/zh/agents.mdAGENTS.md
- ablation-plannerSkill
- alphaxivSkill
- analyze-resultsSkill
- arxivSkill
- auto-paper-improvement-loopSkill
- auto-review-loop-llmSkill
- auto-review-loop-minimaxSkill
- auto-review-loopSkill
- citation-auditSkill
- claims-draftingSkill
- comm-lit-review-claude-singleSkill
- deepxivSkill
- dse-loopSkill
- embodiment-descriptionSkill
- exa-searchSkill
- experiment-auditSkill
- experiment-bridgeSkill
- experiment-planSkill
- experiment-queueSkill
- feishu-notifySkill
- figure-descriptionSkill
- figure-specSkill
- formula-derivationSkill
- gemini-searchSkill
- grant-proposalSkill
- idea-creatorSkill
- idea-discovery-robotSkill
- idea-discoverySkill
- invention-structuringSkill
- jurisdiction-formatSkill
- kill-argumentSkill
- mermaid-diagramSkill
- meta-optimizeSkill
- monitor-experimentSkill
- novelty-checkSkill
- openalexSkill
- overleaf-syncSkill
- paper-claim-auditSkill
- paper-compileSkill
- paper-figureSkill
- paper-illustration-image2Skill
- paper-illustrationSkill
- paper-planSkill
- paper-posterSkill
- paper-slidesSkill
- paper-talkSkill
- paper-writeSkill
- paper-writingSkill
- patent-novelty-checkSkill
- patent-pipelineSkill
- patent-reviewSkill
- pixel-artSkill
- prior-art-searchSkill
- proof-checkerSkill
- proof-writerSkill
- qzcliSkill
- rebuttalSkill
- research-litSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 7 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 96
If your host supports parallel sub-tasks, fire up to 10 concurrent search queries.
- Very specific: line 101
If your host has no native web search, OR you want a research-paper-focused backend with better signal-to-noise, you can use Exa via the …
- Very specific: line 137
Use workspace/deduped_candidates.json as input to Phase 2.
- Very specific: line 154
Preferred: use the bundled scripts/s2_search.py helper — it handles auth, retries, and 429 back-off automatically:
- Distinctive: line 164
Check whether the key is configured before starting Phase 2:
- Distinctive: line 170
Fallback: if you prefer your host's URL fetch tool, GET:
- Very specific: line 174
Add header x-api-key: <SEMANTIC_SCHOLAR_API_KEY> if the env var is set.
- Distinctive: line 204
If both checks pass AND the abstract is non-empty, append the paper's full S2 metadata to the verified pool.
- Distinctive: line 209
After all candidates are verified:
- Very specific: line 286
Run your LLM with the combined prompt against template.tex.
- Distinctive: line 301
If the gate fails, re-prompt the writing step explicitly listing the missing keys and asking the agent to integrate them where contextually …
- Very specific: line 309
Cite ONLY from
collected_papers: Never invent BibTeX keys, never reference papers not in the pool. - Very specific: line 313
TIMELINE RULE: Do not treat any papers published after cutoff_date as prior baselines to beat.
- Very specific: line 315
EVALUATION RULE: Do not claim our method beats / achieves SOTA over a specific cited paper UNLESS that paper is explicitly evaluated …
- Very specific: line 324
Do not change \usepackage[capitalize]{cleveref} to cleverref (there is no cleverref.sty).
- Distinctive: line 329
If your host has no web search tool, switch to degraded mode:
- Very specific: line 331
If the user has placed a pre-built workspace/inputs/refs.bib in the workspace, load it directly into workspace/refs.bib and skip Phase 1 …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Literature Review Agent (Step 3)
Faithful implementation of the Hybrid Literature Agent from PaperOrchestra (Song et al., 2026, arXiv:2604.05018, §4 Step 3, App. D.3, App. F.1 p.46).
Cost: ~20–30 LLM calls. This is one of the two longest steps (the other is plotting). Wall-time floor is set by Semantic Scholar's 1 QPS verification limit.
Inputs
workspace/outline.json— specificallyintro_related_work_planwith the Introduction search directions and the 2-4 Related Work methodology clustersworkspace/inputs/conference_guidelines.md— used to derivecutoff_dateworkspace/inputs/idea.md,workspace/inputs/experimental_log.md— for framing the Intro and grounding the Related Work positioning
Outputs
workspace/citation_pool.json— verified Semantic Scholar metadata for every paper that survived verificationworkspace/refs.bib— BibTeX file generated from the verified poolworkspace/drafts/intro_relwork.tex— drafted Introduction and Related Work sections, written into the template, with the rest of the template preserved verbatim
Two-phase pipeline (App. D.3)
PHASE 1 — Parallel Candidate Discovery
For each search direction in introduction_strategy.search_directions:
For each limitation_search_query in each related_work cluster:
- Use the host's web search tool to discover up to ~10 candidate papers.
- Run up to 10 discovery queries in parallel (host-permitting).
- Collect (title, snippet, url) tuples — no verification yet.
→ PRE-DEDUP before Phase 2 (see Step 1.5 below)
PHASE 2 — Sequential Citation Verification (1 QPS, with cache)
For each candidate (after pre-dedup), sequentially:
0. Check s2_cache.json first (scripts/s2_cache.py --check).
If HIT: use cached response, skip live S2 call. No throttle needed.
If MISS: proceed with live request below.
1. Query Semantic Scholar by title:
GET https://api.semanticscholar.org/graph/v1/paper/search?query=<title>
&fields=title,abstract,year,authors,venue,externalIds&limit=5
(Public endpoint, no key. Throttle to 1 QPS for live requests only.)
2. Store the S2 response in cache: s2_cache.py --store.
3. Pick the top hit. Check Levenshtein title ratio against the original
candidate title. If ratio < 70: discard.
4. Bonus: if year and venue exactly align with hints, add a +5 point
match-quality bonus.
5. Require: abstract is non-empty.
6. Require: paper.year (or month if known) strictly predates cutoff_date.
Months default to day-1: e.g., "October 2024" → 2024-10-01.
7. If all checks pass, add to verified pool.
After all candidates are verified, dedup by Semantic Scholar paperId.The host agent does the LLM/web work; the deterministic helpers in scripts/
do the math.
Step-by-step
0. Derive cutoff_date
Parse conference_guidelines.md for the submission deadline. The paper aligns
research cutoff with venue submission deadline (App. D.1):
| Venue | Cutoff |
| CVPR 2025 | Nov 2024 |
| ICLR 2025 | Oct 2024 |
| Other | One month before the stated submission deadline |
Encode as YYYY-MM-DD. Months default to day-1 (e.g., 2024-10-01).
1. Phase 1: Parallel Candidate Discovery
From outline.json:
- All
introduction_strategy.search_directions(3-5 queries) - For each cluster in
related_work_strategy.subsections:- The cluster's
sota_investigation_missionbecomes a search query - All
limitation_search_queries(1-3 each)
- The cluster's
For each query, use your host's web search tool (e.g., WebSearch in
Claude Code, @web in Cursor, the search tool in Antigravity). Collect the
top ~10 candidates per query: title, abstract snippet, source URL.
If your host supports parallel sub-tasks, fire up to 10 concurrent search queries. If not, run sequentially — slower but functionally equivalent.
Optional: Exa as a Phase 1 backend
If your host has no native web search, OR you want a research-paper-focused
backend with better signal-to-noise, you can use Exa via
the bundled scripts/exa_search.py helper. It is opt-in and reads
EXA_API_KEY from the environment — the repo never commits a key.
export EXA_API_KEY="your-key-here" # get one at https://dashboard.exa.ai/
python skills/literature-review-agent/scripts/exa_search.py \
--query "Sparse attention long context transformers" \
--num-results 15 \
--discovered-for "related_work[2.1]"Output is a normalized candidate list ready to merge into
raw_candidates.json. Phase 2 verification (Semantic Scholar fuzzy match,
cutoff, dedup) is unchanged. See references/exa-search-cookbook.md for
the full recipe, query patterns, cost estimates, and security notes.
Combine all discovered candidates into a single working list. Tag each with the originating query ID so you can later attribute it to "intro" vs "related_work[i]".
1.5. Pre-dedup before Phase 2
Always run this before starting Phase 2. Multiple search queries routinely return the same papers (e.g., "Attention is All You Need" appears in almost every NLP discovery query). Verifying duplicates wastes 30-40% of S2 quota at 1 QPS.
python skills/literature-review-agent/scripts/pre_dedup_candidates.py \
--in workspace/raw_candidates.json \
--out workspace/deduped_candidates.json
# Prints: "150 candidates → 97 unique (53 duplicates removed)"Use workspace/deduped_candidates.json as input to Phase 2.
2. Phase 2: Sequential Verification via Semantic Scholar (with cache)
For each candidate in deduped_candidates.json, in sequential order:
Step A — check cache first (no S2 call, no throttle needed):
python skills/literature-review-agent/scripts/s2_cache.py \
--cache workspace/cache/s2_cache.json \
--check "<candidate title>"
# exit 0 + prints JSON → use cached response, skip Step B
# exit 1 → proceed to Step BStep B — live S2 request (cache MISS only, throttle to 1 QPS):
Preferred: use the bundled scripts/s2_search.py helper — it handles
auth, retries, and 429 back-off automatically:
python skills/literature-review-agent/scripts/s2_search.py \
--query "<URL-decoded candidate title>" --limit 5
# If SEMANTIC_SCHOLAR_API_KEY is set the key is forwarded automatically.
# If not, the public unauthenticated endpoint is used (≤1 QPS, still works).Check whether the key is configured before starting Phase 2:
python skills/literature-review-agent/scripts/s2_search.py --check-keyFallback: if you prefer your host's URL fetch tool, GET:
https://api.semanticscholar.org/graph/v1/paper/search?query=<URL-encoded title>&limit=5&fields=title,abstract,year,authors,venue,externalIdsAdd header x-api-key: <SEMANTIC_SCHOLAR_API_KEY> if the env var is set.
Be polite: ≤1 request per second for live requests. Cache hits are free.
Step C — store in cache (after every successful live request):
python skills/literature-review-agent/scripts/s2_cache.py \
--cache workspace/cache/s2_cache.json \
--store "<candidate title>" \
--response '<full S2 JSON response>'For the top hit:
python skills/literature-review-agent/scripts/levenshtein_match.py \
--candidate "Original candidate title" \
--found "S2 returned title"
# prints integer 0-100. Discard if < 70.Then check the temporal cutoff:
python skills/literature-review-agent/scripts/check_cutoff.py \
--paper-year 2024 \
--paper-month 9 \
--cutoff 2024-10-01
# exit 0 if strictly predates, exit 1 if notIf both checks pass AND the abstract is non-empty, append the paper's full S2 metadata to the verified pool.
3. Dedup and assemble the pool
After all candidates are verified:
python skills/literature-review-agent/scripts/dedupe_by_id.py \
--in raw_pool.json \
--out workspace/citation_pool.jsonThe dedupe script keys on paperId (Semantic Scholar's internal unique ID),
falling back to externalIds.DOI, then externalIds.ArXiv, then a
normalized title.
The script also computes and writes min_cite_paper_count =
floor(0.9 * len(papers)) — the minimum number of papers the writing step
must cite (the paper's ≥90% integration rule, App. D.3).
Immediately after dedupe_by_id.py, validate and auto-fix the pool schema:
python skills/literature-review-agent/scripts/validate_pool.py \
--pool workspace/citation_pool.json --fix
# Catches and fixes authors-as-strings, reports missing required fields.
# Must pass before proceeding to Step 4.4. Build the BibTeX file
python skills/literature-review-agent/scripts/bibtex_format.py \
--pool workspace/citation_pool.json \
--out workspace/refs.bibThe script generates citation keys deterministically from `firstauthor + year
- first significant word of title
(e.g.,vaswani2017attention). It writes out only@article/@inproceedings/@miscentries — never invents fields. It also writes the canonicalbibtex_keyback into each paper record incitation_pool.json`.
Immediately after bibtex_format.py, sync keys in intro_relwork.tex:
python skills/literature-review-agent/scripts/sync_keys.py \
--pool workspace/citation_pool.json \
--tex workspace/drafts/intro_relwork.tex \
--inplace
# Replaces every \cite{agent_key} with \cite{canonical_bibtex_key}.
# Eliminates citation_coverage gate failures caused by key mismatch.These two steps replace the manual Python snippets that were previously required. The pipeline is now:
dedupe_by_id → validate_pool --fix → bibtex_format → sync_keys5. Draft Introduction + Related Work
This is where you (the host agent) actually write text. Load the
verbatim Literature Review Agent prompt at references/prompt.md.
Substitute the template placeholders:
| Placeholder | Value |
intro_related_work_plan | full JSON object from outline.json |
project_idea | contents of idea.md |
project_experimental_log | contents of experimental_log.md |
citation_checklist | the BibTeX keys from refs.bib |
collected_papers | list of {key, title, abstract} from citation_pool.json |
paper_count | len(citation_pool.papers) |
min_cite_paper_count | from citation_pool.json |
cutoff_date | the date you derived in Step 0 |
Also prepend the Anti-Leakage Prompt from
../paper-orchestra/references/anti-leakage-prompt.md.
Run your LLM with the combined prompt against template.tex. The agent's
job is to fill in the empty Introduction and Related Work sections of the
template and leave everything else untouched. Output: the full
template.tex with those two sections filled. Save to
workspace/drafts/intro_relwork.tex.
6. Verify ≥90% citation coverage
python skills/literature-review-agent/scripts/citation_coverage.py \
--tex workspace/drafts/intro_relwork.tex \
--pool workspace/citation_pool.json
# exit 0 if ≥90% of pool is cited; exit 1 otherwiseIf the gate fails, re-prompt the writing step explicitly listing the missing keys and asking the agent to integrate them where contextually appropriate.
Critical rules from the prompt
These are excerpted from references/prompt.md. The host agent MUST honor
them on the writing call:
- Cite ONLY from
collected_papers. Never invent BibTeX keys, never reference papers not in the pool. - Cite at least
min_cite_paper_countof them in Intro + Related Work combined. - TIMELINE RULE: Do not treat any papers published after
cutoff_dateas prior baselines to beat. They are concurrent work only. - EVALUATION RULE: Do not claim our method beats / achieves SOTA over a
specific cited paper UNLESS that paper is explicitly evaluated against in
experimental_log.md. Frame other recent papers strictly as concurrent, orthogonal, or conceptual work. - Output format: return the full code for the updated
template.tex, with the two empty sections (Introduction and Related Work) filled in, and all the other code (packages, styles, other sections) identical to the original template.tex. - Wrap output in
```latex ... ```fences. - Do not change
\usepackage[capitalize]{cleveref}tocleverref(there is nocleverref.sty).
Degraded mode (no web search)
If your host has no web search tool, switch to degraded mode:
- If the user has placed a pre-built
workspace/inputs/refs.bibin the workspace, load it directly intoworkspace/refs.biband skip Phase 1 and Phase 2. - Otherwise, emit
workspace/drafts/intro_relwork.texcontaining the template with two TODO markers in the Intro and Related Work sections, and tell the user the pipeline cannot complete Step 3 without web search.
Resources
references/prompt.md— verbatim Literature Review Agent prompt from App. F.1references/discovery-pipeline.md— Phase 1 + Phase 2 explained in detailreferences/verification-rules.md— Levenshtein cutoff, year alignment, dedupreferences/citation-density-rule.md— the ≥90% integration rulereferences/s2-api-cookbook.md— Semantic Scholar URLs, fields, rate limitsreferences/exa-search-cookbook.md— optional Exa backend for Phase 1 (research-paper-focused web search)scripts/pre_dedup_candidates.py— NEW dedup Phase 1 candidates before Phase 2 (saves 30-40% S2 quota)scripts/s2_cache.py— NEW persistent S2 response cache (eliminates re-verification on re-runs)scripts/validate_pool.py— NEW validate & auto-fix citation_pool.json schema (authors format)scripts/sync_keys.py— NEW sync cite keys in .tex with canonical bibtex_keys after bibtex_format.pyscripts/levenshtein_match.py— fuzzy title match (ratio > 70)scripts/check_cutoff.py— date cmp w/ month → day-1 defaultscripts/dedupe_by_id.py— dedup verified pool by S2 paperIdscripts/bibtex_format.py— build refs.bib from JSON poolscripts/citation_coverage.py— ≥90% citation coverage gatescripts/s2_search.py— NEW Semantic Scholar title-search helper; readsSEMANTIC_SCHOLAR_API_KEYfrom env (optional — falls back to unauthenticated)scripts/exa_search.py— optional Exa Phase 1 backend (readsEXA_API_KEYfrom env)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

