论文
  
\[!注意\] 即使是最好的分析PDF提取方法也会破坏LaTeX和技术论文的表格。该项目通过以下方式使用基于视觉模型的OCR 数据实验室 (需要API键)生成干净的markdown并保留数学和表。提取的结果(JSON、markdown、图像)同步回您的Zotero库。你也可以 本地运行标记.
安装
从下载预构建的二进制文件 发布,或从源代码构建:
cargo install --path crates/papers-cli命令
| 命令 | 描述 |
|---|---|
work, author, source, institution, topic, publisher, funder, domain, field, subfield | 查询OpenAlex目录 |
zotero | 访问您的Zotero库 |
rag | 本地索引论文的语义搜索 |
selection | 管理指定的论文组 |
config | 配置设置(例如嵌入模型) |
mcp | MCP服务器集成 |
命令接受 --json 用于机器可读输出。
MCP服务器
将CLI命令作为LLM的MCP工具公开。目前仅支持--stdio。
克劳德代码:
claude mcp add papers -- papers mcp start --stdio.mcp.json (克劳德桌面、光标等):
{
"mcpServers": {
"papers": {
"command": "papers",
"args": ["mcp", "start", "--stdio"]
}
}
}OpenAlex
OpenAlex在没有身份验证的情况下工作,但速度有限。集 OPENALEX_KEY 更高的利率限制(openalex.org/定价).
搜索和筛选
papers work list -s "attention is all you need" -n 3
papers work list --author "Yann LeCun" --year 2020-2024 --open
papers work list --topic "deep learning" --citations ">100" --sort cited_by_count:desc
papers author list --institution harvard --country US --h-index ">50"筛选器别名 (--author, --year, --topic, --citations等)自动将名称解析为OpenAlex ID。您也可以使用原始 OpenAlex过滤器语法 通过 --filter.
按ID或搜索获取
这 get 子命令接受OpenAlex ID、DOI、ORCID、ROR ID、PubMed ID、ISSN或纯搜索查询:
papers work get "attention is all you need"
papers work get https://doi.org/10.7717/peerj.4375
papers author get "yoshua bengio"
papers institution get "MIT"佐特罗
需要 ZOTERO_USER_ID 和 ZOTERO_API_KEY 环境变量(zotero.org/settings/keys).
papers zotero work list --tag Starred --sort dateModified --direction desc
papers zotero work list --search "rendering" --type conferencePaper -n 5
papers zotero work annotations
papers zotero attachment file --output paper.pdf
papers zotero collection list --top实体: work, extract, attachment, annotation, note, collection, tag, search, group, setting, deleted, permission.
数据库
Marker OCR Structural Chunking Embed (Gemma 300M)
┌─────────┐
┌──────────┐ ┌─────────────────────┐ ┌───────────┐ │ │
│ marker ├───►│ JSON block tree ├───►│ 768-d f32 ├───────────►│ LanceDB │
│ OCR │ │ per paragraph, │ │ vectors │ │ │
│ │ │ equation, table, │ └───────────┘ │ chunks │
└──────────┘ │ figure, list │ ▲ │ figures │
.md .json └─────────────────────┘ │ │ │
┌──────┴──────┐ └────┬────┘
│ embed query │───── ANN ──────┘
└─────────────┘PDF提取使用 数据实验室标记 对于视觉模型OCR,它返回一个结构化的JSON块树和markdown。每个块(段落、方程式、列表、表格、图形)都变成一个块——没有固定大小的分割或重叠。块和图形标题嵌入到768-d矢量中,并存储在LanceDB中。在查询时,查询嵌入了相同的模型,并通过近似最近邻(ANN)搜索进行匹配。每个结果都包括其周围上下文的相邻块的截断预览。
papers db work add # Index a single paper
papers db work add --all # Index all cached extractions
papers db chunk search "differentiable rendering" -n 5
papers db figure search "neural radiance field architecture"
papers db chunk get
papers db section get
--chapter-idx 1 --section-idx 2
papers db chapter get
--chapter-idx 1
papers db figure get
papers db work outline
papers db work list [--selection ]
papers db tag list
在本地使用标记
~/.cache/papers/datalab//
├── .md
├── .json # optional
└── images/ # optional提取将自动从本地缓存中提取。
筛选器别名
解析为OpenAlex过滤器表达式的简写标志。基于实体的别名接受OpenAlex ID或搜索字符串(按引用计数解析到顶部结果)。
work list
| 标志 | 示例 | 解析为 | |
|---|---|---|---|
--author | "einstein", A5108093963 | authorships.author.id: | |
--topic | "deep learning", T10320 | topics.id: | |
--domain | "physical sciences", 3 | topics.domain.id: | |
--field | "computer science", 17 | topics.field.id: | |
--subfield | "artificial intelligence", 1702 | topics.subfield.id: | |
--publisher | "acm", `"acm\ | ieee"` | primary_location.source.publisher_lineage: |
--source | "nature", S137773608 | primary_location.source.id: | |
--institution | "mit", I136199984 | authorships.institutions.lineage: | |
--year | 2024, >2008, 2008-2024 | publication_year: | |
--citations | ">100", "10-50" | cited_by_count: | |
--country | US, GB | authorships.countries: | |
--continent | europe, asia | authorships.continents: | |
--type | article, preprint | type: | |
--open | *(旗帜)* | is_oa:true |
author list
| 标志 | 示例 |
|---|---|
--institution | "harvard", I136199984 |
--country | US, GB |
--continent | europe, asia |
--citations | ">1000", "100-500" |
--works | ">500", "100-200" |
--h-index | ">50", "10-20" |
