XI

xberg-io/xberg

Developer tools
9.5K stars 605 forks Quality 88 Trend 53MIT

Polyglot document intelligence with a Rust core: extract text, metadata, images, tables, and structured data from 106 formats across 140 file extensions, plus code intelligence for 371 languages.

Overview

Extract clean text, tables, and structured data from documents and code — no format detection, no OCR setup, no stitched-together libraries. Same document-intelligence engine, rebuilt and rebranded under a fresh v1 line. Documents · Images · Spreadsheets · Email · Archives · Code · Audio · Video Feed any document—get structured text. Extract, batch, stream, or crawl. Point Xberg at anything — a PDF, a spreadsheet, a scanned image, an audio file, 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. The CLI: 12 commands for extraction, caching, serving, and MCP. OCR with confidence scores and bounding boxes. Switch backends without code changes.

README

Xberg

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.

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.


Installation

Language Packages

CLI & Deployment

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.


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


CLI Reference


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.

Project What it is Stars
basemind AI context and content layer for coding agents over one MCP server: code map, document RAG, shared memory and web crawl
delulu A suite of MCP servers and CLI tools that give your LLM better search and fewer hallucinations
docs-mcp-server Grounded documentation MCP server, an open-source alternative to Context7, Nia and Ref.Tools
erato The open-source AI platform
fastmail-cli CLI and MCP server for Fastmail: email, contacts, masked email, attachments and text extraction
ghfdb-portal Web portal for the Global Heat Flow Database
hawki-toolkit-file-converter Prepares and converts PDF files for the HAWKI toolkit
haystack-core-integrations Integrations that extend Haystack with extra components and document stores
kreuzakt A search engine for humans and computers, aimed at your most boring documents
lilbee The whole local AI stack in one executable, with conversational search and cited answers over your files, code and the web
llm-workflow-engine Power CLI and workflow manager for LLMs
MANSPIDER Spiders entire networks for files sitting on SMB shares, searching filenames or contents with regex
otoroshi-llm-extension Connect, secure and manage LLM models behind one OpenAI-compatible API
sift-kg Turns a collection of documents into a knowledge graph, extracting entities and relationships with an LLM
sirchmunk Turns raw data into a self-evolving, real-time search and intelligence layer
support-chatbot Level-1 support chatbot for the Netherlands Red Cross 510 team

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.

View the full README on GitHub

Install

npx skills add xberg-io/xberg --list
New to MCP? Start with the mcpskill.org guide →

Configuration

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