xberg

xberg-ioMIT活跃维护

多语言文档智能解析引擎,能从 100 多种格式中提取文本、表格和元数据,并支持 OCR、语音转写和代码理解,适合为 RAG 流程准备高质量数据。

The fast, precise document-intelligence engine for every language: text, tables and metadata from 100+ formats, with OCR, transcription and code intelligence.

v1.3.10发布于 2026-10-13 19:39 UTC9,574star +11 / 7 天613fork同步于 2026-11-10 23:31 UTC

怎么上手

由 README 提炼,执行前请确认
pip install xberg
brew install xberg-io/tap/xberg
硬件要求按 README 说明

README 未说明显存或 GPU 要求;OCR 与 Whisper 转写为可选特性,需按需启用。

纯 CPU 可运行有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一个引擎搞定 100+ 格式的文档解析,直接输出干净文本、表格和元数据

多语言文档智能解析引擎,能从 100 多种格式中提取文本、表格和元数据,并支持 OCR、语音转写和代码理解,适合为 RAG 流程准备高质量数据。

核心能力

  • 统一处理 PDF、Office、图片、HTML、邮件等 107 种格式
  • 内置 OCR 与 Whisper 语音转写,无需另接管线
  • 支持 http(s) URL 抓取,可单页提取或爬取跟随链接
  • 提供 15 种语言绑定,可作库、CLI、REST API 或 MCP 服务
  • 输出 JSON、Markdown 等 6 种结构化格式

容易踩的坑

