# RAG, embedding, and reranking model guide

RAG combines chunking, embeddings, retrieval, reranking, grounded generation, and evaluation; completeness comes from citable evidence and no-answer handling, not a larger model list.

## RAG is not one model

Reliable RAG combines data cleaning and permissions, chunking, embeddings, vector or keyword retrieval, reranking, context assembly, evidence-grounded generation, and citations. Skipping a stage can make fluent answers look like correct retrieval.

## Build the index

Use the provider's documented input type for documents and queries and record embedding model, dimension, normalization, and chunking version. A model or dimension change requires a new index and staged migration; never mix incompatible vector spaces.

## Query flow

Apply authorization before retrieval, combine enough lexical and semantic candidates, rerank them, and pass document IDs, titles, locations, and text to generation. Require answers to use evidence and return no answer when evidence is insufficient.

## Evaluation

Measure Recall@K, MRR or NDCG, reranking, answer correctness, citation coverage and entailment, no-answer accuracy, and latency separately. Include stale, conflicting, unauthorized, and missing-evidence cases.

## Security and operations

Do not let prompt injection in documents gain tool authority; isolate retrieved text from system instructions. Monitor index freshness, empty retrieval, authorization failures, model upgrades, cost, and propagation of deletion requests.

## Use cases

- Enterprise knowledge Q&A
- Semantic search
- Retrieval reranking

## API paths

- /v1/embeddings
- /v1/rerank
- /v1/chat/completions

## Related guides

- [Jina AI](https://api.tu-zi.com/en/docs/providers/jina-ai): Jina AI is both a search-model vendor and a hosted API provider, not a general chat catalog. Direct calls use a Jina Bearer key; this site exposes only adapted Embeddings and Rerank routes with a site-issued key.
- [Cohere](https://api.tu-zi.com/en/docs/providers/cohere): New direct Cohere integrations use native `POST /v2/chat`. This site's `/v1/chat/completions` is an OpenAI-compatible route to an adapted channel, not Cohere's native path. Embed requires the correct `input_type` and dimension, while Rerank, Trial/Production limits, and model retirement must be checked separately.
- [Mistral family](https://api.tu-zi.com/en/docs/models/mistral): Mistral currently features Medium 3.5 and Small 4 for general and agentic work, plus dedicated code, OCR, speech, embedding, and safety models with distinct licenses.
- [Meta Llama](https://api.tu-zi.com/en/docs/models/llama): Llama is Meta's open-weight family, normally used through self-hosting or cloud partners; model cards, licenses, prompt templates, and the actual runtime jointly define behavior.

## Frequently asked questions

### Can an existing vector index be reused after changing the embedding model?

Usually not. A model, dimension, normalization, or input-type change can make vector spaces incompatible. Build a new versioned index and migrate gradually; never mix old and new vectors in one index.

### Do I still need RAG and reranking when the context window is large?

Often yes. Sending many documents raises cost and latency without guaranteeing attention to key evidence, while retrieval can apply authorization first and shrink the evidence set. This site's marketplace currently publishes no verifiable Rerank model, so start with Embeddings or another recall method and add reranking only after model details explicitly list `/v1/rerank`.

### How should RAG be evaluated—can fluent final answers be enough?

No. Measure Recall@K, MRR or NDCG, reranking quality, answer correctness, citation coverage and entailment, no-answer accuracy, and latency separately. Include stale, conflicting, unauthorized, and missing-evidence cases.

### How can RAG prevent unauthorized documents or prompt injection from leaking data?

Apply server-side authorization before retrieval, isolate document text from system instructions, and never let retrieved text grant tool authority. Logs and indexes need redaction, tenant isolation, and deletion propagation, while answers retain document IDs and locations for audit.

## Sources

- Jina Models: https://jina.ai/models/
- Cohere Models: https://docs.cohere.com/docs/models

## Documentation source

Source: https://api.tu-zi.com/en/docs/use-cases/rag

Reviewed: 2026-08-12

This document is an integration reference. Provider-native APIs may differ from this site's APIs; use the corresponding API Reference and model marketplace to confirm the site URL, authentication, model ID, group and parameters. This document does not certify live success for every model or upstream service. It contains documentation and examples, without the current user's credentials or request history.
