Skip to content

Commit bcea13a

Browse files
authored
Merge pull request #69 from ZimoLiao/issue-52-3
Implement ingest-link web ingestion flow
2 parents 8a72747 + a9a66c6 commit bcea13a

20 files changed

Lines changed: 1373 additions & 26 deletions
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
name: ingest-link
3+
description: Use when the user wants to ingest one or more web URLs into ScholarAIO, convert rendered web content into Markdown through qt-web-extractor, or turn an online page/PDF into a normal document-ingest workflow.
4+
---
5+
6+
# Ingest Web Links
7+
8+
Use this skill when the user already has one or more URLs and wants them pulled into the ScholarAIO library as document-style records.
9+
10+
## When to Use
11+
12+
Use this skill when the user wants to:
13+
14+
- ingest a webpage directly into the local knowledge base
15+
- ingest an online PDF or report from a URL
16+
- capture technical documentation, standards, manuals, or web articles as `document` items
17+
- route rendered web content through the normal ScholarAIO ingest/index flow
18+
19+
Do not use this skill when:
20+
21+
- the task is only to search the local library; use `search`
22+
- the task is mainly about arXiv preprints; use `arxiv`
23+
- the user only wants broad web discovery without ingesting; use external web search first, then come back if ingestion is desired
24+
25+
## Core Workflow
26+
27+
### 1. Confirm the source shape
28+
29+
- If the user already provides URL(s), go straight to `scholaraio ingest-link`
30+
- If the user only has a topic but no URL, discover URLs first through external web search, then ingest selected results
31+
32+
### 2. Use the CLI entrypoint
33+
34+
Basic ingestion:
35+
36+
```bash
37+
scholaraio ingest-link https://example.com/page
38+
scholaraio ingest-link https://example.com/page https://example.com/report.pdf
39+
```
40+
41+
Preview only:
42+
43+
```bash
44+
scholaraio ingest-link https://example.com/page --dry-run
45+
```
46+
47+
Ingest without rebuilding indexes immediately:
48+
49+
```bash
50+
scholaraio ingest-link https://example.com/page --no-index
51+
```
52+
53+
Force PDF extraction mode when the backend needs a hint:
54+
55+
```bash
56+
scholaraio ingest-link https://example.com/report.pdf --pdf
57+
```
58+
59+
### 3. Keep the backend model clear
60+
61+
- ScholarAIO does not render webpages itself in this flow
62+
- It depends on an external `qt-web-extractor` service
63+
- The value of that service is rendered-content extraction, not just raw HTML download
64+
- Default endpoint: `http://127.0.0.1:8766`
65+
- Override with `WEBEXTRACT_URL`
66+
67+
### 4. Understand what gets stored
68+
69+
- The extracted page is written into a temporary document inbox
70+
- ScholarAIO reuses the existing document ingest flow
71+
- Final records stay in the current `document` family, not a separate `webdocument` type
72+
- Provenance fields such as `source_url`, `source_type`, and `extraction_method` are preserved in `meta.json`
73+
74+
## Practical Heuristics
75+
76+
- Prefer `--no-index` when ingesting many links and you plan to rebuild once at the end
77+
- Let the backend auto-detect normal web pages and PDF URLs first; prefer `--pdf` only when detection seems unreliable
78+
- If the backend is unavailable, report that clearly instead of pretending ScholarAIO can fetch/render the page alone
79+
80+
## Output Style
81+
82+
- Make it clear that the content came from a URL rather than a local file
83+
- Mention the source URL in summaries when it matters
84+
- If ingestion fails, surface the backend/service reason directly

.claude/skills/ingest/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ scholaraio proceedings apply-clean <proceeding_dir> <clean_plan.json>
123123
用户说:"我放了几篇新论文到 inbox,帮我入库"
124124
→ 执行 `pipeline ingest`
125125

126+
用户说:"把这个网页/在线 PDF 直接收进库里"
127+
→ 不要先让用户手动放 inbox,优先使用 `scholaraio ingest-link <url>`(它会通过 `qt-web-extractor` 抓取渲染后的网页内容或在线 PDF)
128+
126129
用户说:"把新论文全部处理完,包括提取目录和结论"
127130
→ 执行 `pipeline full`
128131

