Skip to content
v2.274.0

ChunkingConfigurationProperty Struct ​

Details about how to chunk the documents in the data source.

A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wisdom as wisdom } from 'aws-cdk-lib';
const chunkingConfigurationProperty: wisdom.CfnKnowledgeBase.ChunkingConfigurationProperty = {
  chunkingStrategy: 'chunkingStrategy',

  // the properties below are optional
  fixedSizeChunkingConfiguration: {
    maxTokens: 123,
    overlapPercentage: 123,
  },
  hierarchicalChunkingConfiguration: {
    levelConfigurations: [{
      maxTokens: 123,
    }],
    overlapTokens: 123,
  },
  semanticChunkingConfiguration: {
    breakpointPercentileThreshold: 123,
    bufferSize: 123,
    maxTokens: 123,
  },
};

Properties ​

chunkingStrategystringchunking_strategystrchunkingStrategyStringChunkingStrategystringChunkingStrategy*stringrequired#
Knowledge base can split your source data into chunks.
notes

A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt for NONE , then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.

fixedSizeChunkingConfigurationIResolvable | CfnKnowledgeBase.FixedSizeChunkingConfigurationPropertyfixed_size_chunking_configurationtyping.Union[IResolvable, FixedSizeChunkingConfigurationProperty]fixedSizeChunkingConfigurationIResolvableFixedSizeChunkingConfigurationIResolvableFixedSizeChunkingConfigurationinterface{}#
Configurations for when you choose fixed-size chunking.

If you set the chunkingStrategy as NONE , exclude this field.

hierarchicalChunkingConfigurationIResolvable | CfnKnowledgeBase.HierarchicalChunkingConfigurationPropertyhierarchical_chunking_configurationtyping.Union[IResolvable, HierarchicalChunkingConfigurationProperty]hierarchicalChunkingConfigurationIResolvableHierarchicalChunkingConfigurationIResolvableHierarchicalChunkingConfigurationinterface{}#
Settings for hierarchical document chunking for a data source.

Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

semanticChunkingConfigurationIResolvable | CfnKnowledgeBase.SemanticChunkingConfigurationPropertysemantic_chunking_configurationtyping.Union[IResolvable, SemanticChunkingConfigurationProperty]semanticChunkingConfigurationIResolvableSemanticChunkingConfigurationIResolvableSemanticChunkingConfigurationinterface{}#
Settings for semantic document chunking for a data source.

Semantic chunking splits a document into smaller documents based on groups of similar content derived from the text with natural language processing.