Skip to main content

AI-powered literature reading assistant with multi-agent orchestration and hybrid RAG

Project description

PaperSage

PaperSage 是一个面向论文阅读、证据检索与多 Agent 研究协作的项目式工作台。前端采用独立的 Vite React 应用,FastAPI 提供稳定的 HTTP 边界;文档上传、OCR、Embedding、长期记忆整理均在后台执行,不阻塞会话创建。

核心能力

  • 项目工作台:资料、会话、证据与研究活动统一归属项目。
  • Supervisor/Subagent:Leader 可并行委派 researcher、reviewer、writer,并依据真实 tool call 展示执行状态。
  • 项目级 RAG:完整文档切分后写入 LanceDB,原生 Dense + FTS + RRF 混合召回;找相关资料先从全项目证据检索,不把文件目录注入提示词。
  • 异步文档处理:上传后自动提取、OCR、Embedding 和版本发布,前端立即显示每份文件的真实阶段与进度。
  • 长期记忆与会话命名:每轮结束后异步调用模型整理项目记忆;首个有效回答会异步生成会话标题,不覆盖手动命名。
  • 持久会话:SQLite 保存项目、消息、设置与 ingestion 状态,LangGraph checkpoint 保存 Agent 状态。

技术栈

前端位于 web/:Vite、React、TypeScript、Tailwind CSS、shadcn/ui、Radix UI、TanStack Query、TanStack Router、Zustand、React Hook Form、Zod、Lucide React。

后端位于 api/agent/:FastAPI、LangChain/LangGraph、Deep Agents、SQLite、LanceDB、FastEmbed、RapidOCR、RQ/Redis。

本地开发

要求 Python 3.11+、uv、Node.js 22+ 与 pnpm(通过 Corepack 管理)。

make install-dev      # 安装 Python 依赖
make web-install      # 按 pnpm-lock 安装前端依赖
make run              # 一键启动 API :8000 与 Vite :5173

也可以分别启动:

make api-dev
make web-dev

生产构建与运行:

make web-build
make serve            # FastAPI 在 :8000 托管 web/dist

目录结构

api/                    # HTTP transport、schema 与路由
web/src/
  components/ui/        # shadcn/ui 源码组件
  components/           # 应用壳与领域 UI
  pages/                # 路由页面
  lib/                  # API、Zod schema、Query hooks
  stores/               # Zustand UI 状态
agent/
  domain/               # 领域模型与契约
  application/          # 用例编排
  adapters/             # SQLite、LanceDB、文件与模型适配
  subagent/             # 子 Agent 定义
tests/                  # Python unit / integration / eval
docs/architecture/      # 架构决策与边界

质量门禁

make web-lint
make web-typecheck
make web-test
make web-build
make test-all
make quality-full

配置

复制 .env.example 并在 Web 设置页保存用户级 API Key、模型名称和兼容 Base URL。密钥只由后端读取,API 不返回完整值。

主要运行时变量:

AGENT_LANCEDB_DIR=./.cache/lancedb
LOCAL_RAG_PROJECT_MAX_CHARS=0
LOCAL_RAG_PROJECT_MAX_CHUNKS=0
RAG_INDEX_BATCH_SIZE=256
DOC_PARSE_BACKEND=auto

完整 Web 架构与 API 契约见 docs/architecture/web-application.md

桌面端发布

桌面版把 Vite 前端和 FastAPI 服务一起打包;窗口采用应用内自定义标题栏。开发时执行 make desktop-dev,本机构建执行 make desktop-package-winmake desktop-package-macmake desktop-package-linux;产物在 web/release/。首次构建会收集 OCR 和本地检索依赖,耗时较长。

推送 v* tag 会触发 GitHub Actions 在 Windows、macOS 与 Linux runner 分别构建 NSIS、DMG、AppImage/deb,并统一作为 GitHub Release 附件发布;PR 则只验证前端、Electron 入口与服务资源边界。

正式公开发布前须配置代码签名与 macOS 公证密钥;详见 桌面发布运维说明

公开 Release 同时附带免费 GitHub/Sigstore 构建证明和 SHA256SUMS.txt,用于验证安装包来源与完整性。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paper_sage-1.1.1.tar.gz (222.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paper_sage-1.1.1-py3-none-any.whl (193.9 kB view details)

Uploaded Python 3

File details

Details for the file paper_sage-1.1.1.tar.gz.

File metadata

  • Download URL: paper_sage-1.1.1.tar.gz
  • Upload date:
  • Size: 222.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for paper_sage-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e0a9fafa102fe2d53bb444cb365ef1de5e84f6b817260894dd50360835799249
MD5 58c03aaa5850ba74134da5d74d88ea6b
BLAKE2b-256 38319c316a72af3286910052462930893660c2f150d087708fe44db32bf01a6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_sage-1.1.1.tar.gz:

Publisher: publish.yml on 0verL1nk/PaperSage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paper_sage-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: paper_sage-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 193.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for paper_sage-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c645129fbfa9969ac9f6032cbded5af2b6b2fd22fe0b5fd7b46fc75f0411977
MD5 4b923f82c5186bed512a8d0df7578733
BLAKE2b-256 13d837c94df43ec3fedc667111b870a44bcc423e57265a5d9c86fe8d999983df

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_sage-1.1.1-py3-none-any.whl:

Publisher: publish.yml on 0verL1nk/PaperSage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page