ChromeRAG GitHub

Open source · MIT · CPU-only

RAG-ready Markdown, without the site chrome.

ChromeRAG turns scraped HTML into clean Markdown for retrieval-augmented generation. It strips navigation, cookie banners, calls to action and footers, keeps Schema.org metadata as front matter and tables as Markdown tables, writes heading-aware chunks, and warns you when a page is an unrendered JavaScript shell.

$pip install chromerag Get started See the 0.1.5 results
v0.1.6 Python ≥ 3.11 No model download Works offline Test suite

WCXB test F1, 511 pages

0.884
Trafilatura 0.860; +0.024 [+0.008, +0.042]; test split consulted in earlier development

Human raters, 75 new pages

+0.23
net preference over Trafilatura [+0.01, +0.42]; forums +0.80

CRAG answers, 500 questions

+0.008
[−0.040, +0.054]: no measurable difference, from an index about 17% smaller

Quick start

HTML in, Markdown out. ChromeRAG never fetches pages or runs JavaScript: your crawler or headless browser stores the HTML, and ChromeRAG cleans it before chunking and embedding.

# one page → Markdown (front matter, Markdown tables; --json-meta prints diagnostics)
chromerag extract page.html -o page.md --priority balanced

# optional: learn a site's repeated blocks from ≥ 3 pages, then convert the whole folder
chromerag learn pages/ -o site.json --min-pages 3
chromerag batch pages/ -o out/ --chrome-model site.json

# exit code 3 on JavaScript shells, so a pipeline can render them first
chromerag extract page.html -o page.md --fail-on-thin

How it works

Six stages, each a small module. Everything is deterministic and runs on CPU; the learned block filter ships as a small NumPy bundle with nothing to download.

1
Input-quality gate
Flags thin pages and JavaScript shells before anything is removed.
2
Schema harvest
JSON-LD and Microdata become YAML front-matter.
3
Clean + site chrome
13 YAML rules and generic detectors, each with a switch; an optional site-template model.
4
Chrome prune + root ladder
Removes landmarks and repeated chrome; walks content-root candidates.
5
Learned block filter
Gradient-boosted trees over block features; NumPy-only inference. Set enable_lbc=False to fall back to the older density filter.
6
Tables + Markdown
Data tables become Markdown tables; headings, lists and code keep their structure.
chromerag learn (optional, experimental; last measured with v0.1.4) finds blocks that repeat, with the same text, on most pages of a site section and look like chrome. At extraction time a match is removed only if it is close to its learned size and does not hold the page's main content.

Version 0.1.5 results

The numbers on this page below this section are from version 0.1.4 and are superseded. They came from a model trained with test-split domains present and from pages and judge rounds used while the code was still changing; they are kept for the record only. The 0.1.5 results, with protocol, page lists, held-out ledger and supplementary tables S1–S9, are in evaluations/2026-11-final (SUPPLEMENT.md).

WCXB test split, 511 pagesWord F1Chrome left in ↓
ChromeRAG 0.1.5 balanced (front matter removed)0.8840.070
ChromeRAG 0.1.5 balanced, raw default output0.8530.092
Trafilatura 2.2.0 (no metadata)0.8600.083
rs-trafilatura 0.1.10.8910.111
Readability0.7630.089
BoilerPy3 1.0.7 Default0.7530.150
jusText 3.0.20.7130.058
MarkItDown 0.1.70.5400.967

The model is trained on 1,238 WCXB development pages with no test page and no known test-split domain. ChromeRAG minus Trafilatura: +0.024 [+0.008, +0.042] (site bootstrap); the gain comes from forums (+0.149); Trafilatura leads on articles by 0.012. The WCXB test split was consulted during earlier development and is not clean held-out evidence. Human raters (75 new pages, mostly three per page) preferred ChromeRAG to Trafilatura, net +0.23 [+0.01, +0.42]; without forums +0.14 [−0.09, +0.35]. CRAG split 1 (500 questions): +0.008 [−0.040, +0.054]. Median time per page on the 511 test pages, one process on a loaded machine: 39.6 ms for ChromeRAG, 14.2 ms for Trafilatura.

