paperlab 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 (67) hide show
  1. paperlab-0.1.0/.github/workflows/ci.yml +40 -0
  2. paperlab-0.1.0/.github/workflows/publish.yml +28 -0
  3. paperlab-0.1.0/.gitignore +41 -0
  4. paperlab-0.1.0/CONTRIBUTING.md +39 -0
  5. paperlab-0.1.0/LICENSE +21 -0
  6. paperlab-0.1.0/PKG-INFO +204 -0
  7. paperlab-0.1.0/README.md +167 -0
  8. paperlab-0.1.0/docs/architecture.md +50 -0
  9. paperlab-0.1.0/docs/user-research.md +43 -0
  10. paperlab-0.1.0/pyproject.toml +74 -0
  11. paperlab-0.1.0/src/paperlab/__init__.py +9 -0
  12. paperlab-0.1.0/src/paperlab/agents/__init__.py +19 -0
  13. paperlab-0.1.0/src/paperlab/agents/base.py +82 -0
  14. paperlab-0.1.0/src/paperlab/agents/contextualizer.py +5 -0
  15. paperlab-0.1.0/src/paperlab/agents/critic.py +5 -0
  16. paperlab-0.1.0/src/paperlab/agents/methodologist.py +5 -0
  17. paperlab-0.1.0/src/paperlab/agents/summarizer.py +5 -0
  18. paperlab-0.1.0/src/paperlab/cli/__init__.py +0 -0
  19. paperlab-0.1.0/src/paperlab/cli/config.py +105 -0
  20. paperlab-0.1.0/src/paperlab/cli/main.py +205 -0
  21. paperlab-0.1.0/src/paperlab/ingest/__init__.py +5 -0
  22. paperlab-0.1.0/src/paperlab/ingest/pdf.py +70 -0
  23. paperlab-0.1.0/src/paperlab/orchestrator/__init__.py +5 -0
  24. paperlab-0.1.0/src/paperlab/orchestrator/runner.py +67 -0
  25. paperlab-0.1.0/src/paperlab/prompts/__init__.py +5 -0
  26. paperlab-0.1.0/src/paperlab/prompts/contextualizer.yaml +63 -0
  27. paperlab-0.1.0/src/paperlab/prompts/critic.yaml +63 -0
  28. paperlab-0.1.0/src/paperlab/prompts/loader.py +56 -0
  29. paperlab-0.1.0/src/paperlab/prompts/methodologist.yaml +63 -0
  30. paperlab-0.1.0/src/paperlab/prompts/summarizer.yaml +61 -0
  31. paperlab-0.1.0/src/paperlab/providers/__init__.py +13 -0
  32. paperlab-0.1.0/src/paperlab/providers/base.py +16 -0
  33. paperlab-0.1.0/src/paperlab/providers/factory.py +41 -0
  34. paperlab-0.1.0/src/paperlab/providers/fake.py +34 -0
  35. paperlab-0.1.0/src/paperlab/providers/litellm_provider.py +26 -0
  36. paperlab-0.1.0/src/paperlab/sessions/__init__.py +20 -0
  37. paperlab-0.1.0/src/paperlab/sessions/export.py +53 -0
  38. paperlab-0.1.0/src/paperlab/sessions/store.py +74 -0
  39. paperlab-0.1.0/src/paperlab/web/__init__.py +5 -0
  40. paperlab-0.1.0/src/paperlab/web/app.py +100 -0
  41. paperlab-0.1.0/tests/__init__.py +0 -0
  42. paperlab-0.1.0/tests/agents/__init__.py +0 -0
  43. paperlab-0.1.0/tests/agents/test_base.py +76 -0
  44. paperlab-0.1.0/tests/agents/test_concrete.py +111 -0
  45. paperlab-0.1.0/tests/cli/__init__.py +0 -0
  46. paperlab-0.1.0/tests/cli/test_cli.py +206 -0
  47. paperlab-0.1.0/tests/cli/test_cli_web.py +22 -0
  48. paperlab-0.1.0/tests/cli/test_config.py +100 -0
  49. paperlab-0.1.0/tests/ingest/__init__.py +0 -0
  50. paperlab-0.1.0/tests/ingest/test_pdf.py +144 -0
  51. paperlab-0.1.0/tests/orchestrator/__init__.py +0 -0
  52. paperlab-0.1.0/tests/orchestrator/test_runner.py +101 -0
  53. paperlab-0.1.0/tests/prompts/__init__.py +0 -0
  54. paperlab-0.1.0/tests/prompts/test_loader.py +48 -0
  55. paperlab-0.1.0/tests/providers/__init__.py +0 -0
  56. paperlab-0.1.0/tests/providers/test_base.py +28 -0
  57. paperlab-0.1.0/tests/providers/test_factory.py +38 -0
  58. paperlab-0.1.0/tests/providers/test_fake.py +52 -0
  59. paperlab-0.1.0/tests/providers/test_litellm.py +48 -0
  60. paperlab-0.1.0/tests/sessions/__init__.py +0 -0
  61. paperlab-0.1.0/tests/sessions/test_export.py +108 -0
  62. paperlab-0.1.0/tests/sessions/test_store.py +150 -0
  63. paperlab-0.1.0/tests/test_smoke.py +18 -0
  64. paperlab-0.1.0/tests/test_version.py +23 -0
  65. paperlab-0.1.0/tests/web/__init__.py +0 -0
  66. paperlab-0.1.0/tests/web/test_build.py +64 -0
  67. paperlab-0.1.0/tests/web/test_process.py +67 -0
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: pip
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install -e ".[dev]"
29
+
30
+ - name: Ruff format check
31
+ run: ruff format --check .
32
+
33
+ - name: Ruff check
34
+ run: ruff check .
35
+
36
+ - name: Mypy
37
+ run: mypy src/paperlab || true
38
+
39
+ - name: Run tests
40
+ run: pytest -q
@@ -0,0 +1,28 @@
1
+ name: publish
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+ environment: pypi
12
+ permissions:
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+ - name: Build sdist and wheel
20
+ run: |
21
+ python -m pip install --upgrade pip build
22
+ python -m build
23
+ - name: Check package metadata
24
+ run: |
25
+ python -m pip install twine
26
+ python -m twine check dist/*
27
+ - name: Publish to PyPI
28
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,41 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ dist/
8
+ *.egg-info/
9
+ .eggs/
10
+ *.egg
11
+
12
+ .venv/
13
+ venv/
14
+ env/
15
+ ENV/
16
+
17
+ .pytest_cache/
18
+ .mypy_cache/
19
+ .ruff_cache/
20
+ .coverage
21
+ htmlcov/
22
+ .tox/
23
+
24
+ .env
25
+ .env.local
26
+ *.log
27
+
28
+ .idea/
29
+ .vscode/
30
+ *.swp
31
+ .DS_Store
32
+
33
+ # paperlab runtime data (should live in ~/.paperlab, not the repo)
34
+ .paperlab/
35
+ # Ignore top-level sessions/ dir (runtime data), but not src/tests subdirectories
36
+ /sessions/
37
+ *.jsonl.bak
38
+
39
+ # scratch and experiments
40
+ scratchpad/
41
+ .scratch/
@@ -0,0 +1,39 @@
1
+ # Contributing to paperlab
2
+
3
+ Thanks for wanting to help. This project is built to serve students and researchers reading biomedical papers — practical contributions matter more than theoretical polish.
4
+
5
+ ## How you can help
6
+
7
+ - **Report bugs** — open an issue with the PDF that broke it (if shareable), your OS, and the exact command.
8
+ - **Improve prompts** — the agents in `src/paperlab/prompts/` are YAML files. Better prompts = better reviews. PRs welcome.
9
+ - **Add a benchmark paper** — `tests/benchmark/` holds papers with expected critiques. More examples = more accurate agents.
10
+ - **Add a domain profile** — biomed is the default, but pharma subfields (oncology, immunology, PK/PD) can have their own critique rubrics.
11
+ - **Improve docs** — especially for non-programmers. Screenshots, videos, translations.
12
+
13
+ ## Development setup
14
+
15
+ ```bash
16
+ git clone https://github.com/zhakhatoff/paperlab
17
+ cd paperlab
18
+ python -m venv .venv
19
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
20
+ pip install -e ".[dev]"
21
+ pytest
22
+ ```
23
+
24
+ ## Code style
25
+
26
+ - `ruff format` and `ruff check` before commit
27
+ - Type hints on public APIs
28
+ - Tests for anything non-trivial
29
+
30
+ ## Branches and PRs
31
+
32
+ - `main` is protected
33
+ - Branch names: `feat/`, `fix/`, `docs/`, `chore/`
34
+ - Keep PRs small and focused
35
+ - One approval to merge
36
+
37
+ ## Questions
38
+
39
+ Open a GitHub Discussion or issue. Russian and English are both fine.
paperlab-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 paperlab 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,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: paperlab
3
+ Version: 0.1.0
4
+ Summary: Multi-agent LLM tool for critically reading biomedical and pharmacology research papers
5
+ Project-URL: Homepage, https://github.com/zhakhatoff/paperlab
6
+ Project-URL: Repository, https://github.com/zhakhatoff/paperlab
7
+ Project-URL: Issues, https://github.com/zhakhatoff/paperlab/issues
8
+ Author: paperlab contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,biomedical,llm,pdf,pharmacology,research,science
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: docling>=2.0.0
20
+ Requires-Dist: gradio>=5.0.0
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: langgraph>=0.2.0
23
+ Requires-Dist: litellm>=1.50.0
24
+ Requires-Dist: paper-qa>=5.0.0
25
+ Requires-Dist: pydantic>=2.8.0
26
+ Requires-Dist: python-dotenv>=1.0.0
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: rich>=13.7.0
29
+ Requires-Dist: tomli-w>=1.0.0
30
+ Requires-Dist: typer>=0.12.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.11.0; extra == 'dev'
33
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
34
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # paperlab
39
+
40
+ [English](#english) | [Русский](#русский)
41
+
42
+ ---
43
+
44
+ ## English
45
+
46
+ **paperlab** is an open-source multi-agent LLM tool for critically reading biomedical and pharmacology research papers. Local by default, provider-agnostic, built for students and researchers.
47
+
48
+ ### What it does
49
+
50
+ You give paperlab a PDF of a research paper. Four AI agents read it in parallel:
51
+
52
+ - **Summarizer** — what the paper actually claims
53
+ - **Methodologist** — study design, CONSORT/PRISMA/STROBE compliance, reproducibility
54
+ - **Critic** — statistical weaknesses, p-hacking, cherry-picking, conflicts of interest
55
+ - **Contextualizer** — where this fits in the field, related work
56
+
57
+ You get a structured report in Markdown or JSON. Two modes:
58
+
59
+ - `rigorous` — strict peer-review style critique for postgrads and researchers
60
+ - `learning` — gentle explanation for undergraduates reading their first papers
61
+
62
+ Two output languages: English or Russian.
63
+
64
+ ### Install
65
+
66
+ ```bash
67
+ pipx install paperlab
68
+ paperlab init
69
+ ```
70
+
71
+ `paperlab init` creates `~/.paperlab/` with a default `config.toml` and a `sessions/` subdirectory. Run with `--force` to overwrite an existing config.
72
+
73
+ ### Use
74
+
75
+ ```bash
76
+ paperlab read paper.pdf --mode rigorous --lang en
77
+ paperlab read paper.pdf --mode learning --lang ru --provider ollama --model qwen2.5:7b
78
+ paperlab list # your review history
79
+ paperlab show <session-id> # revisit a past review
80
+ paperlab web # open the browser dashboard (phase 8)
81
+ ```
82
+
83
+ Output format:
84
+
85
+ ```bash
86
+ paperlab read paper.pdf --format markdown # default
87
+ paperlab read paper.pdf --format json --output report.json
88
+ ```
89
+
90
+ ### Providers
91
+
92
+ paperlab uses [LiteLLM](https://github.com/BerriAI/litellm) under the hood, so any of these work out of the box:
93
+
94
+ - `ollama` (local, default, free)
95
+ - `openrouter` (unified access to GPT, Claude, Gemini, Llama, etc.)
96
+ - `together`, `groq`, `gemini`, `anthropic`, `openai`
97
+ - `custom` (any OpenAI-compatible endpoint, e.g. your university's GPU cluster)
98
+
99
+ Switch with `paperlab config set provider ollama` or pass `--provider` per invocation.
100
+
101
+ ### Config
102
+
103
+ ```bash
104
+ paperlab config get provider # print current value
105
+ paperlab config set provider openai # update config.toml
106
+ paperlab config set model gpt-4o
107
+ paperlab config set extra.base_url http://localhost:11434
108
+ ```
109
+
110
+ Config is stored in `~/.paperlab/config.toml` (or `$PAPERLAB_HOME/config.toml`).
111
+
112
+ ### Privacy
113
+
114
+ Everything runs locally. PDFs never leave your machine unless you explicitly configure a cloud provider. History is stored in `~/.paperlab/sessions/` as JSONL — grep, back up, delete freely.
115
+
116
+ ### Contributing
117
+
118
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
119
+
120
+ ### License
121
+
122
+ MIT
123
+
124
+ ---
125
+
126
+ ## Русский
127
+
128
+ **paperlab** — open source инструмент для критического чтения биомедицинских и фармакологических научных статей с помощью команды ИИ-агентов. Локальный по умолчанию, поддерживает разных провайдеров, сделан для студентов и исследователей.
129
+
130
+ ### Что делает
131
+
132
+ Вы даёте paperlab PDF научной статьи. Четыре агента читают её параллельно:
133
+
134
+ - **Summarizer** — что статья реально утверждает
135
+ - **Methodologist** — дизайн исследования, соответствие CONSORT/PRISMA/STROBE, воспроизводимость
136
+ - **Critic** — статистические слабости, p-hacking, cherry-picking, конфликты интересов
137
+ - **Contextualizer** — место в поле, связь с литературой
138
+
139
+ Получаете структурированный разбор в Markdown или JSON. Два режима:
140
+
141
+ - `rigorous` — жёсткая критика в стиле peer-review для аспирантов и исследователей
142
+ - `learning` — мягкий разбор для студентов, читающих первые статьи
143
+
144
+ Два языка вывода: английский или русский.
145
+
146
+ ### Установка
147
+
148
+ ```bash
149
+ pipx install paperlab
150
+ paperlab init
151
+ ```
152
+
153
+ Команда `paperlab init` создаёт `~/.paperlab/` с дефолтным `config.toml` и поддиректорией `sessions/`. Флаг `--force` перезаписывает существующий конфиг.
154
+
155
+ ### Использование
156
+
157
+ ```bash
158
+ paperlab read paper.pdf --mode rigorous --lang ru
159
+ paperlab read paper.pdf --mode learning --lang en --provider ollama --model qwen2.5:7b
160
+ paperlab list # история разборов
161
+ paperlab show <session-id> # открыть прошлый разбор
162
+ paperlab web # веб-интерфейс в браузере (фаза 8)
163
+ ```
164
+
165
+ Формат вывода:
166
+
167
+ ```bash
168
+ paperlab read paper.pdf --format markdown # по умолчанию
169
+ paperlab read paper.pdf --format json --output report.json
170
+ ```
171
+
172
+ ### Провайдеры
173
+
174
+ Работает с любым из этих без изменений в коде:
175
+
176
+ - `ollama` (локально, по умолчанию, бесплатно)
177
+ - `openrouter` (единый доступ к GPT, Claude, Gemini, Llama и т.д.)
178
+ - `together`, `groq`, `gemini`, `anthropic`, `openai`
179
+ - `custom` (любой OpenAI-совместимый endpoint)
180
+
181
+ Переключение: `paperlab config set provider ollama` или флаг `--provider` при запуске.
182
+
183
+ ### Конфигурация
184
+
185
+ ```bash
186
+ paperlab config get provider # показать текущее значение
187
+ paperlab config set provider openai # обновить config.toml
188
+ paperlab config set model gpt-4o
189
+ paperlab config set extra.base_url http://localhost:11434
190
+ ```
191
+
192
+ Конфиг хранится в `~/.paperlab/config.toml` (или `$PAPERLAB_HOME/config.toml`).
193
+
194
+ ### Приватность
195
+
196
+ Всё работает локально. PDF не покидает вашу машину, если вы явно не настроили облачного провайдера. История хранится в `~/.paperlab/sessions/` в формате JSONL — можно грепать, бэкапить, удалять.
197
+
198
+ ### Участие в разработке
199
+
200
+ См. [CONTRIBUTING.md](CONTRIBUTING.md).
201
+
202
+ ### Лицензия
203
+
204
+ MIT
@@ -0,0 +1,167 @@
1
+ # paperlab
2
+
3
+ [English](#english) | [Русский](#русский)
4
+
5
+ ---
6
+
7
+ ## English
8
+
9
+ **paperlab** is an open-source multi-agent LLM tool for critically reading biomedical and pharmacology research papers. Local by default, provider-agnostic, built for students and researchers.
10
+
11
+ ### What it does
12
+
13
+ You give paperlab a PDF of a research paper. Four AI agents read it in parallel:
14
+
15
+ - **Summarizer** — what the paper actually claims
16
+ - **Methodologist** — study design, CONSORT/PRISMA/STROBE compliance, reproducibility
17
+ - **Critic** — statistical weaknesses, p-hacking, cherry-picking, conflicts of interest
18
+ - **Contextualizer** — where this fits in the field, related work
19
+
20
+ You get a structured report in Markdown or JSON. Two modes:
21
+
22
+ - `rigorous` — strict peer-review style critique for postgrads and researchers
23
+ - `learning` — gentle explanation for undergraduates reading their first papers
24
+
25
+ Two output languages: English or Russian.
26
+
27
+ ### Install
28
+
29
+ ```bash
30
+ pipx install paperlab
31
+ paperlab init
32
+ ```
33
+
34
+ `paperlab init` creates `~/.paperlab/` with a default `config.toml` and a `sessions/` subdirectory. Run with `--force` to overwrite an existing config.
35
+
36
+ ### Use
37
+
38
+ ```bash
39
+ paperlab read paper.pdf --mode rigorous --lang en
40
+ paperlab read paper.pdf --mode learning --lang ru --provider ollama --model qwen2.5:7b
41
+ paperlab list # your review history
42
+ paperlab show <session-id> # revisit a past review
43
+ paperlab web # open the browser dashboard (phase 8)
44
+ ```
45
+
46
+ Output format:
47
+
48
+ ```bash
49
+ paperlab read paper.pdf --format markdown # default
50
+ paperlab read paper.pdf --format json --output report.json
51
+ ```
52
+
53
+ ### Providers
54
+
55
+ paperlab uses [LiteLLM](https://github.com/BerriAI/litellm) under the hood, so any of these work out of the box:
56
+
57
+ - `ollama` (local, default, free)
58
+ - `openrouter` (unified access to GPT, Claude, Gemini, Llama, etc.)
59
+ - `together`, `groq`, `gemini`, `anthropic`, `openai`
60
+ - `custom` (any OpenAI-compatible endpoint, e.g. your university's GPU cluster)
61
+
62
+ Switch with `paperlab config set provider ollama` or pass `--provider` per invocation.
63
+
64
+ ### Config
65
+
66
+ ```bash
67
+ paperlab config get provider # print current value
68
+ paperlab config set provider openai # update config.toml
69
+ paperlab config set model gpt-4o
70
+ paperlab config set extra.base_url http://localhost:11434
71
+ ```
72
+
73
+ Config is stored in `~/.paperlab/config.toml` (or `$PAPERLAB_HOME/config.toml`).
74
+
75
+ ### Privacy
76
+
77
+ Everything runs locally. PDFs never leave your machine unless you explicitly configure a cloud provider. History is stored in `~/.paperlab/sessions/` as JSONL — grep, back up, delete freely.
78
+
79
+ ### Contributing
80
+
81
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
82
+
83
+ ### License
84
+
85
+ MIT
86
+
87
+ ---
88
+
89
+ ## Русский
90
+
91
+ **paperlab** — open source инструмент для критического чтения биомедицинских и фармакологических научных статей с помощью команды ИИ-агентов. Локальный по умолчанию, поддерживает разных провайдеров, сделан для студентов и исследователей.
92
+
93
+ ### Что делает
94
+
95
+ Вы даёте paperlab PDF научной статьи. Четыре агента читают её параллельно:
96
+
97
+ - **Summarizer** — что статья реально утверждает
98
+ - **Methodologist** — дизайн исследования, соответствие CONSORT/PRISMA/STROBE, воспроизводимость
99
+ - **Critic** — статистические слабости, p-hacking, cherry-picking, конфликты интересов
100
+ - **Contextualizer** — место в поле, связь с литературой
101
+
102
+ Получаете структурированный разбор в Markdown или JSON. Два режима:
103
+
104
+ - `rigorous` — жёсткая критика в стиле peer-review для аспирантов и исследователей
105
+ - `learning` — мягкий разбор для студентов, читающих первые статьи
106
+
107
+ Два языка вывода: английский или русский.
108
+
109
+ ### Установка
110
+
111
+ ```bash
112
+ pipx install paperlab
113
+ paperlab init
114
+ ```
115
+
116
+ Команда `paperlab init` создаёт `~/.paperlab/` с дефолтным `config.toml` и поддиректорией `sessions/`. Флаг `--force` перезаписывает существующий конфиг.
117
+
118
+ ### Использование
119
+
120
+ ```bash
121
+ paperlab read paper.pdf --mode rigorous --lang ru
122
+ paperlab read paper.pdf --mode learning --lang en --provider ollama --model qwen2.5:7b
123
+ paperlab list # история разборов
124
+ paperlab show <session-id> # открыть прошлый разбор
125
+ paperlab web # веб-интерфейс в браузере (фаза 8)
126
+ ```
127
+
128
+ Формат вывода:
129
+
130
+ ```bash
131
+ paperlab read paper.pdf --format markdown # по умолчанию
132
+ paperlab read paper.pdf --format json --output report.json
133
+ ```
134
+
135
+ ### Провайдеры
136
+
137
+ Работает с любым из этих без изменений в коде:
138
+
139
+ - `ollama` (локально, по умолчанию, бесплатно)
140
+ - `openrouter` (единый доступ к GPT, Claude, Gemini, Llama и т.д.)
141
+ - `together`, `groq`, `gemini`, `anthropic`, `openai`
142
+ - `custom` (любой OpenAI-совместимый endpoint)
143
+
144
+ Переключение: `paperlab config set provider ollama` или флаг `--provider` при запуске.
145
+
146
+ ### Конфигурация
147
+
148
+ ```bash
149
+ paperlab config get provider # показать текущее значение
150
+ paperlab config set provider openai # обновить config.toml
151
+ paperlab config set model gpt-4o
152
+ paperlab config set extra.base_url http://localhost:11434
153
+ ```
154
+
155
+ Конфиг хранится в `~/.paperlab/config.toml` (или `$PAPERLAB_HOME/config.toml`).
156
+
157
+ ### Приватность
158
+
159
+ Всё работает локально. PDF не покидает вашу машину, если вы явно не настроили облачного провайдера. История хранится в `~/.paperlab/sessions/` в формате JSONL — можно грепать, бэкапить, удалять.
160
+
161
+ ### Участие в разработке
162
+
163
+ См. [CONTRIBUTING.md](CONTRIBUTING.md).
164
+
165
+ ### Лицензия
166
+
167
+ MIT
@@ -0,0 +1,50 @@
1
+ # paperlab architecture
2
+
3
+ High-level view of how the pieces fit together.
4
+
5
+ ## Data flow
6
+
7
+ ```
8
+ PDF file
9
+
10
+
11
+ [ingest] docling → structured Document (+ optional GROBID for references)
12
+
13
+
14
+ [orchestrator] LangGraph DAG
15
+
16
+ ├── Summarizer ──┐
17
+ ├── Methodologist ──┤
18
+ ├── Critic ──┼──► Merge
19
+ └── Contextualizer ──┘ (paper-qa retrieval for citations)
20
+
21
+
22
+ Report (Markdown + JSON) → ~/.paperlab/sessions/<id>.jsonl
23
+ ```
24
+
25
+ ## Modules
26
+
27
+ | Module | Responsibility |
28
+ |---|---|
29
+ | `ingest/` | PDF → structured Document via docling; optional GROBID sidecar |
30
+ | `agents/` | Prompt loading, per-agent LLM calls, output schemas |
31
+ | `orchestrator/` | LangGraph state machine, token budgeting, streaming |
32
+ | `providers/` | LiteLLM wrapper: Ollama / OpenRouter / Together / Gemini / Anthropic / custom |
33
+ | `cli/` | Typer commands: init, config, read, list, show, web |
34
+ | `web/` | Gradio dashboard, reuses core modules |
35
+ | `prompts/` | YAML files: 4 agents × 2 modes × 2 languages |
36
+
37
+ ## Key design decisions
38
+
39
+ - **Local by default.** Ollama is the default provider so anything works offline and free.
40
+ - **One LLM abstraction.** LiteLLM handles all providers — no bespoke wrappers.
41
+ - **Prompts as data.** YAML in `prompts/` so users and contributors can iterate without touching Python.
42
+ - **JSONL session log.** Same pattern as codbash — grep-friendly, easy to back up.
43
+ - **CLI and web share the core.** `paperlab read` and `paperlab web` both call the same orchestrator.
44
+
45
+ ## Non-goals for 0.1.0
46
+
47
+ - Uploading data to a cloud service
48
+ - Training or fine-tuning models
49
+ - Non-biomedical domains (comes later via profile system)
50
+ - Non-PDF inputs (comes later)
@@ -0,0 +1,43 @@
1
+ # User research — Week 1 interviews
2
+
3
+ Target: 5 postgraduate students or researchers in biomedicine, pharmacology, biochemistry, or molecular biology who read papers regularly.
4
+
5
+ ## Interview script
6
+
7
+ Introduce paperlab in one sentence, then ask:
8
+
9
+ ### Current workflow
10
+
11
+ 1. How do you decide which papers to read this week? What's your source (PubMed alert, journal RSS, supervisor, Twitter)?
12
+ 2. Walk me through the last paper you read. How long did it take? What did you skim vs read carefully?
13
+ 3. What tools do you use? (Zotero, Mendeley, Notion, plain PDF reader, ChatGPT, NotebookLM, Elicit, SciSpace?)
14
+ 4. What frustrates you about reading papers?
15
+
16
+ ### Critique needs
17
+
18
+ 5. When you review a paper, what do you check for in methodology? Do you follow any checklist (CONSORT, PRISMA, STROBE)?
19
+ 6. Have you ever missed a methodological problem in a paper and only caught it later?
20
+ 7. Would you trust an AI to point out weaknesses in a paper? Under what conditions?
21
+
22
+ ### paperlab specific
23
+
24
+ 8. Two modes — rigorous (peer-review style) vs learning (gentle explanation). Which would you use?
25
+ 9. Would you run a tool locally on your laptop, or do you prefer a web app?
26
+ 10. Do you have a GPU? Would 3–5 minutes per paper on CPU be acceptable?
27
+ 11. If it's free, open source, and runs locally — would you install it? What would stop you?
28
+
29
+ ### Willingness
30
+
31
+ 12. Would you try a beta version in month 2? Would you introduce it to your lab?
32
+
33
+ ## Notes template
34
+
35
+ For each interviewee:
36
+
37
+ - **Name / role / field:**
38
+ - **Current workflow:**
39
+ - **Biggest frustration:**
40
+ - **Would use rigorous / learning / both:**
41
+ - **Local vs cloud preference:**
42
+ - **Willing to beta test (Y/N):**
43
+ - **Follow-up ideas:**