AGENTS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The right mental model is to treat skills as "reusable workflows": when the user
4848
Knowledge base management:
4949
- `search` - When the user wants to find papers, search authors, or run keyword / semantic / hybrid retrieval, start with this skill.
5050
- `arxiv` - When the user wants to browse arXiv preprints, search arXiv directly, or fetch a preprint PDF into inbox or ingest, use this skill.
51+
- `ingest-link` - When the user wants to ingest one or more rendered web URLs or online PDFs into the library through `qt-web-extractor`, use this skill.
5152
- `show` - When the user wants to read paper metadata, abstract, conclusion, or full text, use this skill for progressive L1-L4 loading.
5253
- `enrich` - When the user wants to add TOC, conclusion, abstract, citation counts, or other enrichment fields, use this skill.
5354
- `ingest` - When the user wants to process inbox items, ingest PDF / Office / Markdown files, and rebuild indexes, use this skill.
@@ -181,7 +182,7 @@ Workflow:
181182
| `citation_styles.py` | Citation style management (built-in APA/Vancouver/Chicago/MLA + dynamically loaded custom styles stored in `data/citation_styles/`) |
182183
| `citation_check.py` | Citation verification (extract author-year citations from text + cross-check against the local library) |
183184
| `audit.py` | Data-quality auditing + repair |
184-
| `sources/` | External source adapters (endnote / zotero / arxiv) |
185+
| `sources/` | External source adapters (endnote / zotero / arxiv / webtools) |
185186
| `cli.py` | Main CLI entry point |
186187
| `setup.py` | Environment detection + setup wizard |
187188
| `metrics.py` | LLM token usage + API timing |
@@ -194,7 +195,7 @@ Besides skills, the current CLI also provides several important capabilities wor
194195
- Retrieval-related: `search-author`, `embed`, `vsearch`, `usearch`, `fsearch`, `top-cited`
195196
- Graph-related: `refs`, `citing`, `shared-refs`
196197
- Enrichment and repair: `enrich-toc`, `enrich-l3`, `backfill-abstract`, `refetch`, `repair`
197-
- Data maintenance: `attach-pdf`
198+
- Data maintenance: `attach-pdf`, `ingest-link`
198199
- Workspace: `ws` (subcommands such as `init`, `add`, `remove`, `show`, `search`, `export`, and more)
199200
- Proceedings: `proceedings` (`apply-split`, `build-clean-candidates`, `apply-clean`) and `fsearch --scope proceedings`
200201
- External and scientific runtime: `arxiv`, `toolref`, `insights`, `style`, `document`
@@ -387,7 +388,7 @@ data/explore/<name>/
387388
### `sources/` Abstraction Layer
388389

389390
`papers.py` is the path-helper layer for the local library under `data/papers/`, and modules use it directly to iterate paper directories and read `meta.json`.
390-
`sources/` holds external-source adapters such as arXiv, Endnote, and Zotero.
391+
`sources/` holds external-source adapters such as arXiv, Endnote, Zotero, and webtools-style HTTP backends.
391392

