Database / Weaviate Vector database Interview questions
What is a Collection in Weaviate?
A Collection is Weaviate's schema-defined container for a set of objects sharing the same structure: a name, a list of properties (fields and their types), the vectorizer module (if any) used to generate embeddings, and vector index configuration. It's the direct equivalent of what earlier Weaviate versions called a "Class."
import weaviate from weaviate.classes.config import Configure, Property, DataType client = weaviate.connect_to_local() client.collections.create( name="Question", properties=[ Property(name="question", data_type=DataType.TEXT), Property(name="answer", data_type=DataType.TEXT), Property(name="category", data_type=DataType.TEXT), ], vector_config=Configure.Vectors.text2vec_openai(), )
Every collection has its own independent vector space, so two different collections can hold conceptually similar data but embed it differently, and every object across every collection gets a UUID that's guaranteed unique cluster-wide, which is what makes cross-references between objects in different collections possible.
More Related questions...