I am unable to create multi dimensional vectors in Weavaite

Description

I am using database version 1.30.1, Python 3.9 and weaviate-client version 4.14.1. I am trying to insert multi-vector embeddings into a database, following the documentation

Any additional Information

I was following this part of the documentation to insert user-generated embeddings.

But the database is filled with a 1D vector with junk values.

Code:

collection_name = "ColbertDocs"
client.collections.create(
    name=collection_name,
    properties=[
        Property(name="text", data_type=DataType.TEXT),
        Property(name="docid", data_type=DataType.TEXT),
    ],
    vectorizer_config=[
        Configure.NamedVectors.none(
            name="multi_vector",  # your custom vector field name
            vector_index_config=Configure.VectorIndex.hnsw(
                multi_vector=Configure.VectorIndex.MultiVector.multi_vector()
            )
        )
    ]
)

# Step 2: Add an object with a 2D vector (list of vectors)
collection = client.collections.get(collection_name)

# Example 2D vector: 3 tokens x 4 dimensions
colbert_embedding = [
    [0.1, 0.2, 0.3, 0.4], 
    [0.5, 0.6, 0.7, 0.8], 
    [0.9, 1.0, 1.1, 1.2],  
]

collection.data.insert(
    properties={"text": "The cat sat on the mat.", "docid": "123"},
    vector={"multi_vector": colbert_embedding} 
)

client.close()

Database values

Has someone already worked with multi-vector embeddings ? If so, can you help me with this ?

hi @Meghna !!

Welcome to our community :hugs:

Can you check if the vectors were written? I was able to ingest the data with your code:

you can check it with:

collection.query.fetch_objects(include_vector=True).objects[0].vector

This may be a UI that doesn’t support the colbert multi vector.

Let me know if this helps!

Thanks!