# Xberg

> Polyglot document intelligence: text, tables, and code from 106 formats

- Category: Retrieval & Knowledge (RAG) / Parsing & Ingestion
- Language: Rust
- Licence: MIT
- Repository: https://github.com/xberg-io/xberg
- Website: https://docs.xberg.io
- Canonical page: https://ai-tldr.dev/tools/kreuzberg/

## In short

Xberg is an open-source document intelligence engine built on a Rust core. The project describes itself as the next iteration of Kreuzberg — the same engine, rebuilt and rebranded under a fresh v1 line. It sits in the Parsing & Ingestion category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Rust and licensed MIT.

## Overview

Xberg is an open-source document intelligence engine built on a Rust core. The project describes itself as the next iteration of Kreuzberg — the same engine, rebuilt and rebranded under a fresh v1 line. Point it at a PDF, a spreadsheet, a scanned image, an audio file, a URL, an archive, or a source tree and it returns clean text, tables, metadata, and structured data.

One core handles format detection, reading, OCR, and extraction, so you do not assemble a pipeline from a dozen libraries. It covers 106 document formats across 140 file extensions, adds code intelligence for 371 programming languages, and emits six output formats: plain text, Markdown, Djot, HTML, a JSON tree, or Docling DocTags.

The same engine is callable from 15 language bindings — Rust, Python, Node.js, Go, Java, C#, Ruby, PHP, Elixir, Dart, Swift, Zig, WASM, Kotlin, and C FFI — and runs as a library, a CLI, a REST API (`xberg serve`), an MCP server, a Docker image, or a Helm chart. It is MIT-licensed and runs on CPU by default, with no GPU required.

## What it does

- Reads 106 document formats across 140 file extensions, with MIME detection and bounded extraction controls
- OCR on demand through Tesseract, PaddleOCR, Candle, or VLM backends, with fallback chains and confidence scores
- ML layout models and table-structure models reconstruct reading order and cell grids for clean Markdown
- Code intelligence for 371 programming languages: functions, classes, imports, symbols, docstrings, and syntax-aware chunking
- Recursive archive traversal (.zip, .tar, .gz, .7z) guarded by zip-bomb, compression-ratio, and nesting-depth limits
- Optional URL ingestion and crawling, audio/video transcription via Whisper ONNX, embeddings, and reranking
- 15 language bindings plus library, CLI, REST API, MCP server, Docker, and Helm deployment modes

## Getting started

Xberg ships prebuilt language packages that bundle the common feature set. Pick the binding that matches your stack, or run the container to use it as a service.

1. Install for Python

   The PyPI package wraps the Rust core with the common features prebuilt.

```bash
pip install xberg
```

2. Install for Node.js

   The Node.js package is published under the xberg-io scope; a WASM build is also available as @xberg-io/xberg-wasm.

```bash
npm install @xberg-io/xberg
```

3. Add to a Rust project

   Use the core crate directly for feature-flag control over URL ingestion, transcription, reranking, and layout models.

```bash
cargo add xberg
```

4. Run it as a service

   The container image on GitHub Container Registry runs the CLI, the REST API, or the MCP server without installing a language binding. A Helm chart is documented for Kubernetes.

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

## When to use it

- Building a RAG pipeline that needs clean text and metadata from mixed document types such as PDFs, Office files, and emails
- Running OCR on scanned PDFs and images to recover searchable text without setting up a GPU
- Indexing source code repositories by extracting functions, classes, and imports across hundreds of programming languages
- Exposing a shared extraction service to many apps through the REST API or MCP server, callable from 15 languages
