Skip to content
Changelog

Each upload keeps its chunking settings to itself

October 29, 20261 min read

One upload with custom chunking used to change how your Agno knowledge base chunked every upload after it. POST /knowledge/content wrote chunker, chunk_size and chunk_overlap onto the reader that the knowledge base shares across uploads.

The upload now gets its own shallow copy of the reader before those options apply, so the reader on your Knowledge keeps its configuration. The request stays the same.

curl -X POST "$AGENTOS_URL/knowledge/content" \
  -F file=@first.txt \
  -F reader_id=notes \
  -F chunker=FixedSizeChunker \
  -F chunk_size=1000 \
  -F chunk_overlap=0

We sent the same 27,489-byte file twice through that route against a TextReader with its default chunk size of 5000. The first upload asked for 1000, and the second named only the reader. A stand-in for the storage step ran the reader and reported its chunks, so no vector database was involved. Real output for the second upload:

Before: second.txt: FixedSizeChunking chunk_size=1000 chunks=28
Now:    second.txt: FixedSizeChunking chunk_size=5000 chunks=6

See the cookbook, and learn more about chunking in the documentation.

Frequently asked questions

Earlier releases called set_chunking_strategy_from_string() on the reader that the knowledge base itself held. The override stayed on that object until the process restarted, so an upload with no chunking options still used it.

The upload route applies chunking options when the request has a chunker and a reader is set, so send a reader_id too. In a test on both releases, an upload with a chunker and no reader_id had no reader at that step, and chunk_size alone left the reader at 5000.

Earlier releases printed first.txt: FixedSizeChunking chunk_size=1000 chunks=28 and second.txt: FixedSizeChunking chunk_size=1000 chunks=28, then kb reader after 1000. This release keeps the first line and prints second.txt: FixedSizeChunking chunk_size=5000 chunks=6, then kb reader after 5000.

Shipped around the same time