chrisryugj/kordoc
GitHub Trending ×2dLocal Node.js engine for Korean document parsing, RAG ingestion, and HWPX authoring
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
kordoc is a TypeScript document-processing engine that sits upstream of the RAG database: it parses and structures files but does not store, index, or retrieve them. Its Node library, kordoc CLI, and kordoc-mcp server expose the processing engine to applications, batch jobs, and agents. The parse() API returns Markdown, structured blocks, and metadata; markdownToHwpx() generates HWPX from Markdown.
The dependency stack includes cfb for compound files, jszip for ZIP packages, @rhwp/core for Hancom-format processing, @hyzyla/pdfium for WASM-based PDF processing, and onnxruntime-node for local model inference. The MCP entrypoint uses @modelcontextprotocol/sdk. Python and Java integrations call a persistent engine worker through the parse-worker protocol rather than requiring separate implementations of the parsers. kordoc serve provides an HTTP interface for individual parse requests and asynchronous jobs.
Key Capabilities & Differentiators
kordoc reads HWP 3–5, HWPX, HWPML, PDF, DOCX, Excel, and scanned inputs. It can emit heading-aware chunks and standalone table chunks instead of a flat text stream, which helps downstream indexing preserve the context around a table. The write path covers Markdown-to-HWPX generation, form filling, institutional style packs, document comparison, and layout-preserving patches. It also includes official-document linting and redaction.
On the native HWPX corpus, the extracted structure matched all 10,344 visible tables across 2,424 files. The 200-document opendataloader-bench result was 0.965 with default settings on v4.24.50. These are distinct measurements: native table structure, aggregate PDF parsing, and scanned-table reconstruction should not be treated as interchangeable. In the 53-document OCR evaluation, the character error rate was 0.0237, but only 33 of 65 table structures matched exactly.
Trade-offs & Limitations
Against a dedicated PDF parser or OCR pipeline, kordoc is most compelling when a single workflow must ingest legacy HWP, preserve HWPX table structure, and produce or edit Korean official documents. For PDF-only ingestion, the extra format coverage is less valuable; compare reading order and table fidelity on your own corpus. For final-form authoring, native editors remain the right verification tool when pixel-level layout or support for every edit is required. Layout-preserving patching is not an unconditional round trip: unsupported edits are skipped with reasons.
Local execution avoids a hosted OCR dependency but leaves installation, worker sizing, and isolation to the operator. --jobs parallelizes by file and increases memory demand; scanned PDFs and model-backed stages should be load-tested separately from text-layer documents. Redaction is useful in the ingestion path, but verify that sensitive content is gone from the actual deliverable, not just from extracted Markdown. The core is MIT-licensed; review third-party notices before bundling dependencies in a commercial distribution.
Hardware & Deployment Guide
The library and CLI require Node.js 20+ on macOS, Linux, or Windows; the HTTP server requires Node.js 24.15+. Install with npm install kordoc, run the CLI with npx kordoc, or register supported MCP clients with npx -y kordoc setup. The packaged WASM PDF engine handles PDF text extraction. OCR, image conversion, and QR functionality are limited if optional dependencies are omitted, so validate the exact installation profile you plan to ship.
For offline operation, set KORDOC_OFFLINE=1 and validate OCR assets and dependencies before disconnecting. Use KORDOC_ROOT to scope MCP file access, and consider the Linux gVisor path (KORDOC_SANDBOX=gvisor, docker --runtime=runsc) for untrusted documents. Pin the deployed version and test writes against representative fixtures: v4.25.35 fixed HWP 5.x patch cases that had produced damaged files, v4.25.36 extended redaction across table-cell boundaries, and v4.25.37 corrected exact-name form-field matching.
kordoc CLI, and kordoc-mcp entrypoint.--format chunks preserves heading paths and emits standalone table chunks; --table-format gfm avoids HTML tables when needed..kpack bundles, and fill template fields.--keep-layout-tables for layout-preserving edits and inspect the reasons for skipped changes.KORDOC_OFFLINE=1, MCP path scoping through KORDOC_ROOT, and an optional Linux gVisor deployment.Public-sector and enterprise teams that need to ingest HWP/HWPX, PDF, and scans into an existing RAG stack while retaining table structure and supporting Korean form workflows.
You need a complete retrieval database, exact table reconstruction from every scan, or unattended document editing with a guarantee that every change preserves layout.
Quick Start & Installation
npm install kordocComparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| kordoc ★ | 3.2k | +64 | TypeScript | MIT | Local Node.js engine for Korean document parsing, RAG ingestion, and HWPX author |
| docling | 71.4k | +285 | Python | MIT | Local-first document parser for structure-aware RAG ingestion |
| marker | 41.2k | +103 | Python | Apache-2.0 | Hybrid OCR and layout parsing for document ingestion in RAG pipelines |
| crawl4ai | 88.5k | +408 | Python | Apache-2.0 | Async browser crawler that turns web pages into Markdown and JSON for RAG |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/chrisryugj/kordoc.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about kordoc
What is the cleanest way to integrate kordoc into a RAG ingestion pipeline?
npx kordoc input.hwpx --format chunks to produce heading-aware chunks and separate table chunks. Add --table-format gfm when the next stage expects Markdown tables rather than HTML. For in-process Node integration, parse() exposes Markdown, structured blocks, and metadata. Embedding, indexing, and retrieval belong to downstream services.Does OCR require a GPU, and how should we size batch workers?
KORDOC_ORT_PROVIDERS=auto enables GPU execution for OCR, formula, and PII models on a compatible setup. There is no fixed VRAM requirement established here; size the deployment using representative scans, enabled models, and target concurrency. For --jobs, measure peak memory as well as files per minute.Can we ship it commercially or run it inside a restricted network?
KORDOC_OFFLINE=1, and use KORDOC_ROOT to scope MCP file access. These controls do not replace a deployment-specific compliance review.When should we choose kordoc over a dedicated PDF parser or a native document editor?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy