papermind-ai 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. papermind_ai-0.1.0/.gitignore +42 -0
  2. papermind_ai-0.1.0/CHANGELOG.md +51 -0
  3. papermind_ai-0.1.0/CODE_OF_CONDUCT.md +10 -0
  4. papermind_ai-0.1.0/CONTRIBUTING.md +77 -0
  5. papermind_ai-0.1.0/Dockerfile +17 -0
  6. papermind_ai-0.1.0/LICENSE +21 -0
  7. papermind_ai-0.1.0/PKG-INFO +164 -0
  8. papermind_ai-0.1.0/README.md +113 -0
  9. papermind_ai-0.1.0/README.zh-CN.md +112 -0
  10. papermind_ai-0.1.0/RELEASING.md +35 -0
  11. papermind_ai-0.1.0/SECURITY.md +26 -0
  12. papermind_ai-0.1.0/conftest.py +7 -0
  13. papermind_ai-0.1.0/evaluation/__init__.py +1 -0
  14. papermind_ai-0.1.0/evaluation/eval_retrieval.py +176 -0
  15. papermind_ai-0.1.0/evaluation/metrics.py +55 -0
  16. papermind_ai-0.1.0/evaluation/results/.gitkeep +0 -0
  17. papermind_ai-0.1.0/evaluation/results/ablation.json +29 -0
  18. papermind_ai-0.1.0/evaluation/results/ablation_bge_dev.json +29 -0
  19. papermind_ai-0.1.0/evaluation/results/ablation_bge_test.json +29 -0
  20. papermind_ai-0.1.0/papermind/__init__.py +51 -0
  21. papermind_ai-0.1.0/papermind/analyze.py +344 -0
  22. papermind_ai-0.1.0/papermind/assets/hero.svg +48 -0
  23. papermind_ai-0.1.0/papermind/cache.py +133 -0
  24. papermind_ai-0.1.0/papermind/cli.py +922 -0
  25. papermind_ai-0.1.0/papermind/compare.py +126 -0
  26. papermind_ai-0.1.0/papermind/config.py +192 -0
  27. papermind_ai-0.1.0/papermind/demo.py +212 -0
  28. papermind_ai-0.1.0/papermind/errors.py +23 -0
  29. papermind_ai-0.1.0/papermind/figures/__init__.py +1 -0
  30. papermind_ai-0.1.0/papermind/figures/extract.py +56 -0
  31. papermind_ai-0.1.0/papermind/figures/framework.py +316 -0
  32. papermind_ai-0.1.0/papermind/figures/generate.py +283 -0
  33. papermind_ai-0.1.0/papermind/llm/__init__.py +1 -0
  34. papermind_ai-0.1.0/papermind/llm/base.py +519 -0
  35. papermind_ai-0.1.0/papermind/llm/prompts.py +389 -0
  36. papermind_ai-0.1.0/papermind/modules/__init__.py +1 -0
  37. papermind_ai-0.1.0/papermind/modules/_util.py +29 -0
  38. papermind_ai-0.1.0/papermind/modules/connections.py +37 -0
  39. papermind_ai-0.1.0/papermind/modules/contributions.py +31 -0
  40. papermind_ai-0.1.0/papermind/modules/reproduction.py +118 -0
  41. papermind_ai-0.1.0/papermind/modules/technical.py +42 -0
  42. papermind_ai-0.1.0/papermind/net.py +102 -0
  43. papermind_ai-0.1.0/papermind/output/__init__.py +1 -0
  44. papermind_ai-0.1.0/papermind/output/cite.py +50 -0
  45. papermind_ai-0.1.0/papermind/output/compare_render.py +89 -0
  46. papermind_ai-0.1.0/papermind/output/html.py +395 -0
  47. papermind_ai-0.1.0/papermind/output/json_export.py +17 -0
  48. papermind_ai-0.1.0/papermind/output/markdown.py +290 -0
  49. papermind_ai-0.1.0/papermind/output/reproduce_export.py +193 -0
  50. papermind_ai-0.1.0/papermind/output/schema.py +376 -0
  51. papermind_ai-0.1.0/papermind/output/terminal.py +265 -0
  52. papermind_ai-0.1.0/papermind/parser/__init__.py +1 -0
  53. papermind_ai-0.1.0/papermind/parser/arxiv.py +465 -0
  54. papermind_ai-0.1.0/papermind/parser/pdf.py +370 -0
  55. papermind_ai-0.1.0/papermind/qa/__init__.py +1 -0
  56. papermind_ai-0.1.0/papermind/qa/chat.py +199 -0
  57. papermind_ai-0.1.0/papermind/qa/index.py +163 -0
  58. papermind_ai-0.1.0/papermind/qa/retriever.py +43 -0
  59. papermind_ai-0.1.0/papermind/qa/verify.py +78 -0
  60. papermind_ai-0.1.0/papermind/repro/__init__.py +1 -0
  61. papermind_ai-0.1.0/papermind/repro/repo.py +235 -0
  62. papermind_ai-0.1.0/papermind/rerank/__init__.py +1 -0
  63. papermind_ai-0.1.0/papermind/rerank/infer.py +50 -0
  64. papermind_ai-0.1.0/papermind/summarize.py +42 -0
  65. papermind_ai-0.1.0/papermind/web.py +1351 -0
  66. papermind_ai-0.1.0/pyproject.toml +86 -0
  67. papermind_ai-0.1.0/scripts/deploy.sh +32 -0
  68. papermind_ai-0.1.0/scripts/make_example.py +101 -0
  69. papermind_ai-0.1.0/scripts/regen_figures.py +73 -0
  70. papermind_ai-0.1.0/tests/test_analyze.py +57 -0
  71. papermind_ai-0.1.0/tests/test_build_dataset.py +60 -0
  72. papermind_ai-0.1.0/tests/test_cache.py +89 -0
  73. papermind_ai-0.1.0/tests/test_compare.py +95 -0
  74. papermind_ai-0.1.0/tests/test_eval_metrics.py +35 -0
  75. papermind_ai-0.1.0/tests/test_export.py +70 -0
  76. papermind_ai-0.1.0/tests/test_framework.py +153 -0
  77. papermind_ai-0.1.0/tests/test_llm.py +244 -0
  78. papermind_ai-0.1.0/tests/test_modules.py +226 -0
  79. papermind_ai-0.1.0/tests/test_net_security.py +260 -0
  80. papermind_ai-0.1.0/tests/test_parser.py +438 -0
  81. papermind_ai-0.1.0/tests/test_qa.py +290 -0
  82. papermind_ai-0.1.0/tests/test_repro_repo.py +130 -0
  83. papermind_ai-0.1.0/tests/test_rerank_integration.py +56 -0
  84. papermind_ai-0.1.0/tests/test_search_batch.py +103 -0
  85. papermind_ai-0.1.0/tests/test_summarize.py +48 -0
  86. papermind_ai-0.1.0/tests/test_summary_section.py +55 -0
  87. papermind_ai-0.1.0/tests/test_svg_figures.py +116 -0
  88. papermind_ai-0.1.0/tests/test_train_reranker.py +41 -0
  89. papermind_ai-0.1.0/tests/test_verify_aggregate.py +138 -0
  90. papermind_ai-0.1.0/tests/test_web.py +410 -0
  91. papermind_ai-0.1.0/trainer/__init__.py +5 -0
  92. papermind_ai-0.1.0/trainer/build_dataset.py +185 -0
  93. papermind_ai-0.1.0/trainer/train_reranker.py +205 -0
