RecursiveChunkingConfiguration Configuration
RecursiveChunkingConfiguration Configuration documentation for JavaScript SDK
Properties
| Name | Type | Description | Notes |
|---|---|---|---|
| chunkSize | Number | Maximum size of a chunk (should be ≤ context window) | |
| chunkOverlap | Number | Sliding overlap between chunks | |
| separators | [String] | Hierarchical separator list (order = preference) | [optional] |
| keepStrategy | SeparatorKeepStrategy | How to handle separators after splitting. KEEP_NONE is deprecated and behaves as KEEP_END. | |
| separatorIsRegex | Boolean | Whether separators are regex patterns | [optional] |
| lengthMeasurement | LengthMeasurement | How to measure chunk length |
Usage Example
import { RecursiveChunkingConfiguration } from '@pairsystems/goodmem-client';
const config = new RecursiveChunkingConfiguration(512, 64, 'KEEP_END', 'CHARACTER_COUNT');
config.separators = ['\n\n', '\n', '. '];
config.separatorIsRegex = false;