392393
## Configuration
393394

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1313
- **Academic writing router** ([#55](https://github.com/ZimoLiao/scholaraio/issues/55)): Added the `academic-writing` skill as a stable top-level entry point that routes users by deliverable and writing stage instead of forcing them to guess among multiple writing skills
1414
- **Deliverable-first writing workflows** ([#55](https://github.com/ZimoLiao/scholaraio/issues/55)): Added lightweight `poster` and `technical-report` skills so conference posters, poster-style summaries, topic reports, and research briefings are first-class workflows rather than implicit combinations of lower-level skills
1515
- **Writing workflow regression coverage**: Added tests for skill frontmatter validity, router references, approximate host-style skill selection, and 11 rounds of documentation-alignment checks across docs, agent instructions, and marketplace metadata
16+
- **Rendered web URL ingestion** ([#52](https://github.com/ZimoLiao/scholaraio/issues/52)): Added the native `scholaraio ingest-link` CLI, `ingest-link` skill, and `sources.webtools` connector flow so webpages and online PDFs can be ingested through an external `qt-web-extractor` daemon while preserving provenance fields such as `source_url`, `source_type`, `extracted_at`, and `extraction_method`
1617

1718
### Fixed
1819

1920
- **macOS semantic/unified search crash** ([#65](https://github.com/ZimoLiao/scholaraio/issues/65)): main-library and explore semantic search now embed and normalize the query before loading or searching FAISS indexes, avoiding a known `faiss` / `sentence-transformers` import-order segfault pattern on macOS while preserving existing ranking behavior
2021
- **Academic writing docs alignment** ([#55](https://github.com/ZimoLiao/scholaraio/issues/55)): Synchronized `docs/guide/writing.md`, `README.md`, `README_CN.md`, `docs/index.md`, `AGENTS.md`, `AGENTS_CN.md`, `CLAUDE.md`, and `clawhub.yaml` around a router-first writing model so poster/report workflows and the academic-writing entry point are discoverable consistently across user and agent surfaces
22+
- **`ingest-link` reliability and isolation** ([#52](https://github.com/ZimoLiao/scholaraio/issues/52)): URL ingest now preserves extractor PDF autodetect unless `--pdf` is explicitly requested, isolates both temporary inboxes from the real library, skips only failed URLs in multi-link batches, keeps warning-bearing extractions with usable text, retries transient extraction failures with exponential backoff, and avoids overlong fallback filenames for title-less URLs
2123

2224
## [1.3.1] — 2026-04-14
2325

CLAUDE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The right mental model is to treat skills as "reusable workflows": when the user
4848
Knowledge base management:
4949
- `search` - When the user wants to find papers, search authors, or run keyword / semantic / hybrid retrieval, start with this skill.
5050
- `arxiv` - When the user wants to browse arXiv preprints, search arXiv directly, or fetch a preprint PDF into inbox or ingest, use this skill.
51+
- `ingest-link` - When the user wants to ingest one or more rendered web URLs or online PDFs into the library through `qt-web-extractor`, use this skill.
5152
- `show` - When the user wants to read paper metadata, abstract, conclusion, or full text, use this skill for progressive L1-L4 loading.
5253
- `enrich` - When the user wants to add TOC, conclusion, abstract, citation counts, or other enrichment fields, use this skill.
5354
- `ingest` - When the user wants to process inbox items, ingest PDF / Office / Markdown files, and rebuild indexes, use this skill.
@@ -181,7 +182,7 @@ Workflow:
181182
| `citation_styles.py` | Citation style management (built-in APA/Vancouver/Chicago/MLA + dynamically loaded custom styles stored in `data/citation_styles/`) |
182183
| `citation_check.py` | Citation verification (extract author-year citations from text + cross-check against the local library) |
183184
| `audit.py` | Data-quality auditing + repair |
184-
| `sources/` | External source adapters (endnote / zotero / arxiv) |
185+
| `sources/` | External source adapters (endnote / zotero / arxiv / webtools) |
185186
| `cli.py` | Main CLI entry point |
186187
| `setup.py` | Environment detection + setup wizard |
187188
| `metrics.py` | LLM token usage + API timing |
@@ -194,7 +195,7 @@ Besides skills, the current CLI also provides several important capabilities wor
194195
- Retrieval-related: `search-author`, `embed`, `vsearch`, `usearch`, `fsearch`, `top-cited`
195196
- Graph-related: `refs`, `citing`, `shared-refs`
196197
- Enrichment and repair: `enrich-toc`, `enrich-l3`, `backfill-abstract`, `refetch`, `repair`
197-
- Data maintenance: `attach-pdf`
198+
- Data maintenance: `attach-pdf`, `ingest-link`
198199
- Workspace: `ws` (subcommands such as `init`, `add`, `remove`, `show`, `search`, `export`, and more)
199200
- Proceedings: `proceedings` (`apply-split`, `build-clean-candidates`, `apply-clean`) and `fsearch --scope proceedings`
200201
- External and scientific runtime: `arxiv`, `toolref`, `insights`, `style`, `document`
@@ -387,7 +388,7 @@ data/explore/<name>/
387388
### `sources/` Abstraction Layer
388389

389390
`papers.py` is the path-helper layer for the local library under `data/papers/`, and modules use it directly to iterate paper directories and read `meta.json`.
390-
`sources/` holds external-source adapters such as arXiv, Endnote, and Zotero.
391+
`sources/` holds external-source adapters such as arXiv, Endnote, Zotero, and webtools-style HTTP backends.
391392

392393
## Configuration
393394

docs/guide/cli-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ scholaraio top-cited
3535

3636
```text
3737
scholaraio pipeline [preset]
38+
scholaraio ingest-link <url> [<url> ...]
3839
scholaraio enrich-toc
3940
scholaraio enrich-l3
4041
scholaraio backfill-abstract
@@ -44,6 +45,7 @@ scholaraio attach-pdf
4445
```
4546

4647
- `pipeline` is the main composable ingest entrypoint.
48+
- `ingest-link` pulls one or more rendered web URLs or online PDFs through an external `qt-web-extractor` service and routes them into the existing document ingest flow.
4749
- Current preset values are `full`, `ingest`, `enrich`, and `reindex`.
4850
- Run `scholaraio pipeline --help` for pipeline options such as `--steps`, `--dry-run`, `--no-api`, and `--rebuild`.
4951

docs/guide/webtools-integration.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,56 @@
1-
# Claude Webtools Integration (Optional)
1+
# Webtools Integration (Optional)
22

33
ScholarAIO is agent-first: users talk to an agent, and the agent orchestrates local ScholarAIO skills.
4-
If you also want live web search/extraction, you can integrate [AnterCreeper/claude-webtools](https://github.com/AnterCreeper/claude-webtools) as an external capability layer.
4+
If you also want live web search/extraction, ScholarAIO can integrate the same backend daemons used by [AnterCreeper/claude-webtools](https://github.com/AnterCreeper/claude-webtools) as an external capability layer.
55

66
## When to use this
77

88
- You need **internet discovery** (news, latest announcements, online docs) in addition to the local paper KB.
99
- You want the agent to combine:
1010
- ScholarAIO local retrieval (`/scholaraio:search`, `/scholaraio:show`, etc.)
11-
- external web lookup from claude-webtools.
11+
- external web lookup from `GUILessBingSearch` / `qt-web-extractor`.
12+
13+
## Native ScholarAIO entrypoint
14+
15+
ScholarAIO now provides a native URL-ingest command:
16+
17+
```bash
18+
scholaraio ingest-link https://example.com/page
19+
```
20+
21+
This command:
22+
23+
1. Calls a running `qt-web-extractor` service.
24+
2. Pulls rendered page content instead of only raw HTML source.
25+
3. Writes extracted Markdown into a temporary document inbox.
26+
4. Reuses the existing ScholarAIO document ingest pipeline.
27+
28+
In practice, this means `scholaraio ingest-link` can ingest:
29+
30+
- JavaScript-rendered pages that a plain HTTP fetch would miss
31+
- online PDFs and report URLs
32+
- technical docs, manuals, standards, and web articles as normal `document` records
33+
34+
The current command expects `qt-web-extractor` to be reachable through:
35+
36+
- `WEBEXTRACT_URL` if set
37+
- otherwise `http://127.0.0.1:8766`
1238

1339
## Recommended setup
1440

15-
1. Install and configure `claude-webtools` by following its README.
41+
1. Install and configure the backend services:
42+
- `qt-web-extractor` for rendered URL/PDF extraction
43+
- optional `GUILessBingSearch` for search-first workflows
1644
2. Keep ScholarAIO as the authoritative local knowledge pipeline (ingest/index/enrich).
1745
3. In agent workflows:
1846
- use ScholarAIO first for reproducible local evidence;
1947
- use webtools only when freshness or external coverage is required.
2048

49+
`qt-web-extractor` is an external daemon, not a built-in ScholarAIO fetcher. ScholarAIO delegates browser rendering to that service and then continues with its own ingest pipeline.
50+
2151
## Operational guidelines
2252

2353
- Prefer local KB evidence for stable academic claims.
2454
- For time-sensitive facts, cross-check via webtools and record access date.
2555
- When webtools is unavailable, agent should degrade gracefully to local-only ScholarAIO workflows.
56+
- Prefer the default automatic URL handling first; use `scholaraio ingest-link --pdf <url>` only when a PDF URL needs an explicit hint.

0 commit comments

Comments
 (0)