A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured data from 101 formats (115 file extensions) plus cod
A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured data from 101 formats (115 file extensions) plus cod
Xberg is the next iteration of Kreuzberg. Same document-intelligence engine, rebuilt and rebranded under a fresh v1 line.
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.
| Capability | What you get |
|---|---|
| 107 document formats | PDFs, 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 web | Point 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 transcription | Speech-to-text from MP3, M4A, WAV, WebM, and MP4 tracks via Whisper ONNX (tiny → large-v3). Requires the transcription feature. |
| Archives, traversed | List and recursively extract nested .zip, .tar, .gz, .7z — documents inside documents — guarded by zip-bomb, compression-ratio, and nesting-depth limits. |
| OCR on demand | Tesseract, PaddleOCR, Candle, or VLM backends — fallback chains, confidence scores, language auto-detection, extensible via plugins. |
| Layout & tables | ML layout models (PP-DocLayout-V3, RT-DETR) and table structure (TATR, SLANet) reconstruct reading order and cell grids for clean Markdown. |
| Code intelligence | Functions, classes, imports, symbols, docstrings from 371 programming languages. Syntax-aware chunking for RAG pipelines. |
| Embeddings & search | Local (ONNX) or provider-hosted embeddings (165 providers via liter-llm), sparse and late-interaction, cross-encoder reranking. |
| Enrichment | NER, keyword extraction (YAKE/RAKE), summarization, translation, redaction, page classification, QR detection, language detection, token reduction (TOON). |
| Structured extraction | Schema-driven JSON straight from any document via local (Ollama, LM Studio, vLLM) or hosted LLMs — no prompt engineering. |
| 6 output formats | Plain text, Markdown, Djot, HTML, JSON tree, or Docling DocTags, plus registered custom renderers. |
| Runs anywhere | Library, 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.
pip install xbergSee Python README for full documentation.
Node.js / TypeScriptnpm install @xberg-io/xbergSee Node.js README for full documentation.
Rustcargo add xbergSee Rust README for full documentation.
Gogo get github.com/xberg-io/xberg/packages/go@latest⚠️ The repository root is not a Go module —
go get github.com/xberg-io/xbergwill fail. Always target the/packages/gosubdirectory as shown above.
See Go README for full documentation.
JavaAvailable on Maven Central as io.xberg:xberg. See Java README for the dependency snippet.
dotnet add package XbergIo.XbergSee C# README for full documentation.
Rubygem install xbergSee Ruby README for full documentation.
PHPcomposer require xberg-io/xbergSee PHP README for full documentation.
ElixirAdd {:xberg, "~> 1.0"} to your mix.exs dependencies. See Elixir README for full documentation.
npm install @xberg-io/xberg-wasmSee WebAssembly README for full documentation.
Kotlin (Android)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 / Flutterdart pub add xbergSee Dart README for full documentation.
ZigAdd via zig fetch. See Zig README for full documentation.
Build from source as part of this workspace. See C (FFI) README for full documentation.
brew install xberg-io/tap/xbergWindows users can install the same binary through Scoop:
scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
scoop install xberg14 commands: extract, batch, detect, formats, version, cache, tree-sitter, doctor, serve, mcp, api, embed, chunk, and completions.
See CLI usage guide for detailed documentation.
Dockerdocker pull ghcr.io/xberg-io/xberg:latestRun in API, CLI, or MCP modes. See Docker guide for examples.
REST API Serverxberg serve --host 0.0.0.0 --port 8000One POST endpoint handles all formats. Returns JSON or Markdown. Stream large files. See API server guide.
MCP Serverxberg mcp --transport stdio9 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"] }
}
}Install the Xberg plugin from xberg-io/xberg. Ships extraction APIs, OCR backends, configuration, and language conventions.
/plugin marketplace add xberg-io/xberg
/plugin install xberg@xberg/plugins add https://github.com/xberg-io/xbergSearch for xberg and select Install Plugin.
Settings → Plugins → Add from URL → https://github.com/xberg-io/xberg, then select xberg.
gemini extensions install https://github.com/xberg-io/xbergdroid plugin marketplace add https://github.com/xberg-io/xberg
droid plugin install xberg@xbergcopilot plugin marketplace add https://github.com/xberg-io/xberg
copilot plugin install xberg@xbergAdd to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xberg-io/opencode-xberg"]
}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.
107 formats across 140 unique file extensions, with 56 compatibility MIME aliases, intelligent format detection, and comprehensive metadata extraction.
| Category | Formats | Capabilities |
|---|---|---|
| Word Processing | .docx, .docm, .doc, .dotx, .dotm, .dot, .odt, .pages, .wpd, .wp, .wp5, .wp6 |
Full text, tables, images, metadata, styles |
| Spreadsheets | .xlsx, .xlsm, .xlsb, .xls, .xla, .xlam, .xltm, .xltx, .xlt, .ods, .numbers |
Sheet data, formulas, cell metadata, charts |
| Presentations | .pptx, .pptm, .ppt, .pps, .ppsx, .potx, .potm, .pot, .odp, .key |
Slides, speaker notes, images, metadata |
.pdf |
Text, tables, images, metadata, OCR support | |
| eBooks | .epub, .fb2 |
Chapters, metadata, embedded resources |
| Database | .dbf, .sqlite, .sqlite3, .db, .gpkg, .gpkx |
Bounded table extraction, schema metadata, GeoPackage detection |
| Hangul | .hwp, .hwpx |
Korean document format, text extraction |
| Category | Formats | Features |
|---|---|---|
| Raster | .png, .jpg, .jpeg, .gif, .webp, .bmp, .tiff, .tif |
OCR, table detection, EXIF metadata, dimensions, color space |
| Advanced | .jp2, .jpg2, .j2c, .j2k, .jpc, .jbig2, .jb2, .pnm, .pbm, .pgm, .ppm |
OCR via pure-Rust JPEG2000 decoder, JBIG2 support, table detection |
| HEIC family | `.he |
bug: DBF: row values come out in a random column order
feat(renderer): render extraction output as PDF
bug: PDF: grouped table headings lose their column spans
bug: PDF: alignment instructions are lost or detached from spanning table cells
bug(ocr): widely spaced invoice rows truncate tables and lose quantity
feat(renderer): render extraction output as DOCX
bug(ocr): one junk cell in a split amount column drops the whole scanned table
fix(ocr): OCR drops a table when a split amount column has rule marks in it
bug: PDF: table cell text joins and splits words while page text keeps the correct spacing
fix(ocr): a scanned table page with an unmapped text layer loses its table to block mode