@GYLQ520: PixelRAG 来自伯克利 SkyLab 等团队,开源可玩。 它的思路很直接,不再靠 HTML 或文本解析,而是把网页、PDF 直接截成截图,用视觉索引做 RAG 检索。 表格、图表、布局这些 HTML 解析会丢掉的东西,全保留下来了。…
摘要
PixelRAG 是来自伯克利SkyLab等团队的开源项目,通过将网页和PDF截图为截图并用视觉索引进行检索,提高RAG准确率并显著降低AI Agent的token成本。
查看缓存全文
缓存时间: 2026/08/21 07:04
PixelRAG 来自伯克利 SkyLab 等团队,开源可玩。
它的思路很直接,不再靠 HTML 或文本解析,而是把网页、PDF 直接截成截图,用视觉索引做 RAG 检索。
表格、图表、布局这些 HTML 解析会丢掉的东西,全保留下来了。
官方数据:准确率最高能提 18.1%,AI Agent 的 token 成本能砍掉 10 倍。已经有 828 万维基百科页面预建好了索引,免费 API 直接用。
还给 Claude 做了个插件,相当于给 AI 装了双眼睛,看页面跟人一样看截图。
项目地:https://github.com/StarTrail-org/PixelRAG…
StarTrail-org/PixelRAG
Source: https://github.com/StarTrail-org/PixelRAG
Official codebase for PIXELRAG: Web Screenshots Beat Text for Retrieval-Augmented Generation
Yichuan Wang*,
Zhifei Li*,
Zirui Wang,
Paul Teiletche,
Lesheng Jin
Matei Zaharia†,
Joseph E. Gonzalez†,
Sewon Min†
* Equal contribution † Equal advising
Work done at Berkeley SkyLab & BAIR & Berkeley NLP
Search any document by how it looks, not just the text it contains.
What it is · Give Claude eyes · How it works · Pipelines
pip install pixelrag
The two core operations — render a page to screenshots, search a visual index:
# Render any page or document to screenshot tiles
pixelshot https://en.wikipedia.org/wiki/Python --output ./tiles
# Search a hosted index of 8.28M Wikipedia pages — no setup, runs against the live API
curl -X POST https://api.pixelrag.ai/search \
-H "Content-Type: application/json" \
-d '{"queries": [{"text": "What is the capital of France?"}], "n_docs": 5}'
Live, hosted endpoint —
https://api.pixelrag.aiserves a pre-built index of 8.28M Wikipedia pages. No setup, no API key. It even takes an image as the query (visual search) — see the API reference →.
Or try it in the browser at pixelrag.ai, or run the demo notebook in
Colab — it
renders a page and searches the hosted index, with the images inline.
What it is
PixelRAG renders documents — web pages, PDFs, images — as screenshots and retrieves over the images directly. Visual structure that HTML parsing throws away — tables, charts, layout, infographics — stays intact, so the reader model can actually answer questions about it. Wikipedia’s 8.28M articles ship as a pre-built index; the pipeline itself is general-purpose.
Give Claude eyes
The renderer also ships as a Claude Code plugin — the pixelbrowse skill. Instead of fetching
raw HTML, Claude screenshots a page with pixelshot and reads the image, so it sees
charts, diagrams, tables, and layout the way a person does.
Install it — no clone needed. Install the pixelshot CLI so it’s on your PATH
(use uv tool or pipx to keep it isolated yet always available to Claude — a
plain pip install into a project venv may leave pixelshot off PATH):
uv tool install pixelrag # pixelshot on PATH (or: pipx install pixelrag)
claude plugin marketplace add StarTrail-org/PixelRAG
claude plugin install pixelbrowse@pixelrag-plugins
Then just ask Claude to look at a page:
claude -p "screenshot https://news.ycombinator.com and summarize the top stories"
claude -p "screenshot https://arxiv.org/abs/2404.12387 and explain the key findings"
Or use the slash command in an interactive session: /screenshot https://example.com.
No MCP server, no backend: the skill just calls pixelshot (Playwright/CDP) on your machine.
How it works
Text-based RAG parses the page to text chunks and loses the table — the reader can’t find the answer. PixelRAG renders the page to screenshot tiles, retrieves the right tile, and the reader reads the number straight off the image.
Two pieces make this work: (1) rendering documents to images instead of parsing them to text, and
(2) a Qwen3-VL-Embedding model, LoRA-fine-tuned on screenshot data, that embeds page images into
a space where visual content is retrievable.
Pipelines
Capture is the standalone pixelshot command; the rest of the pipeline runs through the
pixelrag umbrella — pixelrag <stage>. Install only the stages you need:
| Command | What it does | Install |
|---|---|---|
pixelshot | Document → image tiles (Playwright CDP, PDF) | pip install pixelrag |
pixelrag chunk · embed · build-index | Tiles → vectors → FAISS index | pip install 'pixelrag[embed]' |
pixelrag index | Orchestrates the full pipeline: source → ingest → embed → index | pip install 'pixelrag[index]' |
pixelrag serve | FAISS search API (FastAPI, CPU or GPU) | pip install 'pixelrag[serve]' |
render ←── index ──→ embed serve (independent) train → serve (HTTP)
train is a separate uv project with its own pinned env (torch==2.9.1+cu129,
transformers==4.57.1, cuDNN 9.20) — install it from inside train/, not from the root.
Search a pre-built index
pip install 'pixelrag[serve]'
# Download a pre-built index from Hugging Face. The dataset repo holds four FAISS indexes
# (base/LoRA Wikipedia pixel, Wikipedia text, news pixel); grab just the base one (~217G) here.
huggingface-cli download StarTrail-org/pixelrag-faiss-indexes \
--repo-type dataset --include "search_index_normed_v2/*" --local-dir ./index
# Serve, then query
pixelrag serve --index-dir ./index/search_index_normed_v2 --port 30001
curl -X POST http://localhost:30001/search \
-H "Content-Type: application/json" \
-d '{"queries": [{"text": "What is the capital of France?"}], "n_docs": 5}'
Build an index from your own documents
Works on Linux (CUDA) and macOS (Apple Silicon / MPS) — device: auto picks the best backend.
pip install 'pixelrag[index]'
# Create pixelrag.yaml
cat > pixelrag.yaml << 'EOF'
source:
type: local
path: ./my_docs
embed:
model: Qwen/Qwen3-VL-Embedding-2B
device: auto # cuda on Linux, mps on macOS, cpu as fallback
output: ./my_index
EOF
# Build, then serve
pixelrag index build
pixelrag serve --index-dir ./my_index --port 30001
Try it: index a PDF and search it locally
No GPU required — runs on macOS (Apple Silicon) or any machine with Python 3.10+.
pip install 'pixelrag[index]'
# 1. Grab a sample PDF (or use your own)
curl -L -o paper.pdf https://raw.githubusercontent.com/StarTrail-org/PixelRAG/main/assets/pixelrag-paper.pdf
# 2. Create config (device: auto picks MPS on Mac, CUDA on Linux)
cat > pixelrag.yaml << 'EOF'
source:
type: local
path: ./paper.pdf
embed:
model: Qwen/Qwen3-VL-Embedding-2B
device: auto
output: ./paper_index
EOF
# 3. Build the index (~3 min on Apple M-series, ~1 min on GPU)
pixelrag index build
# 4. Serve it
pixelrag serve --index-dir ./paper_index --port 30001
# 5. Search — should return page 2 (the overview diagram)
curl -X POST http://localhost:30001/search \
-H "Content-Type: application/json" \
-d '{"queries": [{"text": "Overview of PixelRAG and the diagram"}], "n_docs": 1}'
Render a page programmatically
from pixelrag_render import render_url
# render a single page to tiles — e.g. for an agent to read
tiles = render_url("https://en.wikipedia.org/wiki/Python", "./tiles")
The same rendering is available as a CLI — pixelshot ships with pip install pixelrag:
# Web page → tiles (headless Chromium via CDP)
pixelshot https://en.wikipedia.org/wiki/Python -o ./tiles
# PDF → tiles (requires poppler; install the pdf extra: pip install 'pixelrag[pdf]')
curl -sL -o paper.pdf https://arxiv.org/pdf/2503.09516
pixelshot paper.pdf -o ./tiles --dpi 200
# URLs and local files can be mixed freely
pixelshot https://github.com/StarTrail-org/PixelRAG paper.pdf -o ./tiles
Chrome on Windows/macOS — the bundled turbo
headless_shellauto-installs on linux-x64 only. Elsewhere,pixelshotuses your system Chrome/Chromium (or Playwright’s Chromium), auto-detected from the standard install locations. Point it at a specific binary withCHROME_PATH=/path/to/chromeif it isn’t found automatically. Each render runs in an isolated, throwaway Chrome profile, so it works even while you have Chrome open.
Embed tools (standalone)
Each stage runs independently, without the orchestrator:
pip install 'pixelrag[embed]'
pixelrag chunk --tiles-dir ./tiles
pixelrag embed --shard-dir ./tiles --output-dir ./embeddings --gpu-ids 0,1
pixelrag build-index --embeddings-dir ./embeddings --output-dir ./index
Qdrant backend
Qdrant is an open-source vector search engine for high-performance and massive scale. FAISS remains the default for local indexes. Use Qdrant for configurable quantization, disk-backed vectors, payload filtering, and one collection shared by multiple PixelRAG servers.
Quantization compresses vectors to reduce memory use and speed up search, with a recall tradeoff that depends on the method and settings.
To configure quantization, pass any Qdrant quantization_config object in a JSON file.
See Qdrant’s quantization guide for supported methods and parameters.
{
"scalar": {
"type": "int8",
"quantile": 0.99,
"always_ram": true
}
}
pip install 'pixelrag[serve,qdrant]' # or 'pixelrag[index,qdrant]'
# Build against a Qdrant server.
# Start one locally with: docker run -p 6333:6333 qdrant/qdrant
pixelrag build-index --embeddings-dir ./embeddings --output-dir ./index \
--backend qdrant --qdrant-url http://localhost:6333 --collection pixelrag \
--qdrant-quantization-config ./quantization.json
# Add documents to an existing collection.
pixelrag build-index --embeddings-dir ./more --output-dir ./index \
--backend qdrant --qdrant-url http://localhost:6333 --collection pixelrag --append
# Replace an existing collection and its configuration.
pixelrag build-index --embeddings-dir ./embeddings --output-dir ./index \
--backend qdrant --qdrant-url http://localhost:6333 --collection pixelrag --recreate
# Serve the collection. PixelRAG reads the backend from summary.json.
pixelrag serve --index-dir ./index --qdrant-url http://localhost:6333 \
--qdrant-client-config ./qdrant-client.json --port 30001
Configure the orchestrator in pixelrag.yaml:
index:
backend: qdrant
qdrant_url: http://localhost:6333
collection: pixelrag
client_config: ./qdrant-client.json
quantization_config: ./quantization.json
# Set append: true or recreate: true when the collection already exists.
Training
Fine-tuning lives in train/ — a separate uv project (wiki-screenshot-training) with its own
pinned env. It LoRA-fine-tunes Qwen/Qwen3-VL-Embedding-2B for webpage retrieval; run it from
inside train/ (cd train && uv sync). See train/README.md for the full recipe.
You don’t need to retrain to use the model — the trained adapters are published at
Chrisyichuan/wiki-screenshot-embedding-lora.
We also release the full training set
(Chrisyichuan/screenshot-training-natural-filtered-v2),
so you can adapt other backbones yourself — a larger Qwen, or any other embedding model.
The data curation pipeline (LLM-augmented query generation, filtering, hard-negative mining)
is documented in train/docs/synthetic_data_pipeline.md.
Citation
If you find PixelRAG useful, please cite our paper:
@misc{wang2026pixelragwebscreenshotsbeat,
title={PIXELRAG: Web Screenshots Beat Text for Retrieval-Augmented Generation},
author={Yichuan Wang and Zhifei Li and Zirui Wang and Paul Teiletche and Lesheng Jin and Matei Zaharia and Joseph E. Gonzalez and Sewon Min},
year={2026},
eprint={2606.28344},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2606.28344},
}
Acknowledgments
Thanks to Rulin Shao for support.
Thanks also to Claude Code and OpenAI Codex for supporting open-source contributors with credits and plans, which we earned by working on LEANN.
This work is done by the Berkeley Sky Computing Lab, BAIR, and the Berkeley NLP Group.
License
Apache-2.0
相似文章
@LTChives: 网络爬虫已死。 视频里这个 PixelRAG,完全跳过 HTML 解析。 它把网页直接截图,然后让视觉模型从像素里读答案。 以前 AI 读网页,是先拆代码、提文字、切段落。 现在它直接看页面。 100% 开源,还带 Claude Code…
PixelRAG 是一种新型开源工具,它绕过传统 HTML 解析,直接通过对网页截图并使用视觉模型从像素中提取答案,并支持 Claude Code 插件,让 Claude 具备视觉能力。
@akshay_pachaar: 网页抓取将彻底改变。(100%开源的大规模视觉搜索) PixelRAG是一种检索系统,可跳过…
PixelRAG是一种开源检索系统,它通过截取网页截图并使用视觉语言模型直接从像素中读取答案,从而绕过HTML解析,声称相比基于文本的RAG有显著的准确率提升。
@RoundtableSpace: 网页抓取已死。PixelRAG 完全跳过 HTML 解析。它截取页面截图,视觉模型直接读取答案…
PixelRAG 是一款开源工具,通过使用截图和视觉模型从网页中提取数据,取代了传统的网页抓取。它包含一个 Claude Code 插件。
@mate_mattt: 做了一套真实可运行的 RAG 项目 和 Notebook RAG 实战课,对 RAG 进行像素级拆解: Markdown 切分 → FTS5 / BM25 → Embedding 向量检索 → 混合召回 RRF → Cross-Encod…
这是一个从零学习本地RAG检索核心的实战项目,包含Notebook和真实可运行代码,覆盖Markdown切分、BM25、Embedding向量检索、混合召回RRF、Cross-Encoder重排等完整流程,并配有评测指标。
@GitHub_Daily: 想搞懂 RAG 到底怎么回事,网上的教程不是跳步骤就是直接调云端 API,中间过程看不见。 RAG from Scratch 把整条链路拆成十来个小实验,每一步都用本地模型跑,没有黑盒。 从文本分块、向量化、检索到最终生成,代码都摆在面前…
介绍开源项目 RAG from Scratch,通过分步骤的本地代码实验完整拆解 RAG 链路,涵盖文本分块、向量化、检索、重排序与查询重写等进阶策略,帮助开发者从底层理解 RAG 实现。