Skip to content

Commit 6374795

Browse files
committed
Rename to Pathology Evidence AI
1 parent 064199d commit 6374795

26 files changed

Lines changed: 358 additions & 55 deletions

.env.example

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ APP_PORT=8000
44
OPENAI_API_KEY=
55
OPENAI_MODEL=gpt-5.4
66
OPENAI_EMBEDDING_MODEL=text-embedding-3-large
7-
PATHOLOGY_PROJECT_NAME=Pathology RAG Workbench
8-
PATHOLOGY_PROJECT_SLUG=pathology-rag-workbench
9-
COMPOSE_PROJECT_NAME=pathology-rag-workbench
7+
PATHOLOGY_PROJECT_NAME=Pathology Evidence AI
8+
PATHOLOGY_PROJECT_SLUG=pathology-evidence-ai
9+
COMPOSE_PROJECT_NAME=pathology-evidence-ai
1010
PATHOLOGY_CLIENT_COMMAND=pathology-client
1111
PATHOLOGY_INGEST_COMMAND=pathology-ingest-local
12-
PATHOLOGY_OPENCLAW_SKILL_NAME=pathology-rag
12+
PATHOLOGY_OPENCLAW_SKILL_NAME=pathology-evidence-ai
1313
PATHOLOGY_INSTALL_GLOBAL_ALIAS=1
1414
PATHOLOGY_PDF_ROOT=pathologybook
1515
PATHOLOGY_DATA_DIR=data
@@ -24,4 +24,5 @@ POSTGRES_USER=pathology
2424
POSTGRES_PASSWORD=pathology
2525
POSTGRES_PORT=5432
2626
POSTGRES_URL=postgresql+psycopg://pathology:pathology@localhost:5432/pathology_ai
27+
POSTGRES_CONNECT_TIMEOUT=2
2728
OPENCLAW_PATHOLOGY_API=http://127.0.0.1:8000

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Security issue or unsafe data exposure
4-
url: https://github.com/hutaobo/pathology-rag-workbench/blob/main/SECURITY.md
4+
url: https://github.com/hutaobo/pathology-evidence-ai/blob/main/SECURITY.md
55
about: Please report security and sensitive-data issues privately first.
66
- name: Contribution guidelines
7-
url: https://github.com/hutaobo/pathology-rag-workbench/blob/main/CONTRIBUTING.md
7+
url: https://github.com/hutaobo/pathology-evidence-ai/blob/main/CONTRIBUTING.md
88
about: Read this before opening a pull request.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Thanks for contributing to Pathology RAG Workbench.
3+
Thanks for contributing to Pathology Evidence AI.
44

55
## Before You Open a PR
66

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Pathology RAG Workbench
1+
# Pathology Evidence AI
22

