# Rscholar
Rscholar 是一个基于 Rust 的学术文献检索服务,支持异步任务执行、多源检索、元数据增强、期刊指标过滤,以及 CSV/BibTeX 导出。
本文档已按当前代码实现更新。
openalexsemanticscholararxivpubmedbiorxivmedrxivPOST /tasks -> 轮询 -> 下载sciif、jci、scicontent_help 存在时可启用 LLM 相关阶段results.csv/tasks/{id}/bibtex)source_include 中有未知 source 会直接报错enable_llm_filter 已移除content_help)output/{timestamp}_{keyword}Rscholar server --port 3000 --serve-static front/distRscholar search ...Linux/macOS:
./start.sh
Windows PowerShell:
.\start.ps1
脚本会依次执行:
npm ci/npm install)npm run build)cargo build --release)默认地址:http://localhost:3000
公开接口:
GET /healthPOST /tasksGET /tasks/{id}GET /tasks/{id}/downloadGET /tasks/{id}/bibtex管理接口:
/api/v1/admin/*X-API-Key(必须是管理员 key)完整接口说明见 docs/API.md 与 docs/API_zh.md。
POST /tasks 请求字段当前支持字段:
keyword(必填)yloenable_crossrefsciifjciscillm_strict_filtercontent_helpsource_includesource_exclude注意:
easyscholar.keyssource_include/source_exclude 大小写不敏感openalex、semanticscholar、arxiv、pubmed、biorxiv、medrxivsciif/jci/sci,预印本豁免)content_help 非空时)src/
cli/ CLI 命令(search / server / init-admin)
db/ SQLite schema + CRUD(tasks/keys/cache/analytics)
llm/ LLM provider、关键词扩展、关键词翻译
ranking/ EasyScholar key pool + ranking service scheduler
server/ HTTP API(routes/handlers/pipeline/middleware/admin)
sources/ openalex/semanticscholar/arxiv/pubmed/xrxiv/crossref
error.rs 统一错误类型
traffic.rs 流量统计
unified.rs 统一输出结构(CLI 路径)
front/ Vite 前端
docs/ API 与架构文档
tests/ 集成与在线测试
主配置文件:config.toml
主要章节:
[server] 地址与端口[easyscholar] ranking API keys[ranking] 调度/租约/key 健康参数[llm] provider 配置与优先级[search] 默认 ylo、source 限制、默认 source[search.arxiv]、[search.pubmed]、[search.xrxiv] 子配置首次初始化管理员 key:
cargo run -- init-admin --name Admin
管理接口调用时加请求头:
X-API-Key: <your-admin-key>
data/rscholar.db)output/{timestamp}_{sanitized_keyword}/results.csvX-API-Key 认证docs/API.mddocs/API_zh.mddocs/ARCHITECTURE.md$ claude mcp add rscholar \
-- python -m otcore.mcp_server <graph>