Jump to the manifest
colpali-visual-document-retrieval.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.At a glance
How the pieces connect
Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.Deploy it
1
Get the manifest
2
Validate it
Validate runs every check apply runs and creates nothing. Fix each entry in
errors, then run it again.3
Apply it
Apply creates every resource in one call. The response lists each resource with its outcome in
wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.Run the first query
Look up the namespace id by name, then runfind-pages. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.
Add your own data
Each object you add to a bucket is processed by every collection that reads it. This adds one object todocuments. NAMESPACE_ID is the id from the namespace lookup above.
PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.
Retrievers
find-pages
Describe what a page shows (a map, a chart, a form, a table) and get back the pages that look like it, each with its title and page_number.
Stages: feature_search
Searches: pages
find-pages-like
Pass an image of a page and get back the pages with the closest layout and content, across every PDF.
Stages: feature_search
Searches: pages
Collections
Each collection runs one extractor over a bucket, or over another collection’s documents.pages
pages
image_extractor@v1 over bucket documents: one document per PDF page, with page_number, total_pages and a page thumbnail, embedded by SigLIP.Reads bucket
documents with image_extractor v1.Inputs: image ← fileCopied onto each document: title, doc_typeThe manifest
Every resource above comes from this file. Change it and apply it again with?mode=upsert to update what exists. Manifests documents each field.
colpali-visual-document-retrieval.namespace.yaml
Hand it to an agent
Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown athttps://mixpeek.com/docs/templates/colpali-visual-document-retrieval.md.
Prompt
How it works
Thepages collection runs image_extractor, which splits each uploaded PDF into one document per page. Every page carries page_number (from 1), total_pages, a thumbnail_url, and the object’s title and doc_type.
Each page is embedded as an image with Google SigLIP (google/siglip-base-patch16-224, 768 dimensions). A sentence and a page that matches it land close together. No OCR runs: the page is matched by what it looks like, such as a map, a chart or a form with boxes.
SigLIP sees each page at 224 by 224 pixels. Layout, figures and large headings survive at that size; body text does not. For questions about the words on a page, see ColQwen2 late interaction below, or index the text itself with the universal extractor.
The two retrievers search the same feature, mixpeek://image_extractor@v1/google_siglip_base_v1, with different query modes:
Use
title and page_number to deep-link to a result page in your viewer. Each change below is an edit to the manifest; apply it again with ?mode=upsert. Extractor parameters change only while a collection is empty, so to embed pages another way, add a collection and trigger it, as in the ColQwen2 steps.
Search with a page image
find-pages-like finds pages that look like one you already have, such as a scan or a screenshot. Render it to PNG, then send it as a data URI.
Render page 1 of report.pdf to page-1.png
cURL
Filter by document type
Passfilters next to inputs to narrow a search per call. This searches the tax forms only:
cURL
Return the best page of each PDF
A long report can fill the list with its own pages. Add agroup_by stage after the search in find-pages to keep the top page of each PDF:
colpali-visual-document-retrieval.namespace.yaml (find-pages stages)
max_per_group to show the top 2 or 3 pages of each PDF.
ColQwen2 late interaction
SigLIP gives each page one vector. ColQwen2 (vidore/colqwen2-v1.0, built on Qwen2-VL-2B) gives each page one 128-dimension vector per image patch. A text query is encoded into one vector per token, and a page scores by MaxSim: each query token takes its best-matching patch, and the scores add up. Small text, table cells and figure labels each get their own vectors, so a query about a specific value can find the page that shows it.
The manifest ships these blocks commented out. A ColQwen2 search runs only on a pinned namespace; on an unpinned one it refuses with an error that says how to pin.
1
Pin the namespace
A pin is billed by the hour, and a free organization cannot hold one. Each Mixpeek plane allows a fixed number of pinned namespaces; past that, the pin is refused with the cap named.The ColQwen2 model scales to zero when idle, so the first query after a quiet spell waits for it to load. To keep one query encoder replica running, send
cURL
{"pinned": {"enabled": true, "warm_query_encoder": true}} as the body. Each replica-hour is billed to the namespace as its own invoice line.2
Uncomment the ColQwen2 blocks
Uncomment three blocks in the manifest: the
colqwen_extractor entry under feature_extractors, the page-tokens collection, and the find-pages-late-interaction retriever. find-pages-late-interaction searches mixpeek://colqwen_extractor@v1/colqwen2_v1. Like image_extractor, colqwen_extractor splits a PDF into one document per page with page_number.3
Apply, then process the stored PDFs
Apply the file with
?mode=create_missing, which creates the new resources and leaves existing ones alone. Then process the PDFs already in the bucket through the new collection:cURL
The
maxsim_rerank stage re-scores the candidates of an earlier search with a multi-vector feature, reading tokens for those candidates only. Across two collections it matches each candidate on root_object_id, which is the source PDF. Every page of one PDF then gets the same score, so this pairing ranks whole files. Use it when each bucket object is a single page image.Visual or text retrieval
Search pages by how they look
Use this template when pages carry meaning in maps, charts, diagrams or form layout, or when OCR on scans is unreliable.
Search the words
Use text extraction for born-digital, text-heavy PDFs, exact keywords, or extracted fields and summaries.
Further reading
- ColPali: Efficient Document Retrieval with Vision Language Models, the paper that introduced late interaction over page images.
- ViDoRe leaderboard, a benchmark for visual document retrieval.

