# Document Chunker now uses Decision 1 boundary classification for 100% verbatim chunking up to 15,000 words

> Source: <https://dejan.ai/blog/document-chunker-decision-1/>
> Published: 2026-11-27 06:31:50+00:00

**Key takeaway:** Scoring each adjacent block pair with a binary boundary classifier returns a 0.00–1.00 probability per transition, so one API call yields the full curve and a client-side threshold slider re-chunks locally at 0 output tokens with 100% verbatim fidelity.

# Document Chunker now uses Decision 1 boundary classification for 100% verbatim chunking up to 15,000 words

We upgraded dejan.ai/tools/chunk/ from verbatim-echo generation to gemini-decision-1 boundary classification: 0 output tokens, 100% verbatim fidelity, 15,000-word limit, Fetch URL mode, and an instant threshold slider.

We upgraded our public [Document Chunker](https://dejan.ai/tools/chunk/) from generative verbatim-echo chunking to binary boundary classification powered by `gemini-decision-1`. The tool now handles up to 15,000 words (up from 3,000), runs in roughly 250 to 460 ms with zero output tokens, guarantees 100% verbatim fidelity by construction, defaults to fetching any live URL via `DejanBot/1.0`, and includes an instant client-side boundary threshold slider. The same boundary classifier now powers passage-level [site search](https://dejan.ai/search?q=PoolDPP) and [/.well-known/search](https://dejan.ai/blog/agent-search-diy/)`dejan.ai`.

**Try it on any URL or document:** Enter a domain or paste text to inspect semantic chunks, adjust the boundary threshold live, or export JSON.

[Open the upgraded Document Chunker →](https://dejan.ai/tools/chunk/)

## What changed from v1 to v2

| Capability | Previous version (v1) | Current version (v2) | 
|---|---|---|
| Model & method | Gemini 3.6 Flash echoing full text with `<chunk_start>` tags | `gemini-decision-1` binary boundary classification | 
| Output tokens | Full document length regenerated | 0 output tokens | 
| Verbatim fidelity | Required post-hoc `_coverage()` check for dropped lines | 100% verbatim by construction | 
| Input limit | 3,000 words (30,000 chars) | 15,000 words (120,000 chars, 950 blocks) | 
| Input modes | Paste text only | Fetch URL (default, bare domains supported) + Paste text | 
| Granularity control | Fixed per run | Live probability threshold slider (no extra API call) | 

## How classification replaces text regeneration

Asking a generative model to split a document by reprinting it with delimiter tags wastes output tokens on every word and introduces silent drift when the model summarises or skips a sentence. Instead, v2 splits the extracted Markdown into atomic blocks (headings, paragraphs, lists, tables, fenced code blocks, blockquotes) and sends the numbered document once to `gemini-decision-1`.

In a single pass over that shared input, the model scores every adjacent block pair on one question: whether block `[Bi-1]` marks the end of a complete, self-contained semantic unit such that block `[Bi]` begins a new one. Because a bare heading or lead-in opens a unit rather than ending one, headings stay attached to their body text while topic shifts score above `0.50`.

Because the response returns a calibrated probability between `0.00` and `1.00` for every transition, the browser holds the full probability curve after one API call. Moving the **Boundary threshold** slider recomputes chunks locally in milliseconds so you can tighten or loosen chunk granularity without re-querying the model.

## URL fetching and clean extraction

**Fetch URL** is now the default tab on [/tools/chunk/](https://dejan.ai/tools/chunk/)`dejan.ai` automatically prepend `https://`, pass an SSRF check against private IPs, and fetch with `DejanBot/1.0 (+https://dejan.ai/bot)` and `Accept: text/markdown`. For HTML responses, the extractor strips comments, scripts, navigation, headers, and footers, prioritising `<main>` over individual `<article>` cards before converting to Markdown.

## Shared engine behind dejan.ai search

The upgraded tool uses the same `modules/chunk_index.py` classifier that now indexes all 2,111 published posts, concepts, pages, and Codebase Explorer elements on `dejan.ai` into 5,718 searchable passages. Every new or edited page is re-chunked and embedded automatically in the background, feeding both human [/search](https://dejan.ai/search)[/.well-known/search](https://dejan.ai/blog/agent-search-diy/)
