Research lit

From FOURTEEN1416/academic-agent-toolkit · View interactive version

Research lit is an AI agent skill from the GitHub repository FOURTEEN1416/academic-agent-toolkit. Search and analyze research papers, find related work, summarize key ideas. Use when user says ”find papers”, ”related work”, or ”literature search”.

How to use this skill

Skill file

Research Literature Review

使用当前执行会话完成本步;路径按步骤合同,运行清单和证据由程序生成,模型负责实质成果。

Research topic: $ARGUMENTS

来源与执行

搜索、读取和来源核验是领域工作;通过实际可用的工具执行并保留来源信息。进度直接向用户说明,不额外启动shell打印心跳。超时或来源缺席按实际错误处理,禁止把缺少输出猜测为外部运行时强制终止,也不能把失败搜索记录为成功。

Constants

1. papers/ in the current project directory

2. literature/ in the current project directory

3. Custom path specified by user in AGENTS.md under ## Paper Library

💡 Overrides:

- /research-lit "topic" — paper library: ~/my_papers/ — custom local PDF path

- /research-lit "topic" — sources: zotero, local — only search Zotero + local PDFs

- /research-lit "topic" — sources: zotero — only search Zotero

- /research-lit "topic" — sources: web — only search the web (skip all local)

- /research-lit "topic" — arxiv download: true — download top relevant arXiv PDFs

- /research-lit "topic" — arxiv download: true, max download: 10 — download up to 10 PDFs

Data Sources

This skill checks multiple sources in priority order. All are optional — if a source is not configured or not requested, skip it silently.

Source Selection

Parse $ARGUMENTS for a — sources: directive:

Examples:

/research-lit "diffusion models"                        → all (default)
/research-lit "diffusion models" — sources: all         → all
/research-lit "diffusion models" — sources: zotero      → Zotero only
/research-lit "diffusion models" — sources: zotero, web → Zotero + web
/research-lit "diffusion models" — sources: local       → local PDFs only
/research-lit "topic" — sources: obsidian, local, web   → skip Zotero

Source Table

| Priority | Source | ID | How to detect | What it provides |

|----------|--------|----|---------------|-----------------|

| 1 | Zotero (via MCP) | zotero | Try calling any mcp__zotero__* tool — if unavailable, skip | Collections, tags, annotations, PDF highlights, BibTeX, semantic search |

| 2 | Obsidian (via MCP) | obsidian | Try calling any mcp__obsidian-vault__* tool — if unavailable, skip | Research notes, paper summaries, tagged references, wikilinks |

| 3 | Local PDFs | local | Glob: papers/**/*.pdf, literature/**/*.pdf | Raw PDF content (first 3 pages) |

| 4 | Web search | web | Always available (WebSearch) | arXiv, Semantic Scholar, Google Scholar |

Graceful degradation: If no MCP servers are configured, the skill works exactly as before (local PDFs + web search). Zotero and Obsidian are pure additions.

Workflow

Step 0a: Search Zotero Library (if available)

Skip this step entirely if Zotero MCP is not configured.

Try calling a Zotero MCP tool (e.g., search). If it succeeds:

  1. Search by topic: Use the Zotero search tool to find papers matching the research topic
  2. Read collections: Check if the user has a relevant collection/folder for this topic
  3. Extract annotations: For highly relevant papers, pull PDF highlights and notes — these represent what the user found important
  4. Export BibTeX: Get citation data for relevant papers (useful for /paper-write later)
  5. Compile results: For each relevant Zotero entry, extract:

📚 Zotero annotations are gold — they show what the user personally highlighted as important, which is far more valuable than generic summaries.

Step 0b: Search Obsidian Vault (if available)

Skip this step entirely if Obsidian MCP is not configured.

