PDF Source Ingest for v1.24.0 — open design discussion #222
Replies: 4 comments
|
Data point for the "cross-plugin API surface" question — I initially wondered whether this whole discussion was moot given Obsidian's own Web Clipper, so I checked before assuming: it isn't. Web Clipper explicitly does not extract PDF content. There's an open, unresolved issue on the official repo confirming this — obsidianmd/obsidian-clipper#646, filed Nov 2025, still open. Makes sense given its design: it's a browser-extension DOM→Markdown tool for capturing live web pages, not a PDF text/OCR extractor for files already sitting in a vault. Different problem shape entirely, so no overlap to worry about there — this discussion isn't reinventing something Web Clipper already covers. That said, it does sharpen the case for Topology B specifically: since the most obvious "does Obsidian already solve this" candidate turns out not to, the value of verifying the dedicated PDF→MD community plugins already listed under Path 5 (do any expose a stable, callable API vs. command-palette-only) goes up — that's the one lever that could avoid bundling extraction code into this plugin at all. Worth prioritizing that verification before Topology A/bundling gets more design investment, since it's the cheapest way to falsify or confirm the lowest-TCO path. |
|
One personal-workflow data point that might matter for how broadly this needs solving: for my own use, I deliberately feed the wiki curated summaries rather than the original PDF — not as a workaround, but by design. I have to read the source paper first anyway, so writing a distilled note as part of that reading is close to free, and it keeps me in control of what actually enters the graph. Ingesting a 15-page Nature/Science article at full length would balloon the wiki with far more surface area than the extractable signal justifies — separate from token cost, a single source contributing that much raw text concentrates merge/hub exposure (see #216) more than a distilled note would. Not arguing against solving PDF ingest for people who do want raw-paper-in — just flagging that "read it, then write a short note" may remain the better default for some workflows even once native PDF support exists, rather than something PDF support is expected to replace. |
|
Thanks for the writeup @green-dalii . As requested, here are my details of my local prototype. TL;DR: Topology A + Path 1 (native LLM read), zero new dependencies, built as three pure-addition phases on the pre-AI-SDK codebase. Topology picked: A, Path 1I went with plugin-native extraction via the provider's own document support - no bundled lib, no external service, no cross-plugin coupling. The rationale in TCO terms:
Architecture
Provider matrix
Two layers: Cache strategy - path@mtime, per-ingest (deliberately not contentHash)What's implemented: a per-ingest cache keyed Error UXOne fix worth flagging: Obsidian's requestUrl throws on 4xx without the response body, so users would see a bare "status 400". On Scanned/image-only PDFs: quality depends on the model's vision capability; if extraction comes back empty, the existing pre-ingest empty-content gate rejects it with a clear Notice — never a silent failure. Corrupt/password-protected PDFs propagate as ordinary errors (not misclassified as "unsupported"). OutputThe source summary page for a PDF embeds the model's transcription under a localized One caveat for v1.24.0My prototype is built on the current custom-client codebase ( ContributingHappy to share the branch / open a draft PR against feat/pdf-support once v1.23.0 ships so this can serve as the reference implementation for the discussion. I could take ownership depending on the 1.24.0 release timeline. Let's say that 1.23.0 lands today, I would need a reasonable 3+ week window from there to finish the implementation. |
|
@DocTpoint I use LLM-wiki mainly to ingest technical documentation and build a knowledge base about a project/organization. In that use case, reading every source and summarizing it beforehand would be tedious. What ingesting the entire PDF gives me is an index that enables fast lookup and concept-linkage. I don't need to understand the whole document the first time I encounter it — I need its content stored and processed in a way that lets me easily search through it when I need a specific piece of domain knowledge (or point an AI agent at it). On prioritizing the Topology B verification: agreed it's cheap and worth doing, and I'd welcome the result either way. But I'd flag that even a positive result (some plugin exposes a callable conversion method) doesn't resolve B's structural problems: Obsidian has no inter-plugin API contract — you reach into app.plugins.plugins['id'] and call whatever's there, untyped, unversioned, with no way to declare the dependency or get notified when the user disables it. And the plugins that do high-quality PDF→MD (obsidian-marker, the Mistral OCR ones) are themselves wrappers around an external service, so B doesn't remove the API-key/service setup cost — it adds a coupling layer on top of it. My fuller argument is in the main reply, but the short version: the legitimate need behind B (a non-LLM extraction route for text-only providers) is served better by Topology C, which gives the same zero-bundle benefit against a stable HTTP interface instead of another plugin's internals. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
PDF Source Ingest for v1.24.0 — open design discussion
Tracking #218 (filed by @A-NGJ). Confirmed real pain point, targeting v1.24.0 MINOR as a design-track discussion. PRs land on
feat/pdf-supportbranch off v1.24.0-dev after we converge here.Principle: every option is evaluated on total cost-of-ownership: maintenance burden + bundle cost + setup friction vs. user value. No path pre-selected — we're deciding together.
The problem
PDF sources (papers, reports, scans, exports) need manual pre-conversion to Markdown today. That breaks the "drop a source, let the wiki build itself" workflow. Goal:
.pdfbecomes first-class alongside.mdas an ingest source.What we already agreed on
readDocument()chokepoint in the LLM client — no per-provider branching in the ingest pathThe first fork — where does the work happen?
Before picking libraries, decide topology. This is the largest ROI lever — wrong topology means rewriting the integration layer later.
Topology A — Plugin-native (this plugin does the extraction)
The plugin ships or calls its own extraction logic. Single install, single user action.
Topology B — Delegate to an Obsidian PDF plugin
Require users to install + configure a community PDF plugin. Call its API from ours for conversion.
Topology C — User-configured endpoint (generic service)
Plugin exposes one setting: "PDF extraction URL + API key". Users wire whichever service they prefer.
Open question for the community: for an LLM-Wiki workflow specifically, which topology has the lowest TCO over a 12-month horizon? Anyone with cross-plugin-API experience please weigh in.
Extraction paths (assume Topology A or C)
Path 1 — Native LLM read
Anthropic / OpenAI (gpt-4o+) / Gemini natively accept PDFs in their message content blocks. The plugin already routes through
@ai-sdk/anthropic,@ai-sdk/openai,@ai-sdk/openai-compatible.Path 2 — Hosted PDF-to-MD service (pay-per-page)
User supplies an API endpoint. Plugin POSTs the PDF, receives Markdown.
Path 3 — Self-hosted / local service (zero per-page cost)
User runs an extraction service locally; plugin calls it. All have Docker / Python REST APIs suitable for Obsidian-side calls.
Path 4 — Library bundled inside the plugin
Bundle a JS / WASM / Python library directly.
Path 5 — Delegation to an Obsidian PDF plugin (Topology B)
In Obsidian's community plugin ecosystem, several plugins already do PDF → Markdown conversion. The question for Topology B: can we call any of these from our plugin programmatically, rather than re-implementing extraction?
Excluded from this path (mentioned for completeness, not candidates): PDF++ (pdf-plus) is annotation-centric and does not do PDF→MD; it's a great UX companion but cannot serve as an extraction backend.
Cross-cutting decisions (any path)
Before committing to a path, agree on:
contentHash(re-extract only on content change) preferred; mtime fallback acceptableInformation we still need from the community
Next steps
questiontoenhancement+help wantedfeat/pdf-support(branched off main after v1.23.0 ships on 2026-07-02)cc @A-NGJ (submitter) — share your local prototype details (topology you picked, provider matrix, cache strategy) so we don't re-litigate decisions you've already made.
cc community — Obsidian users currently running MinerU / PaddleOCR / Marker locally: what's the real-world setup cost? Plugin developers who've cross-plugin-called PDF conversion APIs: what's the API stability story?
All reactions