---
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"
---

1.  [](/)
2.  [Glossary](/glossary)
3.  Multi-Stage Retrieval Pipeline

[Back to Glossary](/glossary)

# What is Multi-Stage Retrieval Pipeline

## Multi-Stage Retrieval Pipeline - A composable chain of filter, sort, reduce, enrich, and apply stages that progressively refine search results over unstructured data.

A multi-stage retrieval pipeline is the query language for unstructured data. Like SQL composes WHERE, ORDER BY, LIMIT, and JOIN for structured data, multi-stage retrieval composes filter, sort, reduce, enrich, and apply stages for multimodal content. Each stage takes the previous stage's output as input, progressively narrowing and enriching the result set.

### How It Works

A pipeline is defined as an ordered list of stages. The first stage (usually a filter) searches across an embedding space to produce an initial candidate set. Subsequent stages narrow, reorder, sample, or enrich those candidates. For example: face search (847 candidates) → logo filter (23) → sentiment sort (23 reordered) → top-k reduce (5) → brand context enrich (5 enriched results).

### The SQL Analogy

*   Filter stages are like WHERE clauses: they narrow the candidate set by embedding similarity or metadata
*   Sort stages are like ORDER BY: they re-rank results by weighted combinations of scores
*   Reduce stages are like LIMIT and DISTINCT: they control output size via sampling or deduplication
*   Enrich stages are like JOIN: they attach data from other collections (the semantic join)
*   Apply stages are like INSERT INTO...SELECT: they write results or trigger side effects

### Best Practices

*   Start with broad filter stages and narrow progressively; don't over-constrain early
*   Use sort stages to combine multiple ranking signals with explicit weights
*   Always include a reduce stage to control output size
*   Use enrich stages for cross-collection context instead of client-side merging
*   Test pipelines with different stage orders, since the sequence affects both quality and latency

### Related Pages

*   Retriever documentation: /docs/retrieval/retrievers
*   Retrieval Cookbook: /docs/retrieval/cookbook
*   Blog: Multi-Stage Retrieval Pipelines - /blog/multi-stage-retrieval-pipelines

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

[Put it to work: search your own files](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=glossary_onramp&utm_campaign=mvs_onramp)

### Related Terms

[ACID](/glossary/acid)[API](/glossary/api)[Blob Storage](/glossary/blob-storage)[CLIP](/glossary/clip)[Embedding](/glossary/embedding)