---
slug: "Aggregate"
name: "Aggregate"
type: "Primitives"
layer: "Infrastructure"
ref: "Aggregate#2db6"
sema_id: "sema:Aggregate#mh:SHA-256:2db6858c061515fa2257c96f4a6e4392164e9a118adc6874c69cf2279b877077"
tags: ["Infrastructure","Primitives"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/Aggregate/
related: ["Vector","Mode","Value","ChunkMerge","DriftWatch","Parallelize","PerspectiveEnsemble","SelfConsistency","Vote"]
---

# Aggregate

Reduce a set to a summary statistic

Layer: Infrastructure · Category: Primitives

## Mechanism

A deterministic function that maps a [Vector](https://mindscape.pages.dev/bootstrap/Vector.md) of inputs to a single Scalar [Value](https://mindscape.pages.dev/bootstrap/Value.md). Implements standard statistical operations (Mean, Mode, Median) to compress signal bandwidth. When the caller supplies [Vector](https://mindscape.pages.dev/bootstrap/Vector.md) alongside the vector, the reduction becomes a weighted one. It serves as the computational backbone for consensus mechanisms.

## Invariants

- Determinism: F(Input) always yields the same Output.
- Yields one scalar [Value](https://mindscape.pages.dev/bootstrap/Value.md) whatever the input length, including length one.

## Preconditions

- All elements in list share a comparable type
- Input list is non-empty

## Postconditions

- Single summary value returned

## Failure modes

- Type Mismatch: Input list contains incomparable types (e.g., Integers mixed with Strings).
- Empty Set: Attempting to aggregate a list with length 0 (Undefined for Mean/[Mode](https://mindscape.pages.dev/bootstrap/Mode.md)).
- Overflow: Sum of inputs exceeds maximum integer size (if strictly typed).

## Parameters

- `function` (Enum, {Mean, Median, Mode, Sum, Min, Max, Variance, StdDev}): Default: Mean

## Builds on

- [Vector](https://mindscape.pages.dev/bootstrap/Vector.md) (Infrastructure; Accepts)
- [Vector](https://mindscape.pages.dev/bootstrap/Vector.md) (Infrastructure; Accepts)
- [Mode](https://mindscape.pages.dev/bootstrap/Mode.md) (Infrastructure; References)
- [Value](https://mindscape.pages.dev/bootstrap/Value.md) (Infrastructure; Yields)

## Used by

- [ChunkMerge](https://mindscape.pages.dev/bootstrap/ChunkMerge.md) (Mind; References)
- [DriftWatch](https://mindscape.pages.dev/bootstrap/DriftWatch.md) (Society; References)
- [Parallelize](https://mindscape.pages.dev/bootstrap/Parallelize.md) (Mind; Composes with)
- [PerspectiveEnsemble](https://mindscape.pages.dev/bootstrap/PerspectiveEnsemble.md) (Mind; References)
- [SelfConsistency](https://mindscape.pages.dev/bootstrap/SelfConsistency.md) (Mind; References)
- [Vote](https://mindscape.pages.dev/bootstrap/Vote.md) (Society; References)

## Identity

- Sema ID: `sema:Aggregate#mh:SHA-256:2db6858c061515fa2257c96f4a6e4392164e9a118adc6874c69cf2279b877077`
- Ref: `Aggregate#2db6`
- Supersedes:
  - `sema:Aggregate#mh:SHA-256:af54a8a31d6e7ed0c6d7bdfb51935655b0a66d299bddb352dbff9f4a789e7486`
  - `sema:Aggregate#mh:SHA-256:4861bd34b2e422951e42b0fd804dab73daa2753ea746c0141927c3e5c6ea8f4b`
  - `sema:Aggregate#mh:SHA-256:d1d523ccf371305ebfbd971b5b6630a517bfcb0217ff4639d2db12a01bc181a8`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/Aggregate/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#Aggregate)
- [JSON](https://mindscape.pages.dev/bootstrap/Aggregate.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
