Skip to main content

Use cases

Split large text into consistent chunks so a retrieval pipeline can index and search it.
Fix chunk size and overlap before ingestion instead of relying on defaults.
Prepare text for a third-party vector database or an existing embedding pipeline.
Inspect, edit, or delete chunks in a Knowledge Base Datasource.

Overview

Chunking splits large documents into smaller pieces that a retrieval pipeline can index and search. Orq.ai offers the standalone Chunking API and chunk management inside Knowledge Bases. Text becomes chunks through three paths: a Knowledge Base chunks uploaded files automatically, the Chunking API prepares text that is added to a Datasource manually, or the Chunking API feeds an external vector database. The sections below compare the strategies and the ingestion paths.

Quick start

Split text with the token strategy to see the API shape.

Which chunking strategy to use

The Chunking API offers six strategies: For the full parameter tables and defaults for each strategy, see Datasource and Chunking.

Chunk size and overlap

  • Chunk size controls how much context each retrieved unit carries. Smaller chunks retrieve more precisely but produce more chunks, more tokens, and higher embedding and storage cost. Larger chunks give the model more surrounding context but increase token use and generation cost.
  • Chunk overlap repeats tokens across neighboring chunks so a boundary does not cut off a relevant passage. Higher overlap increases redundancy between chunks but improves the likelihood that relevant information is returned to models.
Strategy defaults:
  • chunk_size 512 for token, sentence, and recursive
  • chunk_overlap 0 for token and sentence (recursive has no overlap parameter)
  • agentic uses chunk_size 1024
  • fast uses target_size 4096 bytes
See the strategy tables for the complete list.

Standalone chunking vs Knowledge Base chunking

Guides per path:

Inspecting and correcting chunks

After ingestion, chunks in a Knowledge Base Datasource can be listed, counted, retrieved, updated, and deleted, one at a time or in bulk. The Knowledge Bases page covers the UI flow and chunk metadata; the reference pages list the exact payloads.

Worked example

For a complete example that chunks a document with the Chunking API, adds the chunks to a Knowledge Base Datasource, and retrieves them, see Simple RAG. For chunking into a custom vector database, see Use Pinecone and custom vector databases.

Best practices

  • Clean text before chunking (Knowledge Base path): pass chunking_cleanup_options inside chunking_options when creating a Datasource to remove emails, credit card numbers, and phone numbers, and to normalize whitespace, before content is indexed. See Datasource and Chunking.
  • Keep chunk metadata primitive and consistent: strings, numbers, or booleans only; non-coercible values are discarded from the chunk.
  • Match chunk size to the retrieval question: smaller chunks for precise Q&A, larger chunks when the model needs broader context.