---
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.  [Code examples](/recipes)
3.  RAG with MVS Standalone

Back to code examples

Cross-MediaSimilar

# RAG with MVS Standalone

Complete RAG pipeline using MVS for retrieval and OpenAI for generation. Chunk your documents, embed them with any provider, store in MVS, retrieve relevant context, and generate answers -- no managed feature extractors needed.

text

Multi-Tier

[Run in Builder](/build?recipe=mvs-rag-pipeline)

"What is the recommended database architecture for high availability?"

### Why This Matters

Full control over your RAG pipeline without vendor lock-in. Choose your own chunking strategy, embedding model, and LLM while MVS handles the vector storage and retrieval at scale.

Python

cURL

from openai import OpenAI

from mixpeek import Mixpeek

openai \= OpenAI(api\_key\="YOUR\_OPENAI\_KEY")

client \= Mixpeek(api\_key\="YOUR\_API\_KEY")

NAMESPACE \= "rag-docs"

def embed(text):

    return openai.embeddings.create(model\="text-embedding-3-small", input\=text).data\[0\].embedding

def chunk\_text(text, size\=200, overlap\=40):

    words \= text.split()

    return \[" ".join(words\[i:i + size\]) for i in range(0, len(words), size \- overlap)\]

client.namespaces.create(

    namespace\_id\=NAMESPACE,

    mode\="standalone",

    vector\_configs\=\[{"name": "dense", "dimension": 1536, "metric": "cosine"}\],

)

\# 1. Chunk a document and upsert every chunk with its vector and text

with open("architecture-guide.md") as f:

    chunks \= chunk\_text(f.read())

client.namespaces.documents.upsert(

    namespace\_id\=NAMESPACE,

    documents\=\[

        {

            "document\_id": f"architecture-guide-{i}",

            "vectors": {"dense": embed(chunk)},

            "payload": {"content": chunk, "source": "architecture-guide.md", "chunk\_index": i},

        }

        for i, chunk in enumerate(chunks)

    \],

)

\# 2. Retrieve the closest chunks for the question

question \= "What is the recommended database architecture for high availability?"

results \= client.search(

    namespace\_id\=NAMESPACE,

    queries\=\[{"feature\_uri": "dense", "query": {"input\_mode": "vector", "value": embed(question)}, "top\_k": 5}\],

)

\# 3. Answer from those chunks, citing them by index

context \= " ".join(f"\[{doc.get('chunk\_index')}\] {doc.get('content')}" for doc in results\["documents"\])

response \= openai.chat.completions.create(

    model\="gpt-4o",

    messages\=\[

        {"role": "system", "content": "Answer from this context and cite chunk numbers. " + context},

        {"role": "user", "content": question},

    \],

)

print(response.choices\[0\].message.content)

### Feature Extractors

### Retriever Stages

feature search

Search and filter documents by vector similarity using feature embeddings

filter

### Documentation

[MVS Overview](https://mixpeek.com/docs/vector-store/overview)[Document Search](https://mixpeek.com/docs/vector-store/overview)[Namespaces](https://mixpeek.com/docs/vector-store/namespaces)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Recipe

### Dense Search Over Your Own Embeddings, and What Hybrid Needs

Upsert documents you embedded elsewhere into an MVS namespace and search them by raw vector through the features search endpoint. Hybrid BM25 plus dense is not part of a plain BYO upsert: the documents carry dense vectors only and no text index is created. If you want a lexical leg later, declare a TEXT payload index on the field when you create the namespace; this recipe shows that declaration and the dense search that works today.

Learn more





](/recipes/mvs-hybrid-bm25-dense)[

Recipe

### Multimodal Search with MVS

Build multimodal search by embedding different content types (text, images, video frames) with your own models and searching across them in a single MVS namespace. Use CLIP or any multimodal embedding model for cross-modal retrieval.

Learn more





](/recipes/mvs-multimodal-search)[

Recipe

### Document Intelligence Search

Extract and search through PDFs, presentations, and documents. Combines OCR, layout analysis, and semantic search for comprehensive document retrieval.

Learn more





](/recipes/document-search-pipeline)[

Recipe

### BYO Embeddings Vector Search

Bring pre-computed embeddings from any provider (OpenAI, Cohere, Together, etc.) and upsert them directly into MVS for instant vector search. No feature extractors, no pipelines -- just embeddings in, results out.

Learn more





](/recipes/mvs-byo-embeddings-search)[

Extractor

### Web Scraper

Extract structured data from webpages while maintaining semantic context and relationships

Learn more





](/extractors/web-scraper)[

Extractor

### Text Embedding

Extract semantic embeddings from documents, transcripts and text content

Learn more





](/extractors/text)