1.  [](/)
2.  [Templates](/templates)
3.  RAG-Prepared Search

Back to Templates

Enriched Search

# RAG-Prepared Search

## Optimized pipeline to prepare search results for LLM context windows. Includes reranking and context formatting.

3 stages

[Read Docs](https://mixpeek.com/docs/retrieval/retrievers)

[Integrate Now](/start)

Use in Studio

No credit card to start · Build from $25/mo

OverviewAPIRelated

### Pipeline Stages

1

semantic\_search

filter

`feature_search`

View parameters

{
  "searches": \[
    {
      "feature\_uri": "mixpeek://text\_extractor@v1/multilingual\_e5\_large\_instruct\_v1",
      "query": {
        "input\_mode": "text",
        "value": "{{INPUT.query}}"
      },
      "top\_k": 100
    }
  \],
  "final\_top\_k": 30
}

2

rerank

sort

`rerank`

View parameters

{
  "inference\_name": "baai\_bge\_reranker\_v2\_m3",
  "query": "{{INPUT.query}}",
  "document\_field": "content",
  "top\_k": 10
}

3

rag\_prepare

apply

`rag_prepare`

View parameters

{
  "max\_tokens": 4000,
  "overlap\_tokens": 100,
  "include\_metadata": true,
  "format": "markdown"
}

### Input Schema

`query`

text

required

Query for RAG context

#### Use Cases

*   LLM context preparation
*   Chatbot backends
*   AI assistant integration
*   Context window optimization

#### Requirements

*   Collection must have text embeddings indexed
*   Reranker service must be available

#### Tags

rag

context

llm

preparation

#### Ready to use this template?

Clone it into your namespace and start querying in minutes.

Use in Studio