Abstract Class: ChunkingStrategy
September 24, 2025 ยท View on GitHub
@cdklabs/generative-ai-cdk-constructs
@cdklabs/generative-ai-cdk-constructs / bedrock / ChunkingStrategy
Abstract Class: ChunkingStrategy
Properties
configuration
abstractconfiguration:ChunkingConfigurationProperty
The CloudFormation property representation of this configuration
DEFAULT
readonlystaticDEFAULT:ChunkingStrategy
Fixed Sized Chunking with the default chunk size of 300 tokens and 20% overlap.
FIXED_SIZE
readonlystaticFIXED_SIZE:ChunkingStrategy
Fixed Sized Chunking with the default chunk size of 300 tokens and 20% overlap.
You can adjust these values based on your specific requirements using the
ChunkingStrategy.fixedSize(params) method.
HIERARCHICAL_COHERE
readonlystaticHIERARCHICAL_COHERE:ChunkingStrategy
Hierarchical Chunking with the default for Cohere Models.
- Overlap tokens: 30
- Max parent token size: 500
- Max child token size: 100
HIERARCHICAL_TITAN
readonlystaticHIERARCHICAL_TITAN:ChunkingStrategy
Hierarchical Chunking with the default for Titan Models.
- Overlap tokens: 60
- Max parent token size: 1500
- Max child token size: 300
NONE
readonlystaticNONE:ChunkingStrategy
Amazon Bedrock treats each file as one chunk. Suitable for documents that are already pre-processed or text split.
SEMANTIC
readonlystaticSEMANTIC:ChunkingStrategy
Semantic Chunking with the default of bufferSize: 0,
breakpointPercentileThreshold: 95, and maxTokens: 300.
You can adjust these values based on your specific requirements using the
ChunkingStrategy.semantic(params) method.
Methods
fixedSize()
staticfixedSize(props):ChunkingStrategy
Method for customizing a fixed sized chunking strategy.
Parameters
props
FixedSizeChunkingConfigurationProperty
Returns
ChunkingStrategy
hierarchical()
statichierarchical(props):ChunkingStrategy
Method for customizing a hierarchical chunking strategy. For custom chunking, the maximum token chunk size depends on the model.
- Amazon Titan Text Embeddings: 8192
- Cohere Embed models: 512
Parameters
props
Returns
ChunkingStrategy
semantic()
staticsemantic(props):ChunkingStrategy
Method for customizing a semantic chunking strategy. For custom chunking, the maximum token chunk size depends on the model.
- Amazon Titan Text Embeddings: 8192
- Cohere Embed models: 512
Parameters
props
SemanticChunkingConfigurationProperty
Returns
ChunkingStrategy