Skill 1.5.1

Develop effective document segmentation approaches to optimize retrieval performance for FM context augmentation (for example, by using Amazon Bedrock chunking capabilities, Lambda functions to implement fixed-size chunking, custom processing for hierarchical chunking based on content structure)

Key Concepts

Bedrock Knowledge Bases offer default chunking (about 300 tokens, respecting sentences), fixed-size chunking with a maximum token count and an overlap percentage, hierarchical chunking (small child chunks are searched and their larger parent chunks are returned), semantic chunking (splits where meaning changes, using a buffer and a breakpoint percentile threshold) and no chunking for documents that are already split. A custom transformation Lambda function can implement any other logic.

Small chunks match specific questions precisely but lose surrounding context; large chunks keep context but dilute the embedding and use more prompt tokens. Structure-aware chunking splits on headings, sections, table boundaries or code blocks and adds the section title to each chunk. The chunking strategy of a knowledge base data source cannot be changed after creation, so a new data source or knowledge base is needed to change it.