# Multi-vector encodings

Multi-vector embeddings represent a single data object, like a document or image, using a set of multiple vectors rather than a single vector. This approach allows for a more granular capture of semantic information, as each vector can represent different parts of the object. However, this leads to a significant increase in memory consumption, as multiple vectors are stored for each item.

Compression techniques become especially crucial for multi-vector systems to manage storage costs and improve query latency. **Encodings** transform the entire set of multi-vectors into a new, more compact single vector representation while aiming to preserve semantic relationships.

## MUVERA encoding

**MUVERA**, which stands for _Multi-Vector Retrieval via Fixed Dimensional Encodings_, tackles the higher memory usage and slower processing times of multi-vector embeddings by encoding them into single, fixed-dimensional vectors. This leads to reduced memory usage compared to traditional multi-vector approaches.

:::callout{intent="tip" title="Weaviate Embeddings multimodal model"}
The [Weaviate Embeddings multimodal model](../model-provider-integrations/weaviate-embeddings-multimodal.md) (`ModernVBERT/colmodernvbert`) produces multi-vector embeddings for visual document retrieval. We recommend enabling MUVERA encoding when using this model to optimize memory usage.
:::

<!-- TODO[g-despot]: Add link to blog post: Read more about it in this blog post. -->

:::code-group{sync="languages"}
```python title="Python" {10-15}
from weaviate.classes.config import Configure

client.collections.create(
    "DemoCollection",
    vector_config=[
        # Example 1 - Use a model integration
        Configure.MultiVectors.text2vec_jinaai(
            name="jina_colbert",
            source_properties=["text"],
            encoding=Configure.VectorIndex.MultiVector.Encoding.muvera(
                # Optional parameters for tuning MUVERA
                # ksim: 4,
                # dprojections: 16,
                # repetitions: 20,
            ),
        ),
        # Example 2 - User-provided multi-vector representations
        Configure.MultiVectors.self_provided(
            name="custom_multi_vector",
            encoding=Configure.VectorIndex.MultiVector.Encoding.muvera(),
        ),
    ],
    # Additional parameters not shown
)
```

```typescript title="JavaScript/TypeScript"
import { configure } from 'weaviate-client';
```

```java title="Java" {5-11}
client.collections.create("DemoCollection", col -> col.vectorConfig(
    // Example 1 - Use a model integration
    VectorConfig.text2multivecJinaAi("jina_colbert",
        vc -> vc.sourceProperties("text")
            .vectorIndex(Hnsw.of(h -> h.multiVector(
                MultiVector.of(mv -> mv.encoding(Encoding.muvera(e -> e
                // Optional parameters for tuning MUVERA
                // .ksim(4)
                // .dprojections(16)
                // .repetitions(20)
                ))))))
    ),
    // Example 2 - User-provided multi-vector representations
    VectorConfig.selfProvided("custom_multi_vector",
        vc -> vc.vectorIndex(Hnsw.of(h -> h.multiVector(
            MultiVector.of(mv -> mv.encoding(Encoding.muvera())))))))
// Additional parameters not shown
);
```

```go title="Go"
// Go support coming soon
```

```csharp title="C#"
await client.Collections.Create(
    new CollectionCreateParams
    {
        Name = "DemoCollection",
        VectorConfig = new VectorConfigList
        {
            // Example 1 - Use a model integration
            Configure.MultiVector(
                "jina_colbert",
                v => v.Text2MultiVecJinaAI(),
                index: new VectorIndex.HNSW
                {
                    MultiVector = new MultiVectorConfig { Encoding = new MuveraEncoding() },
                }
            ),
            // Example 2 - User-provided multi-vector representations
            Configure.MultiVector(
                "custom_multi_vector",
                v => v.SelfProvided(),
                index: new VectorIndex.HNSW
                {
                    MultiVector = new MultiVectorConfig { Encoding = new MuveraEncoding() },
                }
            ),
        },
    }
);
```
:::

The final dimensionality of the MUVERA encoded vector will be
`repetitions * 2^ksim * dprojections`. Carefully tuning these parameters
is crucial to balance memory usage and retrieval accuracy.