Human-reviewed benchmark (WCXB) v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Word-level F1 against human-reviewed main content on WCXB, seven page types. Test (clean): 372 test pages with no byte-identical copy in development (the test split was consulted during development). Test (all): all 511 test pages. Development: five-fold cross-validation grouped by site.

Public benchmark v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Every tool runs on the same stored HTML. Recall is the share of main-content 5-grams kept, noise retention the share of navigation, header and footer 5-grams kept, and Fbal their harmonic balance. The scored pages are chosen from the input HTML only, never from any tool's output.

Method Recall ↑ Noise ret. ↓ Fbal ↑ Avg tokens

Is the difference real? Paired bootstrap, 95% CI

Mean per-page difference, ChromeRAG coverage minus the baseline, 2,000 resamples. An interval that does not cross the zero line is a significant difference.

Does it help retrieval? v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Each tool's output is split into ~200-word chunks and indexed with BM25, as a RAG ingest step would. Queries are page titles, section headings and content passages taken from the input HTML; each has exactly one correct page.

Hit@5 higher is better

Chrome in top-5 context lower is better

Blinded judging v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Three judge families score blinded pairwise comparisons (tool names hidden, order randomised). Net score is wins minus losses over pages, from −1 to +1; whiskers are 95% bootstrap intervals. Rival is Trafilatura except where noted.

Fresh pages 328 pages

WCXB clean 367 pages

vs Readability on fresh pages GPT judge only

Learning a site's template v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Site-template chrome elimination (STCE) learns blocks that repeat across pages of one site section. It is evaluated on the benchmark's sites with at least three pages and on a separate crawl of up to 15 pages per documentation site.

Page setSitesScored pagesRecall without → withPages changedSite-repeated text
loading…

Page explorer v0.1.4, superseded

Version 0.1.4 result, superseded; not used for claims. See 0.1.5 results.

Every benchmark page with every tool's score, so you can check individual cases instead of trusting the averages.

Loading pages…

Reproduce, limits and tests

Reproduce the v0.1.4 numbers on this page (0.1.5: see the README)
pip install -e ".[dev,baselines]"
python scripts/revalidate_corpus.py         # offline: recompute every mean from the published per-page scores
python -m poc.run_corpus_comparison         # fetch the public URLs and score every tool (network)
python -m poc.run_retrieval_eval            # BM25 retrieval over each tool's chunks
python -m poc.crawl_site_groups --fetch     # multi-page crawl for the site-template study (network)
python -m poc.run_stce_eval --raw data/stce_crawl

Live pages change, so a fresh fetch will not match the published numbers exactly. The published per-page scores are in data/corpus_comparison_report.json.

Limitations
  • ChromeRAG does not run JavaScript. It warns about shell pages but cannot recover their content.
  • Training data are one mostly English benchmark (WCXB), and features include English stop words.
  • The WCXB test split was consulted during earlier development; product and collection results rest on 28 and 34 pages.
  • ChromeRAG is about three times slower than Trafilatura on the WCXB test pages.
  • The site-template model is learned from site groups of at least five pages in batch (three with chromerag learn --min-pages 3) and was last measured with version 0.1.4.
  • Only HTML is handled. Use other converters for PDF and Office files.
Test suite

    Cite

    @software{peddapudi_chromerag,
      author  = {Peddapudi, Bhargava Chary},
      title   = {ChromeRAG: A Learned Boilerplate Filter for Web RAG Ingestion},
      url     = {https://github.com/pedapudibhargav/ChromeRAG},
      license = {MIT},
      doi     = {10.5281/zenodo.24411402},
      version = {0.1.5},
      year    = {2026}
    }