█

AI/TLDR

Buy me a coffee
Buy me a coffee

Byaldi

Late-interaction multimodal retrieval over document images with a few lines of code

Rerank, Search & HybridOpen source
Language
Python
IN SHORT

What is Byaldi?

Byaldi is a small Python library from Answer.AI that makes it easy to use late-interaction, multimodal retrieval models such as ColPali and ColQwen2. It sits in the Rerank, Search & Hybrid category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python. To get started: install Poppler.

Overview

Byaldi is a small Python library from Answer.AI that makes it easy to use late-interaction, multimodal retrieval models such as ColPali and ColQwen2. Instead of extracting text and embedding it, these models index the actual page images of your documents, so layout, tables, and figures are kept as part of the signal you search over.

It is built as a thin wrapper around the colpali-engine repository and follows the same minimal style as its sister project, RAGatouille: load a model, index a PDF, image, or folder, then run a search in a handful of lines. It is aimed at developers building retrieval-augmented generation (RAG) pipelines who want to search document images directly rather than parsing text out of them first.

Within the RAG and retrieval space, Byaldi sits in the reranking and hybrid-search corner: it scores and ranks document pages using ColVLM late-interaction models. It is a pre-release library that uses uncompressed indexes, so expect some rough edges, but the API is stable enough to prototype multimodal search quickly.

What it does

  • Wraps ColPali-style late-interaction models (including ColQwen2 checkpoints like vidore/colqwen2-v1.0) behind a familiar, RAGatouille-style API
  • Indexes document images directly, so page layout, tables, and figures are retained instead of being flattened to plain text
  • Indexes a single PDF, a single image, or a whole directory with one index() call
  • Optionally stores base64-encoded pages in the index so query results can be piped straight to an LLM
  • Supports per-document metadata and custom integer doc IDs at index time
  • Loads a saved index later with from_index() to query without re-encoding your collection

Getting started

Byaldi needs Poppler for PDF-to-image conversion and runs best on a GPU. Install the system dependency, then the package, then index and search your documents.

Install Poppler

Byaldi uses pdf2image, which needs Poppler on your system. On Debian or Ubuntu, install poppler-utils (use brew install poppler on macOS).

bashbash
sudo apt-get install -y poppler-utils

Install Byaldi

Install the package with pip. If you plan to use models that rely on flash attention, install flash-attn afterwards.

bashbash
pip install --upgrade byaldi
pip install flash-attn

Load a model and build an index

Load a ColPali-style checkpoint, then index a PDF, an image, or a folder of documents. The index is saved under .byaldi/ by default.

pythonpython
from byaldi import RAGMultiModalModel

RAG = RAGMultiModalModel.from_pretrained("vidore/colqwen2-v1.0")
RAG.index(
    input_path="docs/",
    index_name="my_index",
    store_collection_with_index=False,
    overwrite=True,
)

Search the index

Run a query and get back the top-k matching pages, each with a doc_id, 1-indexed page_num, and a relevance score, sorted best-first.

pythonpython
results = RAG.search("your query", k=3)

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Search scanned PDFs, slide decks, or reports where layout, tables, and figures matter and plain-text extraction loses information
  • Build a multimodal RAG pipeline that retrieves relevant document pages and feeds their images to a vision-capable LLM
  • Prototype visual document retrieval quickly without writing your own ColPali indexing and scoring code
  • Index a mixed folder of PDFs and images and query across all of them with metadata attached to each document

How Byaldi compares

Byaldi alongside other open-source rerank, search & hybrid tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Elasticsearch★ 78.9kDistributed search and analytics engine with a built-in vector database for dense/sparse embeddings and hybrid keyword-plus-semantic retrieval.
Meilisearch Cloud★ 60.1kManaged cloud for the Meilisearch engine, combining fast full-text search with hybrid, semantic, and multimodal vector search.
Typesense Cloud★ 27.2kManaged hosting for the Typesense search engine, offering typo-tolerant keyword search plus vector and semantic search via a simple API.
Tantivy★ 16.5kA fast full-text search engine library in Rust that provides BM25 keyword search for the lexical half of hybrid retrieval.
FlagEmbedding★ 12.4kBAAI's retrieval toolkit that provides the BGE embedding and cross-encoder reranker models used widely in RAG pipelines.
Vespa★ 7.2kA search and serving engine that natively combines vector, keyword (BM25), and structured search with built-in ranking for large-scale retrieval.
DigUp★ 6.6kAn on-device Mac app that searches photos, PDFs, recordings, videos and code by what is in them, combining EmbeddingGemma 2 vectors run on llama.cpp with a keyword index.
Byaldi★ 852Late-interaction multimodal retrieval over document images with a few lines of code