3-
[![CI](https://github.com/hutaobo/pathology-rag-workbench/actions/workflows/ci.yml/badge.svg)](https://github.com/hutaobo/pathology-rag-workbench/actions/workflows/ci.yml)
3+
[![CI](https://github.com/hutaobo/pathology-evidence-ai/actions/workflows/ci.yml/badge.svg)](https://github.com/hutaobo/pathology-evidence-ai/actions/workflows/ci.yml)
44
[![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-3776AB.svg)](https://www.python.org/)
55
[![License: PolyForm Noncommercial](https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-5B4B8A.svg)](LICENSE)
66

7-
Pathology RAG Workbench is a local-first pathology PDF workspace. It helps you turn your own licensed pathology books or notes into a citation-backed retrieval system with a browser UI, a local API, and a CLI.
7+
Pathology Evidence AI is a local-first pathology evidence workspace. It helps you turn your own licensed pathology books or notes into AI-assisted answers with citation-backed evidence, a browser UI, a local API, and a CLI.
88

99
This repository is public, but it is not open source in the OSI sense. It is released under the [PolyForm Noncommercial 1.0.0](LICENSE) license, so commercial use is not allowed.
1010

@@ -15,8 +15,8 @@ If you only read one section, read this one.
1515
Clone the repo and run:
1616

1717
```bash
18-
git clone https://github.com/hutaobo/pathology-rag-workbench.git
19-
cd pathology-rag-workbench
18+
git clone https://github.com/hutaobo/pathology-evidence-ai.git
19+
cd pathology-evidence-ai
2020
bash scripts/deploy_portable.sh --allow-no-openai
2121
```
2222

@@ -136,17 +136,30 @@ Even without an OpenAI key, you can:
136136
- sync the local library
137137
- inspect library state
138138
- run retrieval previews instead of model-synthesized answers
139+
- create a synthetic demo library with fake educational PDFs
139140

140141
Useful commands:
141142

142143
```bash
143144
pathology-client health
144145
pathology-client ui
146+
pathology-ingest create-demo-library
145147
pathology-client library
146148
pathology-client search --query "ductal carcinoma in situ"
147149
pathology-client sync-library
148150
```
149151

152+
## Try a Demo Library
153+
154+
If you do not have pathology PDFs ready yet, generate a tiny synthetic demo corpus:
155+
156+
```bash
157+
pathology-ingest create-demo-library
158+
pathology-client search --query "mucinous carcinoma of the prostate"
159+
```
160+
161+
The demo PDFs are fake educational notes created by this project. They are only meant to prove that ingestion, search, citations, and page previews are working.
162+
150163
## Add Your Own PDFs
151164

152165
No corpus is bundled with this repository.

apps/ingest_worker/cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from src.pathology_ai.embeddings import chunk_embedding_count, sync_chunk_embeddings
88
from src.pathology_ai.analysis import analyze_pdf
99
from src.pathology_ai.catalog import load_library_config
10+
from src.pathology_ai.demo_library import create_demo_library
1011
from src.pathology_ai.ingest import build_library_artifacts
1112
from src.pathology_ai.library_state import sync_local_library
1213

@@ -53,6 +54,15 @@ def sync_library(
5354
typer.echo(json.dumps(result, indent=2, ensure_ascii=False))
5455

5556

57+
@app.command("create-demo-library")
58+
def create_demo_library_command(
59+
force: bool = typer.Option(default=False, help="Replace existing demo PDFs before rebuilding the demo index."),
60+
skip_index: bool = typer.Option(default=False, help="Create/register demo PDFs without rebuilding chunks."),
61+
) -> None:
62+
result = create_demo_library(force=force, rebuild=not skip_index)
63+
typer.echo(json.dumps(result, indent=2, ensure_ascii=False))
64+
65+
5666
def main() -> None:
5767
app()
5868

apps/pathology_api/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from src.pathology_ai.settings import get_settings
1111

1212

13-
app = FastAPI(title="Pathology RAG Workbench API", version="0.1.0")
13+
app = FastAPI(title="Pathology Evidence AI API", version="0.1.0")
1414
static_dir = Path(__file__).resolve().parent / "static"
1515
app.mount("/assets", StaticFiles(directory=static_dir), name="assets")
1616
app.include_router(health.router)

apps/pathology_api/routers/rag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from src.pathology_ai.retrieval import search_chunks
55
from src.pathology_ai.schemas import AskRequest, AskResponse, SearchRequest, SearchHit
66

7-
router = APIRouter(tags=["rag"])
7+
router = APIRouter(tags=["evidence"])
88

99

1010
@router.post("/search", response_model=list[SearchHit])

apps/pathology_api/routers/ui.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ def _resolve_chunk_or_404(chunk_id: str):
2222
return chunk
2323

2424

25+
def _resolve_library_pdf_or_404(chunk_id: str) -> Path:
26+
chunk = _resolve_chunk_or_404(chunk_id)
27+
source_path = resolve_pdf_path(chunk.source_path)
28+
settings = get_settings()
29+
try:
30+
resolved_source = source_path.resolve(strict=True)
31+
resolved_root = settings.pathology_pdf_root.resolve(strict=True)
32+
except FileNotFoundError as exc:
33+
raise HTTPException(status_code=404, detail="Source PDF not found.") from exc
34+
35+
if resolved_source.suffix.lower() != ".pdf":
36+
raise HTTPException(status_code=404, detail="Source PDF not found.")
37+
try:
38+
resolved_source.relative_to(resolved_root)
39+
except ValueError as exc:
40+
raise HTTPException(status_code=403, detail="Source PDF is outside the configured library root.") from exc
41+
return resolved_source
42+
43+
2544
def _render_page_image(chunk_id: str, width: int = 1200) -> Path:
2645
chunk = _resolve_chunk_or_404(chunk_id)
2746
settings = get_settings()
@@ -31,9 +50,7 @@ def _render_page_image(chunk_id: str, width: int = 1200) -> Path:
3150
if image_path.exists():
3251
return image_path
3352

34-
source_path = resolve_pdf_path(chunk.source_path)
35-
if not source_path.exists():
36-
raise HTTPException(status_code=404, detail="Source PDF not found.")
53+
source_path = _resolve_library_pdf_or_404(chunk_id)
3754

3855
with fitz.open(source_path) as document:
3956
page_index = chunk.page_start - 1
@@ -64,8 +81,5 @@ def chunk_page_image(chunk_id: str, width: int = Query(default=1200, ge=600, le=
6481

6582
@router.get("/chunks/{chunk_id}/pdf", include_in_schema=False)
6683
def chunk_pdf(chunk_id: str) -> FileResponse:
67-
chunk = _resolve_chunk_or_404(chunk_id)
68-
source_path = resolve_pdf_path(chunk.source_path)
69-
if not source_path.exists():
70-
raise HTTPException(status_code=404, detail="Source PDF not found.")
84+
source_path = _resolve_library_pdf_or_404(chunk_id)
7185
return FileResponse(source_path, media_type="application/pdf", filename=source_path.name)

apps/pathology_api/static/pathology-ui.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<title>Pathology AI Reader</title>
6+
<title>Pathology Evidence AI</title>
77
<link rel="stylesheet" href="/assets/pathology-ui.css" />
88
</head>
99
<body>
@@ -12,10 +12,10 @@
1212
<section class="hero">
1313
<div class="hero-bar">
1414
<div>
15-
<p class="eyebrow" id="hero-eyebrow">Pathology RAG Workbench</p>
16-
<h1 id="hero-title">Ask your local pathology library like a reference atlas.</h1>
15+
<p class="eyebrow" id="hero-eyebrow">Pathology Evidence AI</p>
16+
<h1 id="hero-title">Pathology Evidence AI</h1>
1717
<p class="lede" id="hero-lede">
18-
Textbook-backed answers, page previews, and direct PDF evidence from your local collection.
18+
Use local pathology PDFs for AI answers with citation-backed evidence.
1919
</p>
2020
</div>
2121
<div class="hero-controls">

apps/pathology_api/static/pathology-ui.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ const state = {
5757
};
5858
const TRANSLATIONS = {
5959
en: {
60-
pageTitle: "Pathology AI Reader",
61-
heroEyebrow: "Pathology RAG Workbench",
62-
heroTitle: "Ask your local pathology library like a reference atlas.",
63-
heroLede: "Textbook-backed answers, page previews, and direct PDF evidence from your local collection.",
60+
pageTitle: "Pathology Evidence AI",
61+
heroEyebrow: "Pathology Evidence AI",
62+
heroTitle: "Pathology Evidence AI",
63+
heroLede: "Use local pathology PDFs for AI answers with citation-backed evidence.",
6464
languageLabel: "Interface & answer language",
6565
themeLabel: "Color mode",
6666
themeLight: "Light",
@@ -134,10 +134,10 @@ const TRANSLATIONS = {
134134
],
135135
},
136136
sv: {
137-
pageTitle: "Pathology AI Reader",
138-
heroEyebrow: "Patologi RAG-arbetsyta",
139-
heroTitle: "Fråga ditt lokala patologibibliotek som om det vore ett referensatlas.",
140-
heroLede: "Läroboksbaserade svar, sidförhandsvisningar och direkt PDF-evidens från din lokala samling.",
137+
pageTitle: "Pathology Evidence AI",
138+
heroEyebrow: "Pathology Evidence AI",
139+
heroTitle: "Pathology Evidence AI",
140+
heroLede: "Use local pathology PDFs for AI answers with citation-backed evidence.",
141141
languageLabel: "Språk för gränssnitt och svar",
142142
themeLabel: "Färgläge",
143143
themeLight: "Ljust",
@@ -184,10 +184,10 @@ const TRANSLATIONS = {
184184
],
185185
},
186186
"zh-CN": {
187-
pageTitle: "Pathology AI Reader",
188-
heroEyebrow: "病理 RAG 工作台",
189-
heroTitle: "像查阅参考图谱一样提问你的本地病理资料库。",
190-
heroLede: "基于教材证据的回答、页码预览,以及直接指向本地 PDF 的证据链。",
187+
pageTitle: "Pathology Evidence AI",
188+
heroEyebrow: "Pathology Evidence AI",
189+
heroTitle: "Pathology Evidence AI",
190+
heroLede: "Use local pathology PDFs for AI answers with citation-backed evidence.",
191191
languageLabel: "界面与回答语言",
192192
themeLabel: "配色模式",
193193
themeLight: "浅色",
@@ -260,10 +260,10 @@ const TRANSLATIONS = {
260260
],
261261
},
262262
ja: {
263-
pageTitle: "Pathology AI Reader",
264-
heroEyebrow: "病理 RAG ワークベンチ",
265-
heroTitle: "ローカル病理ライブラリを参照アトラスのように検索できます。",
266-
heroLede: "教科書根拠の回答、ページプレビュー、ローカル PDF への直接リンクをまとめて確認できます。",
263+
pageTitle: "Pathology Evidence AI",
264+
heroEyebrow: "Pathology Evidence AI",
265+
heroTitle: "Pathology Evidence AI",
266+
heroLede: "Use local pathology PDFs for AI answers with citation-backed evidence.",
267267
languageLabel: "UI と回答言語",
268268
themeLabel: "カラーモード",
269269
themeLight: "ライト",

0 commit comments

Comments
 (0)