Try calling an Obsidian MCP tool (e.g., search). If it succeeds:

  1. Search vault: Search for notes related to the research topic
  2. Check tags: Look for notes tagged with relevant topics (e.g., #diffusion-models, #paper-review)
  3. Read research notes: For relevant notes, extract the user's own summaries and insights
  4. Follow links: If notes link to other relevant notes (wikilinks), follow them for additional context
  5. Compile results: For each relevant note:

📝 Obsidian notes represent the user's processed understanding — more valuable than raw paper content for understanding their perspective.

Step 0c: Scan Local Paper Library

Before searching online, check if the user already has relevant papers locally:

  1. Locate library: Check PAPER_LIBRARY paths for PDF files

```

Glob: papers//.pdf, literature//.pdf

```

  1. De-duplicate against Zotero: If Step 0a found papers, skip any local PDFs already covered by Zotero results (match by filename or title).
  1. Filter by relevance: Match filenames and first-page content against the research topic. Skip clearly unrelated papers.
  1. Summarize relevant papers: For each relevant local PDF (up to MAX_LOCAL_PAPERS):
  1. Build local knowledge base: Compile summaries into a "papers you already have" section. This becomes the starting point — external search fills the gaps.

📚 If no local papers are found, skip to Step 1. If the user has a comprehensive local collection, the external search can be more targeted (focus on what's missing).

Step 1: Search (external)

⛔ 检索通道按序尝试($SCHOLAR_SCRIPT 为可选加速通道,本仓默认不注入该变量):

  1. 若环境已注入 $SCHOLAR_SCRIPT(自动调用 AMiner + Semantic Scholar + DBLP + CrossRef,返回真实论文);
  2. $SCHOLAR_SCRIPT 未设置或调用失败时(本仓默认情形),回退仓内检索器 academic-toolkit/tools/scholar_fetch.py(同一套 bibtex 子命令,内置 AMiner + Semantic Scholar + CrossRef + DBLP 四级 fallback);
  3. 仓内工具也不可用时,用执行侧 WebSearch / arXiv API 补充检索。
PYTHON=""; for _c in python python3; do if $_c -c "import sys" >/dev/null 2>&1; then PYTHON="$_c"; break; fi; done; [ -z "$PYTHON" ] && PYTHON=python
if [ -n "$SCHOLAR_SCRIPT" ]; then
  # 首选:宿主注入的检索脚本(推荐,一次调用完成所有工作)
  $PYTHON "$SCHOLAR_SCRIPT" bibtex "RESEARCH_TOPIC_KEYWORDS" --max 10
  # 中文主题同样支持(AMiner 自动返回中文标题 + 作者 + 年份 + DOI)
  $PYTHON "$SCHOLAR_SCRIPT" bibtex "中文研究主题" --max 10
else
  # 本仓默认:$SCHOLAR_SCRIPT 未设置,回退仓内检索器
  $PYTHON academic-toolkit/tools/scholar_fetch.py bibtex "RESEARCH_TOPIC_KEYWORDS" --max 10
  $PYTHON academic-toolkit/tools/scholar_fetch.py bibtex "中文研究主题" --max 10
fi

Result quality check (mandatory):

  1. Inspect match_label: "good" → use directly; "partial" → verify title actually matches your topic; "low" → likely wrong paper, retry with better keywords or fall back to WebSearch.
  2. match_score < 0.3 is unreliable; do not blindly trust.
  3. bibtex_source="auto" entries need DOI verification before being used.

补充搜索:如果以上检索结果不足或大部分 match_label="low",再用以下方式补充:

arXiv API search (always runs, no download by default):

Locate the fetch script and search arXiv directly:

# Try to find arxiv_fetch.py (repo-root relative first, then CWD-relative)
SCRIPT=$(find academic-toolkit/tools tools/ -name "arxiv_fetch.py" 2>/dev/null | head -1)

# Search arXiv API for structured results (title, abstract, authors, categories)
# Use python3 or python depending on what's available
PYTHON=""; for _c in python python3; do if $_c -c "import sys" >/dev/null 2>&1; then PYTHON="$_c"; break; fi; done; [ -z "$PYTHON" ] && PYTHON=python
[ -n "$SCRIPT" ] && $PYTHON "$SCRIPT" search "QUERY" --max 10

If arxiv_fetch.py is not found, fall back to WebSearch for arXiv (same as before).

The arXiv API returns structured metadata (title, abstract, full author list, categories, dates) — richer than WebSearch snippets. Merge these results with WebSearch findings and de-duplicate.

Optional PDF download (only when ARXIV_DOWNLOAD = true):

After all sources are searched and papers are ranked by relevance:

# Download top N most relevant arXiv papers
$PYTHON "$SCRIPT" download ARXIV_ID --dir papers/

Step 2: Analyze Each Paper

For each relevant paper (from all sources), extract:

Evidence discipline: extract only from evidence actually read — an abstract, source excerpt, local PDF or existing note. A paper with only a title and no readable evidence is recorded as UNPROCESSABLE_NO_LOCAL_EVIDENCE and stays explicitly uncovered: do not infer its method or results from the title, and do not silently drop it from the analyzed set. When coverage falls short, record planned/completed/failed/uncovered papers truthfully in the report; absence of analysis is never evidence of irrelevance.

Step 3: Synthesize

Step 4: Output

Write the current step's declared output files. The standard survey is literature_review.md plus references.bib. When the action also declares LIT_EVIDENCE.json and search_evidence/, record the actual query/source/retrieval outcome and save source responses or excerpts with provenance there; never fabricate records to satisfy the contract. Present the survey as a structured literature table:

| Paper | Venue | Method | Key Result | Relevance to Us | Source |
|-------|-------|--------|------------|-----------------|--------|

Plus a narrative summary of the landscape (3-5 paragraphs).

If Zotero BibTeX was exported, include a references.bib snippet for direct use in paper writing. Also save a standalone references.bib file in the project root with all collected BibTeX entries.

Step 5: Save (if requested)

Key Rules

产出结构、存在性和最低完整性由 finish 按模板中的 output_contract 自动核验;修复返回的具体问题,不复制执行验证脚本。

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.