---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

Retrieval

9 min read

Updated 2026-09-28

# How Do You Run Agentic Search Over a Hierarchy of Clusters?

Cluster the corpus into a labeled tree, then answer a query by walking the tree from the top, choosing the child cluster most likely to hold the answer at every level. A decision model such as TypeSafe's Jev returns a probability for each branch, so the walk can keep several paths open and rank them. This covers how to build the tree, how the walk works, and when it beats a single vector search.

![Ethan Steininger](/people/ethan.webp)

By [Ethan Steininger](/blog/authors/ethan), Founder & CEO, Mixpeek

Clustering

Hierarchical Search

Agentic Search

Jev

Beam Search

Retrieval

[Run this on your own data. Try it as you read.Search your own archive →](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=guide_cta&utm_campaign=mvs_onramp)

[One-click templatesStart from a templateEach template deploys a working search app on your own files.Browse templates](/templates)

## The Short Answer

  
  
Cluster your collection into a hierarchy, give each cluster a label, and search by walking that hierarchy from the top. At each level a model reads the query and the labels of the child clusters and picks the one most likely to contain the answer. At the bottom level, you search or return the documents inside the clusters it chose.  
  
The model making those choices picks one option from a short list and reports how sure it is. An evaluation model such as TypeSafe's Jev is built for that job: each branch decision comes back as a probability for each child cluster. With probabilities you can keep the best two or three paths open at each level and rank complete paths at the end, which is a beam search over your corpus.  
  
In Mixpeek this is the `cluster_navigation` strategy of the `agent_search` retriever stage, with `model_name: "jev-latest"`.  
  

## Cases a single vector search misses

  
  
A single vector search compares the query against the indexed documents and returns the nearest ones. That works when the words in the query sit close to the words in the answer. It struggles in three situations:  
  
*   **The query names a category, and the documents use other words.** "Drug
commercials that disclose side effects" shares almost no words with an ad that says "ask your doctor, may cause dizziness", and both belong to the same category.*   **Neighbouring topics share vocabulary.** A sneaker ad featuring a basketball star
and a clip of a basketball game use the same words. One belongs under advertising, the other under sports.*   **You need to explain the result.** A path such as Product Ads > Pharmaceutical Ads
tells a reviewer why a document came back.  
  
Walking a labeled tree decides the category first and searches second.  
  

## Step 1: build and label the tree

  
  
Run hierarchical clustering over the collection's embeddings. KMeans or HDBSCAN at the top level, then the same algorithm inside each top-level cluster, gives you a two-level tree. Each cluster gets a centroid document that records its label, summary and parent.  
  
Label the clusters from a vocabulary you control. Generated labels drift between runs and between levels. A fixed list keeps "Pharmaceutical Ads" spelled the same way on each run, and it lets you line the tree up with a taxonomy you already use. Jev picks each cluster's label from the list and returns the probability, so a cluster labeled with low confidence is easy to find and review.  
  

## Step 2: walk it with probabilities

  
  
At the top level the model sees the query and the top-level labels, with each cluster's summary as the description of that option. It returns a probability for each. Keep the best few. At the next level, ask about the children of each path you kept, all in one request. Score each complete path by the geometric mean of the probabilities along it, so a shallow leaf and a deep leaf compare on equal terms.  
  
Greedy descent, keeping one path, is a beam width of one. It makes one request per level and cannot recover from an early mistake. A beam of two or three lets a later level correct an ambiguous first choice at almost no extra latency, because the paths share a request.  
  
On an eleven-cluster, two-level tree we tested, the walk routed "Nike commercial with a basketball player" to Product Ads > Sneaker Ads at 0.99, and kept Sports > Basketball as the runner-up at 0.14. Each two-level walk took 0.8 to 1.3 seconds.  
  

## Step 3: return the documents

  
  
Return the members of the best leaf clusters, or run a vector search first and keep only the hits that fall inside the chosen clusters. The second form keeps the vector search's ordering and uses the tree as a filter.  
  

## Use a flat search for short, specific queries

  
  
Use a single vector search when queries name the thing itself ("the Q3 earnings call"), when the corpus is small enough that a query reads most of it anyway, or when latency under 100 ms matters more than precision. Tree walking earns its extra second when queries name categories, when topics overlap, or when the path is part of the answer.  
  

## Related

  
  
*   [Mixpeek docs: hierarchical search over clusters](https://docs.mixpeek.com/tutorials/hierarchical-cluster-search)
*   [Jev in Mixpeek](https://docs.mixpeek.com/processing/jev)

## Run this on your own data

Point Mixpeek at the storage you already have and search your video, images, audio, and documents the way this guide describes. Build starts at $25/mo for up to 1M vectors.

[Search your own archive](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=guide_cta&utm_campaign=mvs_onramp)[Read Docs](/docs)

[Explore MVS](/mvs)[See pricing](/pricing)

## Related guides

[

Retrieval

### Should a RAG Pipeline Use a Classification Model or an LLM to Filter and Rerank Results?

Use a classification model for any filter or rerank step whose answer is a choice from a list: keep or drop, a label, a relevance score. Keep a generative LLM for steps that write new text. This compares cross-encoder rerankers, decision models such as Jev and Liquid AI d1, and LLM judges on cost, speed and how far you can trust each score.

Read guide →](/guides/decision-models-in-retrieval-pipelines)[

Retrieval

### Late Interaction Retrieval: How ColBERT, ColPali, and ColQwen Search Without Losing Token-Level Detail

A technical guide to late interaction retrieval models: the architecture that keeps per-token embeddings instead of compressing everything into a single vector. Covers how MaxSim scoring works, why it outperforms dense retrieval on complex queries, the evolution from ColBERT (text) to ColPali (visual documents) to ColQwen (multimodal), and how to build retrieval pipelines that combine late interaction with dense search.

Read guide →](/guides/late-interaction-retrieval)[

Retrieval

### What Is Hybrid Search? BM25, Vector Retrieval, and How to Fuse Their Rankings

Why keyword and vector retrieval fail on opposite queries, what BM25 actually computes, and how Reciprocal Rank Fusion combines two rankings whose scores are not on the same scale. Covers the term-frequency saturation and length normalization inside BM25, why raw score addition breaks, RRF versus min-max and convex combination, how to pick the weighting, when hybrid is worse than either half, and what changes when one side of the index is video or images.

Read guide →](/guides/hybrid-search-bm25-vector-fusion)