URL 抓取需启用 url-ingestion 特性,语音转写需启用 transcription 特性,默认不包含;Go 必须指向 /packages/go 子目录,直接 go get 仓库根路径会失败;Whisper 转写依赖 ONNX 模型(tiny 到 large-v3),需另行准备。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.3.10
  1. v1.3.10最新正式版2026-10-13 · 2026-10-13 19:39 UTC

    Fixed

    • (pdf): a margin-note column beside a justified main column is read as its own block. A main column set as one span per line and wider than 55% of the page (375 pt of 595 pt) had every line discarded as full-width furniture, so the two-column repair never saw a column beside the notes, and its bands were cut at every body line. The margin label was placed after the first body line and the following lines alternated between the columns. Spans that do not cross the split are no longer furniture; the same holds with the notes on the left. (GH#2109)
    • (pdf): prose that runs across a table's inner gutter is no longer split between columns. A bordered two-column table beside a margin note let the table's gutter become a page-level column cut, and the full-width paragraphs above and below it were scattered over both groups, so the opening paragraph was read after a lower heading and a short last line such as 2017): came before its own paragraph. A column cut is now refused when two or more continuous lines have at least 60 pt of ink on each side of it. (GH#2110)
    • (deps): the unmaintained unsafe-libyaml is gone. YAML parsing moved from serde_yaml_ng to yaml_serde 0.10.7, clearing RUSTSEC-2024-0449 without an ignore entry. (GH#2108)
    • (deps): ort is pinned to exactly 2.0.0-rc.13. The caret requirement let a fresh resolve pick rc.14, whose session builder needs an Environment, breaking downstream builds.
    • (swift): the iOS libraries build again. A workflow-wide MACOSX_DEPLOYMENT_TARGET made the Tesseract CMake build compile iOS objects as macOS, so linking failed; xberg-tesseract now ignores the variable for iOS targets.
    • (elixir): the NIF load check accepts BEAM-provided enif_* symbols. Release builds of the NIF no longer fail the dlopen probe on symbols only the BEAM supplies.
    • (php): the Linux extension links ONNX Runtime dynamically. The statically linked runtime needed GCC 13 libstdc++ symbols that the zigbuild toolchain replaces with libc++, so xberg.so could not load on Debian 12. libonnxruntime now ships beside xberg.so, and the release gate fails on unversioned undefined C++ symbols.
    • (zig): trait-bridge callbacks no longer crash when they return a string. The generated vtable thunks declared char ** out-parameters as 16-byte optionals, so registering a post-processor segfaulted. Regenerated with alef 0.110.6.
    • (ci): lint and e2e jobs are green again. The ai-rulez generator is built with GOWORK=off, governance uses ai-rulez 5.1.0, the integration npm lockfiles match vitest 5, the Ruby e2e lockfile matches the gemspec, and the bounded-read and strict_parse tests follow zip 9.0.2 and the plain-text fallback.

    Zig

    Add to your build.zig.zon:

    .dependencies = .{
        .xberg-zig = .{
            .url = "https://github.com/xberg-io/xberg/releases/download/v1.3.10/xberg-zig-v1.3.10.tar.gz",
            .hash = "xberg-1.3.10-iV1GruJBQxpms3lJnXWSngd-Ar6lftA1e3F5io7_jwah",
        },
    },
    
  2. v1.3.92026-10-13 · 2026-10-13 04:04 UTC
    查看更新说明

    Added

    • (config): strict_parse controls what happens when a text-like document cannot be parsed in its own format. By default (false), a YAML, JSON, TOML or XML file that fails to parse, an XML or SVG file that trips security_limits.max_entity_length, and a CSV or TSV file that trips security_limits.max_table_cells are extracted as plain text instead of failing, and the reason is recorded in processing_warnings (source parse-fallback). Plain-text recovery is truncated to security_limits.max_content_size with a warning. Set strict_parse = true (CLI --strict-parse true, environment XBERG_STRICT_PARSE) to keep the error. The limits are not loosened, and limits aimed at hostile input (archive size, nesting, XML depth) still fail the extraction.

    Changed

    • Updated dependencies, including tree-sitter-language-pack 1.22.1 (25 refreshed grammars), zip 9.0.2, biblib 0.10, html-escape 0.3 and unhwp 0.19. ort stays at 2.0.0-rc.13 because rc.14 requires an Environment for every session builder.

    Fixed

    • (extraction): a Helm template or other unparseable YAML, JSON, TOML or XML file no longer fails the extraction. The content is returned as plain text with a warning; strict_parse = true restores the error. (GH#2100)
    • (extraction): an oversized XML entity or table no longer discards a text file. A CSV over security_limits.max_table_cells or an XML or SVG file over security_limits.max_entity_length is extracted as plain text with a warning naming the limit that tripped; both limits remain adjustable through security_limits. (GH#2101)
    • (release): the Helm chart is published even when the CLI image build fails. The chart publish was gated on the aggregate result of the image manifest job, so a CLI image leg timing out skipped the chart for 1.3.6 to 1.3.8 while the container images shipped. It is now gated on the xberg and xberg:<version>-core manifests resolving, the only images the chart references. (GH#2106)
    • (pdf): image bounding boxes are correct for images drawn inside a Form XObject with a /Matrix. The form /Matrix was applied after the page transform instead of before it, so the form's page translation was scaled by its own matrix and ExtractedImage.bounding_box landed in the wrong place (a regression since 1.2.7). (GH#2103)
    • (pdf): a narrow margin-note column is read before the main text again. A column of notes set on its own leading beside the main text (no note line shares a baseline with a body line) gave the two-column repair too few gutter votes once a table's grid rows stopped voting, so the page was read line by line across both columns and the margin label was welded to the main heading. A page whose only whitespace corridor is a gutter narrower than the native XY-cut's 15 pt valley is now split at that corridor. (GH#2102)
    • (rendering): a block with many inline annotations renders in linear time. Building the inline nodes of one paragraph rescanned every later annotation for each annotation, so Markdown or chunked extraction of a block dense with emphasis, code spans and links grew quadratically (1 MiB: 29 s, 4 MiB: over 400 s). The scan now stops at the end of the annotated span. The output does not change. (GH#2099)
    • (pdf): two-column pages whose column baselines differ by up to 1pt are read in column order again. The XY-cut line grouping measured gaps between spans in y order, so a right-column line set slightly higher sorted first and merged with the left column's line into one line, which the column split then sent to one side. Spans are now ordered by x before gaps are measured, and a gap is measured from the line's rightmost edge so far. A column cut that would separate short label/value rows whose baselines differ slightly is refused, so key-value rows and table rows read row by row. (GH#2097)
    • **(pptx, ocr): plain output of a PPTX file has the OCR text
  3. v1.3.82026-10-11 · 2026-10-11 01:33 UTC
    查看更新说明

    Release v1.3.8

    Zig

    Add to your build.zig.zon:

    .dependencies = .{
        .xberg-zig = .{
            .url = "https://github.com/xberg-io/xberg/releases/download/v1.3.8/xberg-zig-v1.3.8.tar.gz",
            .hash = "xberg-1.3.8-iV1GrlVmNRooXyYZFEm39J4IiCtnVuSo-Pv5WLe-btCe",
        },
    },
    
  4. v1.3.72026-10-09 · 2026-10-09 07:58 UTC
    查看更新说明

    Added

    • (pdf): pre-extracted spans can use canonical page reading order. order_page_spans applies tagged structure, article-thread, and geometric ordering without parsing page content a second time, including for layer-filtered text.
    • (ocr): failed PDF OCR pages are reported as a typed list in every binding. ExtractedDocument has a new ocr_page_failures field. It is absent (None) when no page failed. Each OcrPageFailure gives the 1-based page, the backend error text, and recovered, which is true when the page still has content from native text or from its embedded images. When an automatic OCR run of selected pages fails as a whole, each selected page has a record. The records were a JSON array under metadata.additional["ocr_page_failures"]; that key is no longer set. The warnings do not change. (GH#2064)

    Changed

    • (benchmarks): cold-process and warm in-process latency are reported as separate regimes. Opt-in steady-state Xberg runs retain model sessions across iterations, publish a separate cold-start probe, and remain excluded from cross-framework rankings until competitors expose equivalent persistent-process adapters.
    • (batch): default in-memory extraction avoids no-op cache work. Engines without an injected cache backend no longer hash every byte input or serialize completed results for a cache that discards them, reducing CPU time and transient allocations without changing extractor or OCR cache behavior.

    Fixed

    • (node): extraction works with AsyncLocalStorage and async hooks enabled. Node bindings heap-pin extraction futures before creating their JavaScript promises, avoiding a synchronous stack overflow on Node 22 and later.

    • (pdf, ocr): Arabic and Hebrew extraction preserve logical reading order. Tagged native PDFs use trustworthy structure order without reversing table cells, and Tesseract output orders mixed-direction lines and tables from their local text direction and geometry. Sparse whole-image RTL OCR also retries a single-block segmentation mode when it recovers more strong-script tokens without materially reducing confidence, and mixed Arabic/Latin scans recover identifiers only when a bounded English crop provides compatible evidence.

    • (benchmarks): benchmark provenance is bound to the executable that actually ran. Clean-checkout runs now reject stale Xberg binaries whose embedded build identifier does not match the repository commit, and machine-readable xberg version output includes that identifier for auditability.

    • (doc): legacy Word documents preserve headers, footers, footnotes, comments, and text boxes. Non-body stories are now emitted with their document layers and respect the existing header, footer, and footnote filters instead of being dropped whenever the document also contains body text. (GH#2054)

    • (php): Linux packages run on Debian 12 and other glibc 2.36 systems. Release artifacts are built against the declared ABI floor, reject newer GLIBC, GLIBCXX, or CXXABI requirements, and are load-tested in Debian 12 before publication. (GH#2060)

    • (ocr): columned prose and punctuation fragments are no longer fabricated as tables. Long, sparse newsletter columns remain ordinary text in both layout and non-layout extraction, while punctuation-only scan regions fall back to paragraph output without losing recognized content.

    • (ocr): layout extraction preserves scanned-PDF recognition settings. Scanned PDFs no longer force Tesseract into whole-image single-block segmentation when layout assembly has detected regions, while known scans keep their sparse-text segmentation and source-resolution preprocessing hints.

    • (typst): tables wrapped in figures are preserved. A #table(...) nested inside a #figure(...), including through an align(...) wrapper, now reaches structured and rendered output instead of being discarded with the figure body.

    • **(latex): m

  5. benchmark-run-37864705744Benchmark Results 2026-10-09 (bca0e2c)pre-release2026-10-09 · 2026-10-09 05:51 UTC
    查看更新说明

    Comparative benchmark results from workflow run 37864705744.

    Commit: bca0e2c12ba0ad90c045e31db814876487b2b56b Date: 2026-10-09

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Xberg

    The fast, precise document-intelligence engine — for every language.

    Point Xberg at anything — a PDF, a scanned image, a spreadsheet, an audio file, a URL, a whole archive, or a source tree — and get back clean text, tables, metadata, and structured data. One engine handles format detection, reading, OCR, and extraction, so you never stitch a pipeline together from a dozen libraries.

    107 formats · 141 file extensions · 371 code languages · 15 language bindings · 6 output formats · OCR · transcription · embeddings

    The fastest, most precise open-source document and PDF-to-Markdown engine — see the benchmarks.

    Install · What you get · Capabilities · CLI · Docs

    Xberg is the next iteration of Kreuzberg. Same document-intelligence engine, rebuilt and rebranded under a fresh v1 line.


    What you get

    Point Xberg at anything — a PDF, a spreadsheet, a scanned image, an audio file, a URL, an archive, a source tree — and get back clean, structured content you can use right away. One core does the format detection, reading, and extraction, so you don't assemble a pipeline yourself. Call it from Rust, Python, Node.js, Go, Java, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, WASM, Kotlin, or C FFI, and run it as a library, CLI tool, REST API, or MCP server.

    CapabilityWhat you get
    107 document formatsPDFs, Office, images, HTML, email, e-books, scientific publications, and structured data across 141 file extensions, with intelligent MIME detection and bounded extraction controls.
    URLs & the webPoint Xberg at an http(s) URL — it fetches and extracts a single document, or crawls and follows links (Auto / Document / Crawl modes via the crawlberg engine). Requires the url-ingestion feature.
    Audio & video transcriptionSpeech-to-text from MP3, M4A, WAV, WebM, and MP4 tracks via Whisper ONNX (tiny → large-v3). Requires the transcription feature.
    Archives, traversedList and recursively extract nested .zip, .tar, .gz, .7z — documents inside documents — guarded by zip-bomb, compression-ratio, and nesting-depth limits.
    OCR on demandTesseract, PaddleOCR, Candle, or VLM backends — fallback chains, confidence scores, language auto-detection, extensible via plugins.
    Layout & tablesML layout models (PP-DocLayout-V3, RT-DETR) and table structure (TATR, SLANet) reconstruct reading order and cell grids for clean Markdown.
    Code intelligenceFunctions, classes, imports, symbols, docstrings from 371 programming languages. Syntax-aware chunking for RAG pipelines.
    Embeddings & searchLocal (ONNX) or provider-hosted embeddings (165 providers via liter-llm), sparse and late-interaction, cross-encoder reranking.
    EnrichmentNER, keyword extraction (YAKE/RAKE), summarization, translation, redaction, page classification, QR detection, language detection, token reduction (TOON).
    Structured extractionSchema-driven JSON straight from any document via local (Ollama, LM Studio, vLLM) or hosted LLMs — no prompt engineering.
    6 output formatsPlain text, Markdown, Djot, HTML, JSON tree, or Docling DocTags, plus registered custom renderers.
    Runs anywhereLibrary, CLI (14 commands), REST API (xberg serve), MCP server, Docker, Helm — CPU by default, no GPU required. Content-hash caching, parallel batch, per-file timeouts.

    Capabilities marked requires a feature are Cargo feature flags on the core crate (url-ingestion, transcription, reranker, layout/ORT). Prebuilt language packages and the Docker image bundle the common set; a from-source build enables only what you select.


    Installation

    Language Packages

    pip install xberg
    

    For archived versions and the PyPI storage fallback:

    pip install xberg --extra-index-url https://xberg-io.github.io/python-wheels/simple/
    

    PyPI keeps all releases in the current minor and the latest stable patch of each older minor. See the permanent archive and retention policy.

    See Python README for full documentation.

    npm install @xberg-io/xberg
    

    See Node.js README for full documentation.

    cargo add xberg
    

    See Rust README for full documentation.

    go get github.com/xberg-io/xberg/packages/go@latest
    

    ⚠️ The repository root is not a Go module — go get github.com/xberg-io/xberg will fail. Always target the /packages/go subdirectory as shown above.

    See Go README for full documentation.

    Available on Maven Central as io.xberg:xberg. See Java README for the dependency snippet.

    dotnet add package XbergIo.Xberg
    

    See C# README for full documentation.

    gem install xberg
    

    See Ruby README for full documentation.

    composer require xberg-io/xberg
    

    See PHP README for full documentation.

    Add {:xberg, "~> 1.0"} to your mix.exs dependencies. See Elixir README for full documentation.

    npm install @xberg-io/xberg-wasm
    

    See WebAssembly README for full documentation.

    Available on Maven Central as io.xberg:xberg-android. See Kotlin README for the dependency snippet.

    Add via Swift Package Manager. See Swift README for full documentation.

    dart pub add xberg
    

    See Dart README for full documentation.

    Add via zig fetch. See Zig README for full documentation.

    Build from source as part of this workspace. See C (FFI) README for full documentation.

    CLI & Deployment

    brew install xberg-io/tap/xberg
    

    Windows users can install the same binary through Scoop:

    scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
    scoop install xberg
    

    14 commands: extract, batch, detect, formats, version, cache, tree-sitter, doctor, serve, mcp, api, embed, chunk, and completions.

    See CLI usage guide for detailed documentation.

    docker pull ghcr.io/xberg-io/xberg:latest
    

    Run in API, CLI, or MCP modes. See Docker guide for examples.

    xberg serve --host 0.0.0.0 --port 8000
    

    One POST endpoint handles all formats. Returns JSON or Markdown. Stream large files. See API server guide.

    xberg mcp --transport stdio
    

    9 tools (extract, extract_batch, detect_mime_type, cache_stats, list_formats, cache_clear, get_version, cache_manifest, cache_warm). 3 prompts (extract_document, extract_with_ocr, semantic_search). 4 resources (formats, models, OCR languages, embedding presets).

    Add to Claude Desktop or Cursor:

    {
      "mcpServers": {
        "xberg": { "command": "xberg", "args": ["mcp"] }
      }
    }
    

    See MCP integration guide.

    AI Coding Assistants

    Install the Xberg plugin from xberg-io/xberg. Ships extraction APIs, OCR backends, configuration, and language conventions.

    The bundle targets Claude Code, Codex, Cursor, Gemini CLI, Kimi, OpenCode, Factory Droid, Hermes, Pi, Agent Plugins and GitHub Copilot CLI. Read the plugin guide for runtime resources, CLI prerequisites and configuration. MCP-capable adapters expose the product's tools; Hermes uses a local stdio bridge and explicitly selected skills. Pi loads skills and prompt templates and requires the product CLI for executable operations.

    Install only the public Agent Skills, without a plugin or MCP registration, using the skills CLI:

    npx skills add xberg-io/xberg --list
    npx skills add xberg-io/xberg
    

    Choose the skills and target agents interactively. Installing instructions does not install the product CLI or configure provider credentials.

    /plugin marketplace add xberg-io/xberg
    /plugin install xberg@xberg
    
    /plugins add https://github.com/xberg-io/xberg
    

    Search for xberg and select Install Plugin.

    Settings → Plugins → Add from URL → https://github.com/xberg-io/xberg, then select xberg.

    From a checkout of this repository:

    gemini extensions install ./plugin
    

    The manifest is inside plugin/. See the Gemini extension reference for local installation and updates.

    droid plugin marketplace add https://github.com/xberg-io/xberg
    droid plugin install xberg@xberg
    
    copilot plugin marketplace add https://github.com/xberg-io/xberg
    copilot plugin install xberg@xberg
    

    Install from a local checkout now:

    pi install ./plugin
    

    After the next plugin release, install the same package used by OpenCode:

    pi install npm:@xberg-io/opencode-xberg
    

    Pi loads the bundled skills and prompt templates. Use /xberg-extract and /xberg-ocr to start a task. Install the CLI separately as shown in the plugin README. This package does not register MCP servers, hooks, or executable extensions in Pi.

    Add to opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@xberg-io/opencode-xberg"]
    }
    

    Quick Start

    Extract text from a document:

    use xberg::{extract, ExtractInput, ExtractionConfig};
    
    #[tokio::main]
    async fn main() -> xberg::Result<()> {
        let config = ExtractionConfig::default();
        let output = extract(
            ExtractInput::from_uri("document.pdf"),
            &config
        ).await?;
    
        println!("{}", output.results[0].content);
        Ok(())
    }
    

    Common use cases — see Quick start guide for language-specific examples, OCR, batch processing, and API configuration.


    Capabilities

    Supported File Formats (107 formats · 141 file extensions · 56 MIME aliases)

    107 formats across 140 unique file extensions, with 56 compatibility MIME aliases, intelligent format detection, and comprehensive metadata extraction.

    Office Documents
    CategoryFormatsCapabilities
    Word Processing.docx, .docm, .doc, .dotx, .dotm, .dot, .odt, .pages, .wpd, .wp, .wp5, .wp6Full text, tables, images, metadata, styles
    Spreadsheets.xlsx, .xlsm, .xlsb, .xls, .xla, .xlam, .xltm, .xltx, .xlt, .ods, .numbersSheet data, formulas, cell metadata, charts
    Presentations.pptx, .pptm, .ppt, .pps, .ppsx, .potx, .potm, .pot, .odp, .keySlides, speaker notes, images, metadata
    PDF.pdfText, tables, images, metadata, OCR support
    eBooks.epub, .fb2Chapters, metadata, embedded resources
    Database.dbf, .sqlite, .sqlite3, .db, .gpkg, .gpkxBounded table extraction, schema metadata, GeoPackage detection
    Hangul.hwp, .hwpxKorean document format, text extraction
    Images (OCR-Enabled)
    CategoryFormatsFeatures
    Raster.png, .jpg, .jpeg, .gif, .webp, .bmp, .tiff, .tifOCR, table detection, EXIF metadata, dimensions, color space
    Advanced.jp2, .jpg2, .j2c, .j2k, .jpc, .jbig2, .jb2, .pnm, .pbm, .pgm, .ppmOCR via pure-Rust JPEG2000 decoder, JBIG2 support, table detection
    HEIC family.heic, .heics, .heif, .heifs, .hif, .avif, .avcsEXIF metadata, optional pixel decoding
    Vector.svgDOM parsing, embedded text, graphics metadata
    Audio & Video
    CategoryFormatsFeatures
    Audio.mp3, .mpga, .m4a, .wav, .webmWhisper transcription
    MP4 audio track.mp4, .mpg4, .mp4v, .m4vAudio-track transcription only
    MPEG audio track.mpeg, .mpg, .mpe, .m1v, .m2vAudio-track transcription only
    WebM audio track.webmAudio-track transcription only
    Web & Data
    CategoryFormatsFeatures
    Markup.html, .htm, .xhtml, .xht, .xml, .kml, .svgDOM parsing, metadata (Open Graph, Twitter Card), link extraction
    Structured Data.json, .geojson, .jsonl, .ndjson, .yaml, .yml, .toml, .csv, .tsvSchema detection, nested structures, validation
    Text & Markdown.txt, .adoc, .asciidoc, .vtt, .md, .markdown, .commonmark, .qmd, .rmd, .djot, .dj, .mdx, .doctags, .rst, .org, .rtfAsciiDoc, CommonMark, MyST Markdown, Quarto, R Markdown, Djot, MDX, DocTags, reStructuredText, Org Mode
    Email & Archives
    CategoryFormatsFeatures
    Email.eml, .msg, .pstHeaders, body (HTML/plain), attachments, threading
    Archives.zip, .tar, .tgz, .gz, .7zFile listing, nested archives, metadata, recursive extraction
    Academic & Scientific
    CategoryFormatsFeatures
    Citations.bib, .ris, .nbib, .enwStructured parsing: RIS, PubMed/MEDLINE, EndNote XML, BibTeX/BibLaTeX
    Scientific.tex, .latex, .typ, .typst, .jats, .nxmlLaTeX, Typst, PubMed JATS
    Text notebooks.ipynb, .md, .py, .R, .jlJupyter, MyST-NB, Jupytext percent/light, saved outputs, cell visibility tags
    Publishing.fb2, .docbook, .dbk, .docbook4, .docbook5, .opmlFictionBook, DocBook XML, OPML outlines

    Code Intelligence (371 Languages)

    Extract structure from 371 programming languages via tree-sitter:

    FeatureDescription
    Structure ExtractionFunctions, classes, methods, structs, interfaces, enums
    Import/Export AnalysisModule dependencies, re-exports, wildcard imports
    Symbol ExtractionVariables, constants, type aliases, properties
    Docstring ParsingGoogle, NumPy, Sphinx, JSDoc, RustDoc, and 10+ formats
    Syntax-Aware ChunkingSplit code by semantic boundaries for RAG pipelines
    DiagnosticsParse errors with line/column positions

    Powered by tree-sitter-language-pack.

    Output Formats (6)

    FormatUse caseExample
    PlainRaw text, no markup"Chapter 1\nIntroduction"
    MarkdownReadable, structured, RAG-friendly"# Chapter 1\n## Introduction"
    DjotModern lightweight markupSimilar to Markdown but stricter
    HTMLStyled, browser-ready<h1>Chapter 1</h1>
    JSONMachine-readable tree structureHierarchical sections with heading levels
    DocTagsDocling-compatible tag stream for document elements and tables<text>Chapter 1</text>

    Deployment Modes

    ModeCommandTransportUse case
    Libraryxberg::extract()Async functionsEmbed in your application
    CLIxberg extract document.pdf14 commandsScripts, batch jobs, CI/CD
    REST APIxberg serveHTTP POSTMicroservice, serverless deployment
    MCP Serverxberg mcpstdio or HTTPClaude, Cursor, IDE agents
    Dockerdocker run ghcr.io/xberg-io/xbergAll modesContainer deployment

    OCR Backends

    • Tesseract — Native C FFI (Linux/macOS/Windows) and WASM (browser)
    • PaddleOCR — ONNX Runtime, mobile-optimized models
    • Candle — Pure Rust, CPU-only, lightweight
    • VLM — GPT-4 Vision, Claude Vision, Gemini Vision, or 165 providers via liter-llm

    Fallback chains. Extensible via plugin system.

    Embeddings

    Local (ONNX Runtime):

    • Preset models: fast, balanced (default), quality, multilingual
    • Dimensions: 384, 768, 1024

    Provider-hosted:

    • OpenAI, Anthropic, Google, Hugging Face, Mistral, Cohere, and 165 providers total
    • Via liter-llm integration

    Reranking:

    • Local ONNX rerankers (cross-encoder models)
    • Provider-hosted: Cohere Rerank, others

    Structured LLM Extraction

    Local engines: Ollama, LM Studio, vLLM

    Remote: OpenAI, Anthropic, Google, Mistral, Cohere, and 165 providers via liter-llm

    Schema validation. Temperature, top-p, frequency penalty tuning.

    Enrichment

    • NER — GLiNER or LLM-based entity recognition
    • Redaction — Mask PII (phone, email, SSN, credit card, addresses)
    • Summarization — Document and section summaries via LLM
    • Translation — Multi-language via LLM
    • Page Classification — Tag document pages (cover, toc, content, etc.)
    • QR Code Detection — Extract and decode QR codes from images
    • Keyword Extraction — YAKE or RAKE algorithms
    • Language Detection — Detect document language
    • Layout Detection — RT-DETR + TATR models for document structure
    • Table Extraction — Cell-level structure and content
    • Token Reduction — TOON wire format (~30–50% fewer tokens than JSON)

    CLI Reference

    CommandSubcommandsPurpose
    extract—Extract text from a single document (path, URL, or stdin)
    batch—Extract from multiple documents in parallel
    detect—Identify MIME type of a file
    formats—List all supported formats and MIME types
    version—Show Xberg version
    cachestats, clear, manifest, warmManage extraction cache and models
    tree-sitterdownload, list, cache-dir, cleanManage code-intelligence grammars
    doctor—Diagnose the local installation and runtime dependencies
    serve—Start REST API server (default: http://127.0.0.1:8000)
    mcp—Start MCP server (stdio or HTTP transport)
    apischemaOutput OpenAPI 3.1 specification
    embed—Generate embeddings for text (local or provider-hosted)
    chunk—Split text into chunks (text, markdown, YAML, or semantic)
    completions—Generate shell completion scripts

    Run xberg --help or xberg <command> --help for detailed options.


    Documentation

    Full guides, API references for every binding, format reference, and configuration docs live at xberg.io.


    Built with Xberg

    Projects that declare Xberg as a dependency. Xberg was previously published as kreuzberg, and most of these projects declare the package under that name.

    ProjectWhat it isStars
    basemindAI context and content layer for coding agents over one MCP server: code map, document RAG, shared memory and web crawlStars
    deluluA suite of MCP servers and CLI tools that give your LLM better search and fewer hallucinationsStars
    docs-mcp-serverGrounded documentation MCP server, an open-source alternative to Context7, Nia and Ref.ToolsStars
    eratoThe open-source AI platformStars
    fastmail-cliCLI and MCP server for Fastmail: email, contacts, masked email, attachments and text extractionStars
    ghfdb-portalWeb portal for the Global Heat Flow DatabaseStars
    hawki-toolkit-file-converterPrepares and converts PDF files for the HAWKI toolkitStars
    haystack-core-integrationsIntegrations that extend Haystack with extra components and document storesStars
    kreuzaktA search engine for humans and computers, aimed at your most boring documentsStars
    lilbeeThe whole local AI stack in one executable, with conversational search and cited answers over your files, code and the webStars
    llm-workflow-enginePower CLI and workflow manager for LLMsStars
    MANSPIDERSpiders entire networks for files sitting on SMB shares, searching filenames or contents with regexStars
    otoroshi-llm-extensionConnect, secure and manage LLM models behind one OpenAI-compatible APIStars
    sift-kgTurns a collection of documents into a knowledge graph, extracting entities and relationships with an LLMStars
    sirchmunkTurns raw data into a self-evolving, real-time search and intelligence layerStars
    support-chatbotLevel-1 support chatbot for the Netherlands Red Cross 510 teamStars

    Using Xberg in your project? Open a PR adding it to this list.


    Contributing

    Contributions are welcome! See CONTRIBUTING.md for guidelines.

    Join our Discord community for questions and discussion.


    Part of Xberg.io

    • Xberg — the open-source content-intelligence engine: text, tables, and metadata from 107 formats (141 file extensions), with OCR, transcription, and code intelligence. MIT.
    • Xberg Pro — a complete self-hosted content-intelligence backend in a single container. Commercial.
    • Xberg Enterprise — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
    • crawlberg — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
    • html-to-markdown — fast, lossless HTML→Markdown engine.
    • liter-llm — universal LLM API client with native bindings for 14 languages and 165 providers.
    • tree-sitter-language-pack — tree-sitter grammars and code-intelligence primitives.
    • alef — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.

    License

    MIT License (MIT) — see LICENSE for details.