Skip to main content
Cluster visualization showing document groupings with centroids and member assignments
Clusters automatically group documents into meaningful categories. Define what to cluster on, pick an algorithm, execute, and get back labeled groups you can visualize, enrich into collections, or promote to taxonomies.

Two Clustering Types

Mixpeek supports two fundamentally different ways to cluster documents:

Vector (Semantic)

Groups documents by embedding similarity — what they mean, not what metadata they have. Uses vector embeddings from any extractor (text, image, multimodal) and supports 8 algorithms.Best for: topic discovery, content deduplication, visual similarity, finding themes across modalities.

Attribute (Metadata)

Groups documents by metadata field values — like a GROUP BY on structured columns. No embeddings needed; operates directly on payload fields.Best for: categorical grouping, hierarchical organization by brand/category/status, faceted analytics.

Vector Clustering

Attribute Clustering

With hierarchical_grouping: true, this creates nested groups: “Electronics” containing “Apple”, “Samsung”, etc. Without it, you get flat groups like “Electronics_Apple”, “Electronics_Samsung”.

Algorithms

Vector clustering supports 8 algorithms. Pick based on whether you know how many clusters to expect:
Start with HDBSCAN if you don’t know how many clusters to expect. Use K-Means when you have a target count and want fast results.

Multi-Feature Strategy

When clustering on multiple embeddings (e.g., text + image), choose how to combine them:

Visualization Dimensions

In Studio, the cluster scatter plot encodes three visual dimensions so you can explore cluster structure at a glance: To enable the size dimension, set 3 components in your dimensionality reduction config:
Without the third component, all dots render at the same size. With it, the Z value is linearly mapped to dot radius (10px–50px), so visually prominent points sit “closer” in the third principal axis.

Centroid Methods

Control how cluster centers are calculated:

Preprocessing

High-dimensional embeddings (1408d, 3072d) benefit from preprocessing before density-based algorithms. The preprocessing_steps field accepts an ordered list:
Decorrelates embedding dimensions, removing redundant structure that causes density-based algorithms to over-fragment.
Reduces dimensionality while preserving neighborhood structure. Critical for HDBSCAN on high-dimensional data.

Execution Modes

Incremental Assignment

Documents below the assignment_threshold cosine similarity are marked as noise (cluster_id = -1).

Composite Clustering

Clusters centroids from prior runs to reveal higher-order patterns. A run with 10,000 documents and 50 clusters contributes only 50 vectors, so composite execution is fast. Map your library along multiple dimensions at once. A common analyst question — “how do my visual-style groups relate to my messaging-theme groups?” — is expressed with exactly this machinery, no tagging required:
  1. Run several independent clusterings on the same collection (one per dimension — e.g. one over visual embeddings, one over transcript embeddings). Each is its own cluster resource; a collection can have as many as you need.
  2. Composite them: pass the runs as source_execution_ids with mode: "composite". The composite groups the centroids from every input run, so groups that land together across dimensions surface as one higher-order pattern (e.g. a “street-interview format” centroid clustering next to a “risk-reversal claim” centroid = a combination worth briefing).
  3. Read the result on the cluster’s visualization map in Studio (lasso a region to search inside it, or create a retriever scoped to a group directly from the map).
A first-class per-document cross-tab (counts of group A × group B membership) isn’t a built-in view yet — the composite map shows how the groupings relate at the pattern level, and each input clustering keeps its own per-document groups.

Hierarchical Sub-Clustering

Enable recursive sub-clustering when top-level clusters are too broad. Each cluster with enough members is further divided using UMAP + HDBSCAN.
Sub-clusters get IDs like cl_0_sub_1_sub_0. Each centroid includes parent_cluster_id, child_cluster_ids, and hierarchy_level. Example: “sports” → “basketball” → “NBA highlights”.

Quality Metrics

Every execution returns metrics that tell you whether your clusters are meaningful: Per-member similarity is also tracked:

LLM Labeling

Generate human-readable names, summaries, and keywords for each cluster. Control which document fields the LLM sees using input mappings.

Text-Only Labeling

Multimodal Labeling

Send images or video alongside text for richer labels. Use a vision-capable model:

Input Mapping Reference

Without labeling_inputs, the full document payload is serialized as JSON. Input mappings let you send only the fields that matter.

Custom Prompts and Response Shapes

Override the default prompt for domain-specific labels:

Labeling Settings

Enrichment

Write cluster membership back into your source collections:
This writes cluster_id and labels into document payloads, enabling cluster-based filters and facets in retrievers.

Execution & Triggers

  • Manual: POST /v1/clusters/{id}/execute
  • Async job: POST /v1/clusters/{id}/execute/submit
  • Automated: create cron, interval, or event-based triggers under /v1/clusters/triggers
  • Every run yields a run_id and exposes status via GET /v1/clusters/{id}/executions

Artifacts

Management

Best Practices

  1. Start with HDBSCAN + whitening + UMAP for vector clustering on high-dimensional embeddings.
  2. Prototype on samples — tune parameters with a small sample_size before running at scale.
  3. Use incremental assignment for streaming datafull periodically, assign for new documents in between.
  4. Monitor quality metrics — check silhouette_score and noise_ratio after each run. Recluster when should_recluster fires.
  5. Use attribute clustering for categorical grouping — don’t force embeddings when metadata fields already capture the structure.
  6. Try multi-feature weighted strategy when combining modalities — let Bayesian optimization find the right blend.
  7. Enable 3-component dimensionality reduction to get the depth (size) dimension in Studio visualizations.

Clusters vs Taxonomies vs Alerts