---
slug: "ChunkMerge"
name: "ChunkMerge"
type: "Memory"
layer: "Mind"
ref: "ChunkMerge#a7a3"
sema_id: "sema:ChunkMerge#mh:SHA-256:a7a32d00372fcda30401ab77dbcb3a3b53fd3c4f013a2c9a5346e8b49ed76285"
tags: ["Mind","Memory"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.world/scapes/bootstrap.json
url: https://mindscape.world/bootstrap/ChunkMerge/
related: ["Aggregate","Compress","Hierarchy","ExperienceSharding"]
---

# ChunkMerge

Hierarchical context management

Layer: Mind · Category: Memory

## Mechanism

Cognitive Compression: Group related items into named chunks. Treat chunk as single unit in working memory. [Hierarchy](https://mindscape.world/scapes/bootstrap/Hierarchy.md) of chunks enables handling complexity beyond raw capacity. Merge when patterns repeat; split when chunk becomes unwieldy. It applies [Aggregate](https://mindscape.world/scapes/bootstrap/Aggregate.md) to [Compress](https://mindscape.world/scapes/bootstrap/Compress.md) multiple working memory items into a single labeled unit.

## Invariants

- The chunk's name states the criterion by which its items were grouped.
- The merged chunk retains a retrieval hook for each part.
- The merged chunk fits within `max_chunk_size`.

## Preconditions

- Input chunks share semantic topic

## Failure modes

- Lossy Compression: Discarding critical low-level details (e.g., specific ID numbers) during the merge process.

## Parameters

- `max_chunk_size` (PositiveInteger, unspecified): Largest merged chunk permitted, in the units the caller measures context by.

## Builds on

- [Aggregate](https://mindscape.world/scapes/bootstrap/Aggregate.md) (Infrastructure; References)
- [Compress](https://mindscape.world/scapes/bootstrap/Compress.md) (Infrastructure; References)
- [Hierarchy](https://mindscape.world/scapes/bootstrap/Hierarchy.md) (Infrastructure; References)

## Used by

- [ExperienceSharding](https://mindscape.world/scapes/bootstrap/ExperienceSharding.md) (Mind; References)

## Identity

- Sema ID: `sema:ChunkMerge#mh:SHA-256:a7a32d00372fcda30401ab77dbcb3a3b53fd3c4f013a2c9a5346e8b49ed76285`
- Ref: `ChunkMerge#a7a3`
- Supersedes:
  - `sema:ChunkMerge#mh:SHA-256:ded6bbc1fcb067eaef0990ace28b3db2e0337744edac4e75c1da2ee1bbe3c351`
  - `sema:ChunkMerge#mh:SHA-256:e147d7618ec5f0a810d55c1671aefeda6a5ea31f0f33642660e715dd86404c68`
  - `sema:ChunkMerge#mh:SHA-256:2a85510f0a4d2505b0c577817b3e116dc203db4a2ff2755778ec9000c8e3cefc`

## Links

- [Pattern page](https://mindscape.world/bootstrap/ChunkMerge/)
- [View in the interactive graph](https://mindscape.world/bootstrap/#ChunkMerge)
- [JSON](https://mindscape.world/scapes/bootstrap/ChunkMerge.json)
- [Index of all patterns](https://mindscape.world/scapes/bootstrap.json)
