# Embeddings

> The embedding models Divinci can use, and how to pick between throughput and quality.

<ToolCatalogTable type="RAG/EmbeddingGenerator" />

<Aside type="danger" title="Never mix embedding models inside one vector">
Vectors produced by two different models live in **incompatible spaces**, even
at identical dimensionality. Mixing them does not error — similarity search just
quietly gets worse, in a way that looks like "the corpus isn't very good". The
vector's `embeddingModel` is the source of truth; do not override it per
request.
</Aside>

## Picking by ingestion shape, not by quality alone

The two Gemini embedding models differ far more in **rate limit** than in
output quality, and that is usually what decides:

| Model | Requests/min | API mode | Use for |
| --- | --- | --- | --- |
| `gemini-embedding-001@1536` | ~100K | batched | **Catalog imports and any batch over ~100 files.** Survives parallel ingestion. |
| `gemini-embedding-2-preview@1536` | ~4K | unbatched | **Individual uploads and quality-sensitive corpora.** Saturates immediately under batch load. |

Practical rule:

- **A single PDF, transcript or page** — either model finishes inside the
  window, even with hundreds of chunks.
- **A catalog of 30 or fewer items** — either works; the preview model will hit
  its cap briefly and the retry chain absorbs it.
- **A bulk import, or a fresh corpus reseed** — use `gemini-embedding-001`, or
  ingest through a temporary vector on it and re-embed later.

**The failure signature of getting this wrong** is a pile of
`Temporary API error (429)` / `Quota exceeded for … online_prediction_requests`
entries in the vector's failed sources. That is a rate cap, not a bug: retries
do eventually succeed, at the cost of hours of wall-clock.

## Dimensions

`1536` and `3072` variants of `gemini-embedding-001` are separate tools because
dimensionality is part of the vector's contract — the store is created at that
width. Larger is not free: it costs proportionally more storage and query time
for a gain that is corpus-dependent.

## See also

- [RAG & Vector Stores](/vendors/rag/)
- [RAG Knowledge Base](/server/rag/)
