Skip to main content
Semantic chunking is a method of splitting documents into smaller chunks by analyzing semantic similarity between text segments using embeddings. It uses the chonkie library to identify natural breakpoints where the semantic meaning changes significantly, based on a configurable similarity threshold. This helps preserve context and meaning better than fixed-size chunking by ensuring semantically related content stays together in the same chunk, while splitting occurs at meaningful topic transitions.
ParameterTypeDefaultDescription
embedderUnion[str, Embedder, BaseEmbeddings]OpenAIEmbedderThe embedder configuration. Can be an Agno Embedder (e.g., OpenAIEmbedder, GeminiEmbedder), a Chonkie BaseEmbeddings instance (e.g., OpenAIEmbeddings), or a string model identifier (e.g., "text-embedding-3-small") for Chonkie's AutoEmbeddings.
chunk_sizeint5000Maximum tokens allowed per chunk.
similarity_thresholdfloat0.5Similarity threshold for grouping sentences (0-1). Lower values create larger groups (fewer chunks).
similarity_windowint3Number of sentences to consider for similarity calculation.
min_sentences_per_chunkint1Minimum number of sentences per chunk.
min_characters_per_sentenceint24Minimum number of characters per sentence.
delimitersList[str][". ", "! ", "? ", "\n"]Delimiters to split sentences on.
include_delimitersLiteral["prev", "next", None]"prev"Include delimiters in the chunk text. Specify whether to include with the previous or next sentence.
skip_windowint0Number of groups to skip when looking for similar content to merge. 0 (default) uses standard semantic grouping; higher values enable merging of non-consecutive semantically similar groups.
filter_windowint5Window length for the Savitzky-Golay filter used in boundary detection.
filter_polyorderint3Polynomial order for the Savitzky-Golay filter.
filter_tolerancefloat0.2Tolerance for the Savitzky-Golay filter boundary detection.
chunker_paramsDict[str, Any]NoneAdditional parameters to pass directly to Chonkie's SemanticChunker.