@@ -0,0 +1,42 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ *.egg
6
+ build/
7
+ dist/
8
+ .eggs/
9
+ .pytest_cache/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+
13
+ # Virtual envs
14
+ .venv/
15
+ venv/
16
+ env/
17
+
18
+ # PaperMind runtime
19
+ .papermind/
20
+ *.faiss
21
+ report/
22
+ *.report.json
23
+
24
+ # IDE / OS
25
+ .vscode/
26
+ .idea/
27
+ .DS_Store
28
+ Thumbs.db
29
+
30
+ # Playwright MCP browser artifacts / screenshots
31
+ .playwright-mcp/
32
+
33
+ # Dev-only scratch at the repo root (preview pages, screenshots, sample renders),
34
+ # coverage, and the local MCP config. Real assets live under papermind/assets/ and
35
+ # examples/figures/, so ignoring root-level images/PDFs is safe.
36
+ examples/_*.html
37
+ /preview.html
38
+ /*.png
39
+ /*.svg
40
+ /*.pdf
41
+ .coverage
42
+ .mcp.json
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ All notable changes to PaperMind are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/); versions follow [SemVer](https://semver.org/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ### Added
9
+ - **Bilingual web UI** — English by default with a 中文 toggle (resolved per request
10
+ via `?lang=`, a cookie, or `Accept-Language`).
11
+ - Whole-method **framework diagram** — a per-paper end-to-end architecture figure
12
+ (paper-style SVG that also reconstructs steps the paper only implies, marked as
13
+ inferred). Available on the web `/framework` page and downloadable as SVG.
14
+ - Broader paper sources, in addition to arXiv links / PDF URLs / local & uploaded
15
+ PDFs: a **DOI** (bare, `doi:`, or `doi.org`), a free-text **paper title** (resolved
16
+ via OpenAlex, then arXiv), and any academic **landing page** (resolved via its
17
+ `citation_pdf_url` meta tag — OpenReview, bioRxiv, ACL, PMLR, …).
18
+ - **Gemini** as a first-class provider (chat + embeddings), alongside OpenAI,
19
+ Anthropic, and DeepSeek.
20
+ - **Qwen (Aliyun Bailian / DashScope)** as a provider — `papermind config set
21
+ qwen-key …`, then use any `dashscope/…` model, e.g. `figure-model
22
+ dashscope/qwen3-max` for higher-fidelity teaching figures.
23
+
24
+ ### Changed
25
+ - **Redesigned the web UI** (landing shell + report page) into one modern, light
26
+ "dev-tool" design system — system sans (no serif), near-white + indigo palette,
27
+ sticky top bar, dark mode, mobile-friendly — replacing the previous serif/beige,
28
+ emoji-heavy styling.
29
+ - Title search resolves through OpenAlex (keyless, reliable) instead of the
30
+ rate-limited arXiv search API.
31
+
32
+ ### Fixed
33
+ - Teaching SVG figures no longer show raw LaTeX (`^{}`, `_{}`, `\frac`, …) or
34
+ mis-rendered sub/superscripts, and multi-line report formulas render under MathJax
35
+ (wrapped in `aligned`); fixed several incorrect formulas in the example gallery.
36
+ - The offline demo report no longer renders a "Syntax error · mermaid" box — its
37
+ figure is now a real teaching SVG.
38
+ - A corrupt/partial `metadata.json` no longer crashes every subsequent analysis of
39
+ that paper (guarded read + atomic write).
40
+ - Uploaded PDFs are content-addressed in the cache instead of leaking one temp file
41
+ per upload.
42
+ - Title search degrades (PDF → DOI → arXiv) instead of hard-failing on a dead link.
43
+ - Live web routes refund the per-IP rate-limit slot when a request fails.
44
+
45
+ ### Internal
46
+ - CI runs the FastAPI web suite and a ruff (pyflakes) lint gate across Python 3.9–3.12.
47
+
48
+ ## [0.1.0]
49
+ - Initial release: 4-module structured analysis, citation-verified grounded Q&A, a
50
+ trained cross-encoder retrieval reranker, a reproduction guide built from the
51
+ paper's real code repo, teaching SVG figures, and a CLI + web UI.
@@ -0,0 +1,10 @@
1
+ # Code of Conduct
2
+
3
+ PaperMind follows the spirit of the
4
+ [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
5
+
6
+ Be respectful and constructive. Assume good faith, keep discussion technical, and
7
+ welcome newcomers. Harassment, personal attacks, and discrimination are not tolerated.
8
+
9
+ Report unacceptable behavior privately to the maintainers (via the repository profile
10
+ or a GitHub Security Advisory). Reports are handled confidentially and in good faith.
@@ -0,0 +1,77 @@
1
+ # Contributing to PaperMind
2
+
3
+ Thanks for your interest! PaperMind aims to stay small, dependency-light, and easy to read.
4
+
5
+ ## Development setup
6
+
7
+ ```bash
8
+ git clone https://github.com/Wenhao-Hua/papermind
9
+ cd papermind
10
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
11
+ pip install -e ".[dev]"
12
+ ```
13
+
14
+ ## Running tests
15
+
16
+ Tests mock the LLM and avoid network, FAISS, and PyMuPDF, so they run fast and offline:
17
+
18
+ ```bash
19
+ pytest
20
+ ```
21
+
22
+ Please add a test alongside any new parsing rule, schema field, or answer-layering behavior.
23
+
24
+ The web demo (`test_web.py`) needs the `web` extra — `pip install -e ".[dev,web]"`.
25
+
26
+ ## Running against a model
27
+
28
+ Every provider is routed through `litellm`, so they're config, not code. Set a key
29
+ (env var, or `papermind config set <name>-key ...`) and pick a model:
30
+
31
+ | Provider | Key | Example model |
32
+ | --- | --- | --- |
33
+ | OpenAI (default) | `OPENAI_API_KEY` | `gpt-4o-mini` |
34
+ | Anthropic | `ANTHROPIC_API_KEY` | `claude-3-5-sonnet-latest` |
35
+ | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek/deepseek-chat` |
36
+ | Gemini | `GEMINI_API_KEY` | `gemini/gemini-2.5-flash` |
37
+ | Local / free | — | `--local` (Ollama) |
38
+
39
+ Override the model with `--model` / `PAPERMIND_MODEL` and embeddings with
40
+ `PAPERMIND_EMBEDDING_MODEL`. `papermind demo` runs fully offline with no key.
41
+
42
+ ## Architecture at a glance
43
+
44
+ ```
45
+ papermind/
46
+ ├── cli.py # typer entry point (lazy-imports heavy work)
47
+ ├── analyze.py # orchestration: resolve → parse → modules → figures → Report
48
+ ├── config.py # keys / model / cache resolution (env > file > default)
49
+ ├── parser/ # arxiv.py (download+meta), pdf.py (text+figures)
50
+ ├── modules/ # contributions / technical / connections / reproduction
51
+ ├── figures/ # extract.py (match originals), generate.py (teaching SVGs; legacy Mermaid), framework.py (whole-method diagram: spec + deterministic SVG renderer)
52
+ ├── qa/ # index.py (chunk+FAISS), retriever.py, chat.py (PaperChat)
53
+ ├── repro/ # repo.py (locate & verify the paper's official code repo)
54
+ ├── rerank/ # infer.py (trained cross-encoder reranker inference)
55
+ ├── llm/ # base.py (litellm wrapper), prompts.py (all prompts)
56
+ └── output/ # schema.py (pydantic, single source of truth), markdown/json/terminal
57
+ ```
58
+
59
+ ## Guidelines
60
+
61
+ - **Keep dependencies minimal.** No LangChain or heavyweight frameworks. Heavy imports
62
+ (`litellm`, `faiss`, `fitz`, `numpy`) must stay **lazy** so `papermind --help`/`config`
63
+ work without them.
64
+ - **Prompts live in one place** — [`papermind/llm/prompts.py`](papermind/llm/prompts.py).
65
+ - **`output/schema.py` is the single source of truth.** Change it first, then renderers.
66
+ - **Parse LLM JSON defensively.** A single malformed field should never sink a whole report
67
+ (see [`papermind/modules/_util.py`](papermind/modules/_util.py)).
68
+ - **Type-annotate public functions and all pydantic models.**
69
+ - Match the existing style; keep changes surgical.
70
+
71
+ ## Submitting changes
72
+
73
+ 1. Branch from `main`.
74
+ 2. Add/update tests; run `pytest`.
75
+ 3. Open a PR describing the change and its motivation.
76
+
77
+ By contributing you agree your work is licensed under the project's [MIT License](LICENSE).
@@ -0,0 +1,17 @@
1
+ # PaperMind web service — public-safe by default (demo mode: cached reports only).
2
+ # Build: docker build -t papermind .
3
+ # Run: docker run -p 8080:8080 papermind
4
+ # Live: docker run -p 8080:8080 -e OPENAI_API_KEY=sk-... papermind \
5
+ # papermind serve --host 0.0.0.0 --port 8080 --live
6
+ FROM python:3.11-slim
7
+
8
+ WORKDIR /app
9
+ COPY . /app
10
+
11
+ # faiss-cpu / pymupdf / litellm ship manylinux wheels, so no build toolchain needed.
12
+ RUN pip install --no-cache-dir ".[web]"
13
+
14
+ EXPOSE 8080
15
+ # Demo mode by default: serves only already-cached reports, makes no model calls,
16
+ # so exposing it publicly won't burn an API key. Add `--live` (and a key) for real analysis.
17
+ CMD ["papermind", "serve", "--host", "0.0.0.0", "--port", "8080"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PaperMind contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.4
2
+ Name: papermind-ai
3
+ Version: 0.1.0
4
+ Summary: Read arXiv papers for real: structured analysis, grounded RAG Q&A, and reproduction tutoring from the command line.
5
+ Project-URL: Homepage, https://github.com/Wenhao-Hua/papermind
6
+ Project-URL: Repository, https://github.com/Wenhao-Hua/papermind
7
+ Project-URL: Issues, https://github.com/Wenhao-Hua/papermind/issues
8
+ Project-URL: Changelog, https://github.com/Wenhao-Hua/papermind/blob/main/CHANGELOG.md
9
+ Author: PaperMind contributors
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: arxiv,citation,cli,cross-encoder,grounded-qa,litellm,llm,paper,paper-reading,rag,reproducibility,reproduction,reranker,research,scientific-papers
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.9
24
+ Requires-Dist: faiss-cpu>=1.7.4
25
+ Requires-Dist: httpx>=0.24.0
26
+ Requires-Dist: litellm<2.0,>=1.40.0
27
+ Requires-Dist: numpy>=1.24.0
28
+ Requires-Dist: pydantic<3,>=2.0.0
29
+ Requires-Dist: pymupdf>=1.23.0
30
+ Requires-Dist: rich>=13.0.0
31
+ Requires-Dist: typer>=0.9.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
34
+ Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
35
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
37
+ Provides-Extra: local-embeddings
38
+ Requires-Dist: sentence-transformers>=2.2.0; extra == 'local-embeddings'
39
+ Provides-Extra: train
40
+ Requires-Dist: rank-bm25>=0.2.2; extra == 'train'
41
+ Requires-Dist: sentence-transformers>=2.7.0; extra == 'train'
42
+ Provides-Extra: ui
43
+ Requires-Dist: fastapi>=0.110.0; extra == 'ui'
44
+ Requires-Dist: python-multipart>=0.0.9; extra == 'ui'
45
+ Requires-Dist: uvicorn>=0.27.0; extra == 'ui'
46
+ Provides-Extra: web
47
+ Requires-Dist: fastapi>=0.110.0; extra == 'web'
48
+ Requires-Dist: python-multipart>=0.0.9; extra == 'web'
49
+ Requires-Dist: uvicorn>=0.27.0; extra == 'web'
50
+ Description-Content-Type: text/markdown
51
+
52
+ # PaperMind
53
+
54
+ **English · [简体中文](README.zh-CN.md)**
55
+
56
+ > **Read any paper — from skim to reproduction — with every key claim traced back to the source.**
57
+ > Paste an arXiv link, DOI, paper title, or any paper page / PDF URL (or upload a PDF): structured analysis, grounded & citation‑verified Q&A, a whole‑method framework diagram (downloadable SVG), and a runnable reproduction guide.
58
+
59
+ [![CI](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml/badge.svg)](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml)
60
+ [![PyPI](https://img.shields.io/pypi/v/papermind-ai)](https://pypi.org/project/papermind-ai/)
61
+ [![Python](https://img.shields.io/pypi/pyversions/papermind-ai)](https://pypi.org/project/papermind-ai/)
62
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
63
+
64
+ <p align="center">
65
+ <img src="papermind/assets/hero.svg" alt="A paper-style teaching diagram PaperMind generates for a technical point" width="760">
66
+ </p>
67
+ <p align="center">
68
+ <sub>↑ A <b>paper-style teaching diagram PaperMind generates</b> for a technical point (real output) ·
69
+ <a href="examples/transformer.md"><b>full sample report</b></a> · <a href="examples/README.md">gallery →</a></sub>
70
+ </p>
71
+
72
+ ## Why it isn't just another chat‑with‑PDF
73
+
74
+ - **🔬 We trained our own retrieval reranker — +14pt Recall@5 over a strong dense baseline** (QASPER, held‑out test). Most "chat with a paper" tools wrap an API; PaperMind's evidence retrieval is a cross‑encoder we fine‑tuned and measured (see [Benchmarks](#benchmarks-the-reranker-is-trained-and-measured-not-a-black-box)).
75
+ - **🔎 Key claims are labeled and citation‑verified.** Answers are split into **fact / inference (with confidence) / out‑of‑scope**, and each cited quote is checked against the actual paper text — if it can't be found, it's flagged ⚠️ rather than silently trusted.
76
+ - **📐 Whole‑method framework diagram.** Beyond per‑point figures, PaperMind reconstructs the paper's end‑to‑end method as a single Figure‑1‑style architecture diagram (steps the paper only implies are marked *inferred*) — view it on the web `/framework` tab and download it as SVG.
77
+ - **🛠️ Reproduction grounded in the real code repo.** PaperMind locates the paper's code repository and builds `setup.sh` from the repo's **actual dependency file and README run‑commands** — not a hallucinated guess.
78
+ - **🆓 Runs fully local & free.** `papermind demo` works offline; `--local` routes everything through Ollama; with no key it auto‑falls back to local.
79
+
80
+ | | **PaperMind** | Typical chat‑with‑PDF / SaaS readers |
81
+ | --- | :---: | :---: |
82
+ | Per‑claim citation **with verification** (flags unverifiable ⚠️) | ✅ | — |
83
+ | Reproduction → runnable `setup.sh` from the **real** repo | ✅ | — |
84
+ | **Self‑trained** RAG reranker, measured on QASPER | ✅ | — |
85
+ | Runs **fully local / offline, zero cost** | ✅ | ✗ |
86
+ | **Open‑source & self‑hostable** | ✅ | ✗ |
87
+
88
+ <sub>“—” = not a documented capability we're aware of; open an issue to correct us. Open‑source/local rows are clear‑cut for closed SaaS tools.</sub>
89
+
90
+ ## Three ways to use it
91
+
92
+ | | How | Best for |
93
+ | --- | --- | --- |
94
+ | 🌐 **Online** | open **[papermind.try2026.cn](https://papermind.try2026.cn)** — zero install | trying it instantly |
95
+ | 🖥️ **GUI** | `pip install "papermind-ai[web]"` → `papermind ui` | full features, in your browser |
96
+ | ⌨️ **CLI / API** | `pip install papermind-ai` → `papermind analyze https://arxiv.org/abs/2307.08691` | scripting, batch, integration |
97
+
98
+ > 🆓 No spend: `papermind demo` shows the output offline (no key); add `--local` to any command to run fully on local Ollama at zero cost.
99
+
100
+ ## What you get
101
+
102
+ ```
103
+ ╭──────────────── Attention Is All You Need · 2017 · arXiv:1706.03762 ───────────────╮
104
+ 🎯 Contributions A fully attention-based model (Transformer): no recurrence/convolution…
105
+ 🔬 Technical 1. Scaled Dot-Product Attention [high] softmax(QKᵀ/√d_k)·V; scaling avoids
106
+ saturated gradients 💡 analogy + 📊 paper-style teaching diagram (SVG)
107
+ 💬 Grounded Q&A "Why divide by √d_k?" → [FACT] large d_k inflates dot-product variance…
108
+ 📌 source Section 3.2.1 (p.4) ✓ verified
109
+ 🛠️ Reproduction code repo (★24k) github.com/… → setup.sh (real deps + README run commands)
110
+ ```
111
+
112
+ Full rendered reports (open on GitHub — paper‑style diagrams, jump‑to‑source citations, reproduction tables):
113
+ **[Transformer](examples/transformer.md)** · **[ViT](examples/vit.md)** · **[PPO](examples/ppo.md)** · **[the full gallery →](examples/README.md)**
114
+
115
+ ## Gallery — 7 papers across 5 areas
116
+
117
+ PaperMind isn't NLP‑only. Real reports generated by the pipeline, grouped by area:
118
+
119
+ | Area | Papers |
120
+ | --- | --- |
121
+ | **NLP / Attention** | [Transformer](examples/transformer.md) · [FlashAttention‑2](examples/flashattention2.md) · [Llama 2](examples/llama2.md) |
122
+ | **Computer Vision** | [ViT](examples/vit.md) |
123
+ | **Generative / Diffusion** | [Latent Diffusion (Stable Diffusion)](examples/latent-diffusion.md) |
124
+ | **Reinforcement Learning** | [PPO](examples/ppo.md) |
125
+ | **Efficient fine‑tuning** | [LoRA](examples/lora.md) |
126
+
127
+ ## Benchmarks — the reranker is trained and measured, not a black box
128
+
129
+ We fine‑tuned a cross‑encoder reranker (`bge‑reranker‑base`) on **QASPER**. Over all‑paragraph candidates, versus a strong dense baseline:
130
+
131
+ | | Recall@5 | MRR | nDCG@10 |
132
+ | --- | --- | --- | --- |
133
+ | Dense (`bge‑small‑en‑v1.5`) | 0.519 | 0.463 | 0.469 |
134
+ | **+ our reranker** | **0.660** | **0.612** | **0.609** |
135
+
136
+ Consistent across dev (888 q) and a held‑out test (1309 q) — no overfitting. Reproduce it: [`docs/RESEARCH_PLAN.md`](docs/RESEARCH_PLAN.md) (`trainer/` to train · `evaluation/` to evaluate).
137
+
138
+ ## Self‑host the online service
139
+
140
+ One Docker command. Public exposure is safe by default (demo mode is read‑only cache, never spends a key):
141
+
142
+ ```bash
143
+ git clone https://github.com/Wenhao-Hua/papermind && cd papermind
144
+ docker build -t papermind . && docker run -p 8080:8080 papermind # demo mode
145
+
146
+ docker run -p 8080:8080 -e OPENAI_API_KEY=sk-... -e PAPERMIND_TRUST_PROXY=1 papermind \
147
+ papermind serve --host 0.0.0.0 --port 8080 --live # live (your key, billed)
148
+ ```
149
+
150
+ > **`--live` is rate‑limited by default** (8/IP/day, 300/day global; tune with `--rate-per-ip` / `--rate-global`, `0` = unlimited) so a public deployment can't drain your key. Free ops (search / cached / offline demo) aren't limited.
151
+ >
152
+ > **Behind Cloudflare/a reverse proxy, set `PAPERMIND_TRUST_PROXY=1`** — otherwise every visitor shares one per‑IP quota (the proxy's IP) and per‑IP limiting silently breaks. Only set it when you're actually behind a trusted proxy that sets `cf-connecting-ip`.
153
+ >
154
+ > **Faster figures:** diagrams default to the main model (cleanest layout, slower). Point figures at a fast non‑thinking model to speed them up: `papermind config set figure-model deepseek/deepseek-chat`.
155
+
156
+ ## What it can do
157
+
158
+ `analyze` (4‑module report) · `summary` (TL;DR) · `ask`/`chat` (grounded Q&A) · `tutor`/`debug` (reproduction help) · `compare` (multi‑paper) · `reproduce` (export setup.sh / notebook) · `search`/`batch`/`list` · `cite`.
159
+
160
+ Models via [litellm](https://github.com/BerriAI/litellm): OpenAI / Anthropic / DeepSeek / Gemini / Qwen (DashScope) / local Ollama. Results are cached locally — re‑runs are instant. More: `papermind --help`.
161
+
162
+ ## Contributing / License
163
+
164
+ PRs and issues welcome ([CONTRIBUTING.md](CONTRIBUTING.md)) · [MIT](LICENSE)
@@ -0,0 +1,113 @@
1
+ # PaperMind
2
+
3
+ **English · [简体中文](README.zh-CN.md)**
4
+
5
+ > **Read any paper — from skim to reproduction — with every key claim traced back to the source.**
6
+ > Paste an arXiv link, DOI, paper title, or any paper page / PDF URL (or upload a PDF): structured analysis, grounded & citation‑verified Q&A, a whole‑method framework diagram (downloadable SVG), and a runnable reproduction guide.
7
+
8
+ [![CI](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml/badge.svg)](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml)
9
+ [![PyPI](https://img.shields.io/pypi/v/papermind-ai)](https://pypi.org/project/papermind-ai/)
10
+ [![Python](https://img.shields.io/pypi/pyversions/papermind-ai)](https://pypi.org/project/papermind-ai/)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
12
+
13
+ <p align="center">
14
+ <img src="papermind/assets/hero.svg" alt="A paper-style teaching diagram PaperMind generates for a technical point" width="760">
15
+ </p>
16
+ <p align="center">
17
+ <sub>↑ A <b>paper-style teaching diagram PaperMind generates</b> for a technical point (real output) ·
18
+ <a href="examples/transformer.md"><b>full sample report</b></a> · <a href="examples/README.md">gallery →</a></sub>
19
+ </p>
20
+
21
+ ## Why it isn't just another chat‑with‑PDF
22
+
23
+ - **🔬 We trained our own retrieval reranker — +14pt Recall@5 over a strong dense baseline** (QASPER, held‑out test). Most "chat with a paper" tools wrap an API; PaperMind's evidence retrieval is a cross‑encoder we fine‑tuned and measured (see [Benchmarks](#benchmarks-the-reranker-is-trained-and-measured-not-a-black-box)).
24
+ - **🔎 Key claims are labeled and citation‑verified.** Answers are split into **fact / inference (with confidence) / out‑of‑scope**, and each cited quote is checked against the actual paper text — if it can't be found, it's flagged ⚠️ rather than silently trusted.
25
+ - **📐 Whole‑method framework diagram.** Beyond per‑point figures, PaperMind reconstructs the paper's end‑to‑end method as a single Figure‑1‑style architecture diagram (steps the paper only implies are marked *inferred*) — view it on the web `/framework` tab and download it as SVG.
26
+ - **🛠️ Reproduction grounded in the real code repo.** PaperMind locates the paper's code repository and builds `setup.sh` from the repo's **actual dependency file and README run‑commands** — not a hallucinated guess.
27
+ - **🆓 Runs fully local & free.** `papermind demo` works offline; `--local` routes everything through Ollama; with no key it auto‑falls back to local.
28
+
29
+ | | **PaperMind** | Typical chat‑with‑PDF / SaaS readers |
30
+ | --- | :---: | :---: |
31
+ | Per‑claim citation **with verification** (flags unverifiable ⚠️) | ✅ | — |
32
+ | Reproduction → runnable `setup.sh` from the **real** repo | ✅ | — |
33
+ | **Self‑trained** RAG reranker, measured on QASPER | ✅ | — |
34
+ | Runs **fully local / offline, zero cost** | ✅ | ✗ |
35
+ | **Open‑source & self‑hostable** | ✅ | ✗ |
36
+
37
+ <sub>“—” = not a documented capability we're aware of; open an issue to correct us. Open‑source/local rows are clear‑cut for closed SaaS tools.</sub>
38
+
39
+ ## Three ways to use it
40
+
41
+ | | How | Best for |
42
+ | --- | --- | --- |
43
+ | 🌐 **Online** | open **[papermind.try2026.cn](https://papermind.try2026.cn)** — zero install | trying it instantly |
44
+ | 🖥️ **GUI** | `pip install "papermind-ai[web]"` → `papermind ui` | full features, in your browser |
45
+ | ⌨️ **CLI / API** | `pip install papermind-ai` → `papermind analyze https://arxiv.org/abs/2307.08691` | scripting, batch, integration |
46
+
47
+ > 🆓 No spend: `papermind demo` shows the output offline (no key); add `--local` to any command to run fully on local Ollama at zero cost.
48
+
49
+ ## What you get
50
+
51
+ ```
52
+ ╭──────────────── Attention Is All You Need · 2017 · arXiv:1706.03762 ───────────────╮
53
+ 🎯 Contributions A fully attention-based model (Transformer): no recurrence/convolution…
54
+ 🔬 Technical 1. Scaled Dot-Product Attention [high] softmax(QKᵀ/√d_k)·V; scaling avoids
55
+ saturated gradients 💡 analogy + 📊 paper-style teaching diagram (SVG)
56
+ 💬 Grounded Q&A "Why divide by √d_k?" → [FACT] large d_k inflates dot-product variance…
57
+ 📌 source Section 3.2.1 (p.4) ✓ verified
58
+ 🛠️ Reproduction code repo (★24k) github.com/… → setup.sh (real deps + README run commands)
59
+ ```
60
+
61
+ Full rendered reports (open on GitHub — paper‑style diagrams, jump‑to‑source citations, reproduction tables):
62
+ **[Transformer](examples/transformer.md)** · **[ViT](examples/vit.md)** · **[PPO](examples/ppo.md)** · **[the full gallery →](examples/README.md)**
63
+
64
+ ## Gallery — 7 papers across 5 areas
65
+
66
+ PaperMind isn't NLP‑only. Real reports generated by the pipeline, grouped by area:
67
+
68
+ | Area | Papers |
69
+ | --- | --- |
70
+ | **NLP / Attention** | [Transformer](examples/transformer.md) · [FlashAttention‑2](examples/flashattention2.md) · [Llama 2](examples/llama2.md) |
71
+ | **Computer Vision** | [ViT](examples/vit.md) |
72
+ | **Generative / Diffusion** | [Latent Diffusion (Stable Diffusion)](examples/latent-diffusion.md) |
73
+ | **Reinforcement Learning** | [PPO](examples/ppo.md) |
74
+ | **Efficient fine‑tuning** | [LoRA](examples/lora.md) |
75
+
76
+ ## Benchmarks — the reranker is trained and measured, not a black box
77
+
78
+ We fine‑tuned a cross‑encoder reranker (`bge‑reranker‑base`) on **QASPER**. Over all‑paragraph candidates, versus a strong dense baseline:
79
+
80
+ | | Recall@5 | MRR | nDCG@10 |
81
+ | --- | --- | --- | --- |
82
+ | Dense (`bge‑small‑en‑v1.5`) | 0.519 | 0.463 | 0.469 |
83
+ | **+ our reranker** | **0.660** | **0.612** | **0.609** |
84
+
85
+ Consistent across dev (888 q) and a held‑out test (1309 q) — no overfitting. Reproduce it: [`docs/RESEARCH_PLAN.md`](docs/RESEARCH_PLAN.md) (`trainer/` to train · `evaluation/` to evaluate).
86
+
87
+ ## Self‑host the online service
88
+
89
+ One Docker command. Public exposure is safe by default (demo mode is read‑only cache, never spends a key):
90
+
91
+ ```bash
92
+ git clone https://github.com/Wenhao-Hua/papermind && cd papermind
93
+ docker build -t papermind . && docker run -p 8080:8080 papermind # demo mode
94
+
95
+ docker run -p 8080:8080 -e OPENAI_API_KEY=sk-... -e PAPERMIND_TRUST_PROXY=1 papermind \
96
+ papermind serve --host 0.0.0.0 --port 8080 --live # live (your key, billed)
97
+ ```
98
+
99
+ > **`--live` is rate‑limited by default** (8/IP/day, 300/day global; tune with `--rate-per-ip` / `--rate-global`, `0` = unlimited) so a public deployment can't drain your key. Free ops (search / cached / offline demo) aren't limited.
100
+ >
101
+ > **Behind Cloudflare/a reverse proxy, set `PAPERMIND_TRUST_PROXY=1`** — otherwise every visitor shares one per‑IP quota (the proxy's IP) and per‑IP limiting silently breaks. Only set it when you're actually behind a trusted proxy that sets `cf-connecting-ip`.
102
+ >
103
+ > **Faster figures:** diagrams default to the main model (cleanest layout, slower). Point figures at a fast non‑thinking model to speed them up: `papermind config set figure-model deepseek/deepseek-chat`.
104
+
105
+ ## What it can do
106
+
107
+ `analyze` (4‑module report) · `summary` (TL;DR) · `ask`/`chat` (grounded Q&A) · `tutor`/`debug` (reproduction help) · `compare` (multi‑paper) · `reproduce` (export setup.sh / notebook) · `search`/`batch`/`list` · `cite`.
108
+
109
+ Models via [litellm](https://github.com/BerriAI/litellm): OpenAI / Anthropic / DeepSeek / Gemini / Qwen (DashScope) / local Ollama. Results are cached locally — re‑runs are instant. More: `papermind --help`.
110
+
111
+ ## Contributing / License
112
+
113
+ PRs and issues welcome ([CONTRIBUTING.md](CONTRIBUTING.md)) · [MIT](LICENSE)
@@ -0,0 +1,112 @@
1
+ # PaperMind
2
+
3
+ **[English](README.md) · 简体中文**
4
+
5
+ > **把任意论文读懂、读到能复现 —— 关键判断都标原文出处、逐条核验。**
6
+ > 输入 arXiv 链接 / DOI / 论文标题 / 论文页面或 PDF 直链(也可上传 PDF):结构化分析、带原文依据并核验的问答、整篇方法的**框架图**(可下载 SVG)、可运行的复现指南。
7
+
8
+ [![CI](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml/badge.svg)](https://github.com/Wenhao-Hua/papermind/actions/workflows/ci.yml)
9
+ [![PyPI](https://img.shields.io/pypi/v/papermind-ai)](https://pypi.org/project/papermind-ai/)
10
+ [![Python](https://img.shields.io/pypi/pyversions/papermind-ai)](https://pypi.org/project/papermind-ai/)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
12
+
13
+ <p align="center">
14
+ <img src="examples/figures/transformer-fig2.svg" alt="PaperMind 为论文技术点生成的论文式教学示意图" width="760">
15
+ </p>
16
+ <p align="center">
17
+ <sub>↑ PaperMind 为论文技术点<b>生成的论文式教学示意图</b>(管线真实产物)·
18
+ <a href="examples/transformer.md"><b>看完整样例报告</b></a> · <a href="examples/README.md">样例画廊 →</a></sub>
19
+ </p>
20
+
21
+ ## 凭什么不是「又一个 chat-with-PDF」
22
+
23
+ - **🔬 我们自训练了检索重排器 —— 相对强稠密基线 Recall@5 +14pt**(QASPER 独立 test)。多数「和论文对话」工具只是套 API;PaperMind 的证据检索是我们**自己微调并实测**的 cross-encoder(见 [实测数据](#实测重排器是自训练实测的不是黑箱))。
24
+ - **🔎 关键判断分层标注、逐条核验。** 回答分 **论文事实 / 推理(带置信度) / 超纲**,每条引用都对着原文核验——核不到就标 ⚠️,绝不默默当真。
25
+ - **📐 整篇方法的框架图。** 除了逐技术点的配图,PaperMind 还把论文的端到端方法重建成一张 Figure‑1 式的总览架构图(论文只隐含、未画出的步骤标注为*推断*)——在网页 `/framework` 页查看,可下载为 SVG。
26
+ - **🛠️ 复现接论文的真实代码仓库。** 自动定位论文的代码仓库,用仓库里**真实的依赖文件和 README 运行命令**生成 `setup.sh`,不是模型瞎猜。
27
+ - **🆓 全本地、零成本可跑。** `papermind demo` 离线看;`--local` 全程走 Ollama;没 key 自动回退本地。
28
+
29
+ | | **PaperMind** | 常见 chat-with-PDF / SaaS 阅读器 |
30
+ | --- | :---: | :---: |
31
+ | 逐条引用**并核验**(核不到标 ⚠️) | ✅ | — |
32
+ | 复现 → 接**真实仓库**的可运行 `setup.sh` | ✅ | — |
33
+ | **自训练** RAG 重排器、QASPER 实测 | ✅ | — |
34
+ | **全本地 / 离线、零成本**运行 | ✅ | ✗ |
35
+ | **开源、可自托管** | ✅ | ✗ |
36
+
37
+ <sub>“—” = 据我们所知对方未公开该能力(欢迎 issue 指正);开源/本地两行对闭源 SaaS 是明确的。</sub>
38
+
39
+ ## 三种用法,挑最方便的
40
+
41
+ | | 怎么用 | 适合 |
42
+ | --- | --- | --- |
43
+ | 🌐 **在线用** | 打开 **[papermind.try2026.cn](https://papermind.try2026.cn)**,零安装 | 想立刻试、不装东西 |
44
+ | 🖥️ **图形界面** | `pip install "papermind-ai[web]"` → `papermind ui` | 本地全功能、浏览器操作 |
45
+ | ⌨️ **命令行 / API** | `pip install papermind-ai` → `papermind analyze https://arxiv.org/abs/2307.08691` | 脚本化、批量、集成 |
46
+
47
+ > 🆓 不想花钱:`papermind demo` 离线看效果(无需 key);任何命令加 `--local` 走本地 Ollama,全程零成本。
48
+
49
+ ## 效果
50
+
51
+ ```
52
+ ╭──────────────── Attention Is All You Need · 2017 · arXiv:1706.03762 ───────────────╮
53
+ 🎯 核心贡献 提出完全基于注意力的 Transformer,去掉循环与卷积,机器翻译刷新 SOTA…
54
+ 🔬 技术细节 1. 缩放点积注意力 [high] Q·Kᵀ 除以 √d_k 再 softmax 加权 V;缩放避免梯度饱和
55
+ 💡 类比:像搜索引擎按匹配度加权汇总文档;📊 附论文式教学示意图(SVG)
56
+ 💬 问答 「为什么除以 √d_k?」→【论文事实】维度大时点积方差大… 📌 出处 Section 3.2.1 (p.4) ✓已核验
57
+ 🛠️ 复现 代码仓库(★24k)github.com/... → setup.sh(真实依赖 + README 运行命令)
58
+ ```
59
+
60
+ 完整渲染样例(GitHub 直接打开——论文式示意图、可跳转原文出处、复现表格):
61
+ **[Transformer](examples/transformer.md)** · **[ViT](examples/vit.md)** · **[PPO](examples/ppo.md)** · **[完整画廊 →](examples/README.md)**
62
+
63
+ ## 样例画廊 —— 7 篇论文,跨 5 个领域
64
+
65
+ PaperMind 不只懂 NLP。下面都是管线真实跑出来的报告,按领域分组:
66
+
67
+ | 领域 | 论文 |
68
+ | --- | --- |
69
+ | **NLP / 注意力** | [Transformer](examples/transformer.md) · [FlashAttention‑2](examples/flashattention2.md) · [Llama 2](examples/llama2.md) |
70
+ | **计算机视觉** | [ViT](examples/vit.md) |
71
+ | **生成 / 扩散** | [Latent Diffusion (Stable Diffusion)](examples/latent-diffusion.md) |
72
+ | **强化学习** | [PPO](examples/ppo.md) |
73
+ | **高效微调** | [LoRA](examples/lora.md) |
74
+
75
+ ## 实测——重排器是自训练、实测的,不是黑箱
76
+
77
+ 在 **QASPER** 上自训练 cross-encoder 重排器(`bge-reranker-base`),全段落候选下相对强稠密基线:
78
+
79
+ | | Recall@5 | MRR | nDCG@10 |
80
+ | --- | --- | --- | --- |
81
+ | Dense (`bge-small-en-v1.5`) | 0.519 | 0.463 | 0.469 |
82
+ | **+ 自训练 Reranker** | **0.660** | **0.612** | **0.609** |
83
+
84
+ dev(888 题)与独立 test(1309 题)一致,无过拟合。复现:[`docs/RESEARCH_PLAN.md`](docs/RESEARCH_PLAN.md)(`trainer/` 训练 · `evaluation/` 评测)。
85
+
86
+ ## 自托管在线服务
87
+
88
+ Docker 一行起服务,公网暴露也安全(默认演示模式只读缓存、不烧 key):
89
+
90
+ ```bash
91
+ git clone https://github.com/Wenhao-Hua/papermind && cd papermind
92
+ docker build -t papermind . && docker run -p 8080:8080 papermind # 演示模式
93
+
94
+ docker run -p 8080:8080 -e OPENAI_API_KEY=sk-... -e PAPERMIND_TRUST_PROXY=1 papermind \
95
+ papermind serve --host 0.0.0.0 --port 8080 --live # 实时分析(你的 key 付费)
96
+ ```
97
+
98
+ > **`--live` 默认带限流**(每 IP 8 次/天、全局 300 次/天,可用 `--rate-per-ip` / `--rate-global` 调,`0` 表示不限)——公开挂出去也不会被陌生人刷爆你的 key。免费操作(搜索 / 缓存 / 离线 demo)不受限。
99
+ >
100
+ > **部署在 Cloudflare / 反向代理后面时,要设 `PAPERMIND_TRUST_PROXY=1`** ——否则所有访客共用同一个 per-IP 配额(代理的 IP),per-IP 限流会静默失效。仅当确实在会设置 `cf-connecting-ip` 的可信代理后面才开启。
101
+ >
102
+ > **想加快出图**:配图默认用主模型(布局最干净但慢)。给配图单独配一个快速的非思考模型即可大幅提速:`papermind config set figure-model deepseek/deepseek-chat`。
103
+
104
+ ## 能做什么
105
+
106
+ `analyze`(四模块报告)· `summary`(TL;DR)· `ask`/`chat`(带依据问答)· `tutor`/`debug`(复现辅导)· `compare`(多篇对比)· `reproduce`(导出 setup.sh/notebook)· `search`/`batch`/`list` · `cite`。
107
+
108
+ 模型走 [litellm](https://github.com/BerriAI/litellm):OpenAI / Anthropic / DeepSeek / Gemini / Qwen(百炼)/ 本地 Ollama 任选;结果本地缓存,二次运行秒出。更多用法:`papermind --help`。
109
+
110
+ ## 贡献 / License
111
+
112
+ 欢迎 PR / issue([CONTRIBUTING.md](CONTRIBUTING.md))· [MIT](LICENSE)
@@ -0,0 +1,35 @@
1
+ # Releasing PaperMind
2
+
3
+ Releases are published to [PyPI](https://pypi.org/project/paper-mind/) automatically by
4
+ the [`Release`](.github/workflows/release.yml) workflow when a `vX.Y.Z` tag is pushed.
5
+
6
+ ## One-time setup
7
+
8
+ 1. Create the project on PyPI (or reserve the name).
9
+ 2. Configure **Trusted Publishing** (no API token needed): on PyPI →
10
+ *Manage project* → *Publishing* → add a GitHub Actions publisher for
11
+ `Wenhao-Hua/papermind`, workflow `release.yml`, environment `pypi`.
12
+ 3. In the GitHub repo, create an Environment named `pypi`.
13
+
14
+ ## Cutting a release
15
+
16
+ 1. Bump the version in [`pyproject.toml`](pyproject.toml) and
17
+ `papermind/__init__.py` (`__version__`). Keep them in sync.
18
+ 2. Update any changelog notes, commit.
19
+ 3. Tag and push:
20
+
21
+ ```bash
22
+ git tag v0.1.0
23
+ git push origin v0.1.0
24
+ ```
25
+
26
+ 4. The `Release` workflow builds the sdist + wheel and publishes to PyPI.
27
+ 5. Verify: `pip install paper-mind` in a clean environment.
28
+
29
+ ## Pre-release checklist
30
+
31
+ - [ ] `pytest` passes locally and in CI.
32
+ - [ ] `pip install -e .` works from a fresh clone.
33
+ - [ ] `papermind --help`, `papermind config show` work.
34
+ - [ ] README install/usage commands are accurate.
35
+ - [ ] Version bumped in both `pyproject.toml` and `__init__.py`.