These parameters can be used to fine-tune MUVERA:

- **`ksim`** (`int`, default: `4`):
  The number of Gaussian vectors sampled for the SimHash partitioning function.
  This parameter determines the number of bits in the hash, and consequently,
  the number of buckets created in the space partitioning step. The total
  number of buckets will be $2^$. A higher value of `ksim` leads to a
  finer-grained partitioning of the embedding space, potentially improving
  the accuracy of the approximation but also increasing the dimensionality
  of the intermediate encoded vectors.

- **`dprojections`** (`int`, default: `16`):
  The dimensionality of the sub-vectors after the random linear projection
  in the dimensionality reduction step. After partitioning the multi-vector
  embedding into buckets, each bucket's aggregated vector is projected down
  to `dprojections` dimensions using a random matrix. A smaller value of
  `dprojections` helps in reducing the overall dimensionality of the final
  fixed-dimensional encoding, leading to lower memory consumption but potentially
  at the cost of some information loss and retrieval accuracy.

- **`repetitions`** (`int`, default: `10`):
  The number of times the space partitioning and dimensionality reduction
  steps are repeated. Each repetition captures a different perspective
  of the multi-vector embedding and can improve the robustness and accuracy
  of the final fixed-dimensional encoding. The resulting single vectors from
  each repetition are concatenated. A higher number of repetitions increases
  the dimensionality of the final encoding but can lead to better approximation
  of the original multi-vector similarity.

:::callout{intent="note" title="Quantization"}
Quantization is also available as a compression technique for multi-vector embeddings. It reduces the memory footprint of individual vectors by approximating their values with less precision. Just like with single vectors, multi-vectors support [PQ](compression-pq-compression.md), [BQ](compression-bq-compression.md), [RQ](compression-rq-compression.md) and [SQ](compression-sq-compression.md) quantization.
:::

## Further resources

- [How-to: Manage collections](../how-to-manage-collections/vector-config.md#define-multi-vector-embeddings-eg-colbert-colpali)
- [Concepts: Vector quantization](../concepts/vector-quantization.md)

## Questions and feedback

Have a question or feedback? Here's how to reach us.

::::card-grid
:::card{title="Community Forum" href="https://forum.weaviate.io/c/support" icon="messages-square"}
Ask questions and connect with other developers on our **Community forum**.
:::

:::card{title="Support" href="/guides/support-overview" icon="life-buoy"}
Weaviate Cloud user or customer? Find the right channel on the **Support page**.
:::
::::

## Related pages

- [Agents](./agents-index.md)
- [AI-assisted Weaviate code generation](./ai-assisted-vibe-coding-index.md)
- [APIs](./apis-index.md)
- [Authorization and authentication](./authorization-and-authentication-index.md)
- [Benchmarks](./benchmarks-index.md)
- [Best practices](./best-practices-index.md)
- [Client libraries](./clients-index.md)
- [Client Libraries / SDKs](./client-libraries-index.md)
- [Cloud](./cloud-index.md)
- [Cloud account management](./cloud-account-management-index.md)

# Agent Instructions

This portal answers questions programmatically. To receive a synthesized,
source-cited answer instead of crawling page by page, append the `?ask=`
query parameter to any page URL on this site:

    /guides/quickstart?ask=how+do+I+authenticate

Optional parameters:

- `&goal=<what-you-are-trying-to-do>` steers the answer toward your
  objective (e.g. `&goal=write+a+python+client`).
- `&version=<label>` scopes the answer to a mounted version when the
  portal publishes more than one.

The response is `text/markdown`: the answer followed by a `# Sources` list
of the portal pages it was grounded in. Status codes are the contract:

- `200` — the answer; `402` — the portal owner’s plan or answer credits are
  exhausted (surface this to your operator; do NOT retry); `429` — you are
  rate-limited; back off for the `Retry-After` seconds; `503` — the answer
  lane is temporarily unavailable; fall back to crawling the `.md` pages.

For the full corpus map read `llms.txt` at the site root; for the tool
surface (search + page fetch as MCP tools) see `/mcp`.
