Text Chunker for RAG: text, pages and datasets to chunks
Pricing
from $10.00 / 1,000 document chunkeds
Text Chunker for RAG: text, pages and datasets to chunks
Splits texts, Markdown, web pages and Apify datasets into chunks for retrieval and vector databases, by paragraphs, headings, sentences or token windows, with overlap, exact OpenAI token counts, heading paths, character offsets and stable chunk IDs.
Pricing
from $10.00 / 1,000 document chunkeds
Rating
0.0
(0)
Developer
Ed Rayyis
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
20 days ago
Last modified
Categories
Features
Share
Split documents into chunks ready for embeddings and vector databases. Give it pasted text or Markdown, web page and file URLs, or Apify datasets such as a crawler's results, and get one dataset item per chunk with its exact token count.
Strategies
- Recursive (default): fills each chunk with whole paragraphs. A paragraph too long for one chunk is split into sentences, and a sentence too long into token windows. Chunks run across headings.
- By headings: never mixes two sections in one chunk. Set the section level: 2 starts a new chunk at
#and##headings, 3 also at###. A long section is split by paragraphs, then sentences. - By sentences: packs whole sentences up to the chunk size. A heading starts a new chunk.
- Fixed token windows: cuts the text every N tokens, with the overlap as the step back.
Fenced code blocks are kept whole when they fit. Sentence splitting skips common abbreviations such as "Dr." and "e.g." and decimal numbers such as 3.5.
Every chunk carries
text: what to embed. It starts with the heading path (such asReturns policy > Refunds) when the chunk does not start with its own heading, then the overlap from the chunk before, then the content.tokenCountfortext, andcontentTokenCountfor the content alone, counted with the tokenizer you pick:o200k_base,cl100k_base(the encoding OpenAI's text-embedding-3 models use [1]), or wordsstartCharandendChar: where the content sits in the source text. The content is an exact slice of the source.headingPath: the list of headings above the chunkoverlapText: the repeated tail of the chunk before. It starts at a sentence or word boundary, and with the headings strategy it never crosses into another section.chunkId: a stable ID from the source, position and content, so a rerun on the same text gives the same IDssource,title,chunkIndex,chunkCount, and any dataset fields you choose to copy
Input
- Texts: plain text or Markdown, one document per entry
- URLs: web pages are reduced to their main text as Markdown with headings kept, and footnote markers and wiki edit links removed. Markdown and text files are read as they are. Up to 20 MB each.
- Apify datasets: each item is one document. The text field is found for you (
markdown,text,content,body,transcript,article,description), or name it. Copy fields such asurlonto every chunk. - Strategy, chunk size in tokens (default 500), overlap in tokens (default 50), tokenizer, section heading level
- Heading path in chunk text (default on)
- Smallest chunk: a chunk with fewer tokens joins the chunk before it in the same section
Output
Dataset: one item per chunk. A source that cannot be read gets one item with source and error, such as HTTP 404, PDF files are not read; convert them to text first, or no text field found for a dataset item. The other sources still run.
The key-value store holds a SUMMARY record with, for each source, the number of chunks, characters and tokens, or its error, plus the settings used.
Pricing
Pay per event: one event per document chunked, whatever the number of chunks. A source that fails is not charged. The run stops when it reaches the maximum charge you set.
Scope and conduct
The actor downloads each URL once. It reads only the datasets you pick, writes nothing to them, and stores nothing beyond the run's own storage.
Support
Questions and problems: the Issues tab on this page.
References
- tiktoken/tiktoken/model.py at main · openai/tiktoken | openai/tiktoken | github.com. https://github.com/openai/tiktoken/blob/main/tiktoken/model.py