学术论文管理工具

一个从终端搜索、管理和探索学术论文的工具,支持通过OpenAlex查询2.4亿+篇论文,与Zotero库集成,并使用LanceDB构建本地向量索引以进行语义搜索。

  • by mmgeorge
  • Rust
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 mmgeorge/papers

使用说明

论文

从终端搜索、管理和探索学术论文。或者作为一个 主控程序 用法学硕士查询你的论文。通过以下方式查询240M+ OpenAlex,与您的 佐特罗 库,并使用以下命令在您的论文上构建本地向量索引 兰斯数据库 因此,您可以跨部分和图形进行语义搜索。在Windows和macOS上使用DirectML和CoreML加速嵌入。

[!注意] 即使是最好的分析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 <work>
papers zotero attachment file <work> --output paper.pdf
papers zotero collection list --top

实体: work, extract, attachment, annotation, note, collection, tag, search, group, setting, deleted, permission.

数据库

使用以下命令对论文进行局部语义搜索 兰斯数据库 和 镶嵌宝玛300M (通过 快速嵌入 + ONNX运行时).硬件通过DirectML(Windows)和CoreML(macOS)加速。

  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 <work>                                # 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 <chunk_id>
papers db section get <paper_id> --chapter-idx 1 --section-idx 2
papers db chapter get <paper_id> --chapter-idx 1
papers db figure get <figure_id>
papers db work outline <paper_id>
papers db work list [--selection <name>]
papers db tag list

在本地使用标记

对于提取,您可以运行 标记 本地,而不是使用Datalab API,如果您满足 许可证要求。将输出文件放置在缓存目录中:

~/.cache/papers/datalab/<item_key>/
├── <item_key>.md
├── <item_key>.json     # optional
└── images/             # optional

提取将自动从本地缓存中提取。

筛选器别名

解析为OpenAlex过滤器表达式的简写标志。基于实体的别名接受OpenAlex ID或搜索字符串(按引用计数解析到顶部结果)。

work list

标志 示例 解析为
--author "einstein", A5108093963 authorships.author.id:<id>
--topic "deep learning", T10320 topics.id:<id>
--domain "physical sciences", 3 topics.domain.id:<id>
--field "computer science", 17 topics.field.id:<id>
--subfield "artificial intelligence", 1702 topics.subfield.id:<id>
--publisher "acm", "acm|ieee" primary_location.source.publisher_lineage:<id>
--source "nature", S137773608 primary_location.source.id:<id>
--institution "mit", I136199984 authorships.institutions.lineage:<id>
--year 2024, >2008, 2008-2024 publication_year:<value>
--citations ">100", "10-50" cited_by_count:<value>
--country US, GB authorships.countries:<value>
--continent europe, asia authorships.continents:<value>
--type article, preprint type:<value>
--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"