feat(files): Docling extraction + MINT document serialization - #1
Closed
hshekhar-git wants to merge 2 commits into
Closed
hshekhar-git wants to merge 2 commits into
hshekhar-git wants to merge 2 commits into
Conversation
Adds a Docling-based file extractor (python/docling_extract.py, spawned by
docling-client.service.ts) as the default, with graceful fallback to the
existing Gemini extractor on any failure. Extracted document structure is
serialized to MINT via the new mint-mapper (encodeDocument from
@q1k-oss/mint-format >=1.1.0) and stored in files.mint_content for
token-efficient prompt injection.
- file.types: DocumentStructure gains figures[] + section pageRef
- schema: files.mint_content column (apply via db:push)
- config: extractor option ('docling' | 'gemini')
- adds CLAUDE.md (extractor flow, Docling/uv setup, MINT usage)
- scripts/smoke-docling.ts verifies the structure -> MINT path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python/docling_extract.pyviadocling-client.service.ts), with graceful fallback to the existing Gemini extractor on any failure (missing runtime, parse error, etc.).structureto MINT via a new mapper (structureToMint→encodeDocumentfrom@q1k-oss/mint-format) and stores it infiles.mint_contentfor token-efficient prompt injection.DocumentStructuregainsfigures[]+ sectionpageRef; newextractorconfig option;CLAUDE.mdadded (was missing);scripts/smoke-docling.tsverifies the structure→MINT path.Dependencies
@q1k-oss/mint-format≥ 1.1.0 (addsencodeDocument/decodeDocument) — see feat(document): MINT document representation for parsed files mint-format#2. Merge + publish that first; this PR'spackage.jsonalready points at^1.1.0.pyproject.toml,uv); first run downloads models. Not required for tests — the Gemini fallback covers a missing runtime.Test plan
npm run build— clean tscnpx tsx scripts/smoke-docling.ts— structure→MINT mapping renders §-headings/tables/lists/figures and round-trips viadecodeDocumentuv sync && npx tsx scripts/smoke-docling.ts <sample.pdf>— real Docling extraction (run where Docling is installed)files.mint_contentcolumn vianpm run db:pushPOST /api/files/upload→processingStatus=completed,mint_contentpopulated