← Master Index
Vol. 14 Module 14.2 Lecture

Weaviate

Vector Databases

How This Lesson Fits the Module & Volume

Weaviate is an open-source vector database that combines vectors with a class/property object model, optional vectorizer modules, and strong hybrid (BM25 + vector) search—aligning with Module 14.1’s hybrid search ideas.

After Milvus’s scale focus, Weaviate emphasizes schema, modules, and GraphQL/REST developer experience for AI apps.

Learning Objectives

By the end of this lesson, students should be able to:

  • Describe Weaviate collections (classes), properties, and vector indexes.
  • Ingest objects with vectors or built-in vectorizer modules.
  • Run near-vector and hybrid queries with property filters.
  • Compare self-hosted Weaviate vs Weaviate Cloud.
  • Explain when modular vectorizers help vs hurt control.
  • Position Weaviate among FAISS, Chroma, Pinecone, Milvus, and Qdrant.
Definition

Weaviate is an open-source vector database that stores data objects with properties and vectors, supports semantic and hybrid search, and can attach modules (e.g., embedding providers) so objects are vectorized on insert or query.

Object Model + Vectors

ConceptRole in RAG
Collection / classType of document chunk or entity
PropertiesText + metadata filters (source, tags)
VectorBring-your-own or module-generated
Hybrid searchBM25 + vector fusion in one query
ModulesOptional embedding / generative helpers

Client Sketch: Insert and Hybrid Query

import weaviate from weaviate.classes.config import Configure, Property, DataType from weaviate.classes.query import Filter, HybridFusion client = weaviate.connect_to_local() # Example: bring-your-own vectors (no auto-vectorizer) if not client.collections.exists("Chunk"): client.collections.create( name="Chunk", properties=[ Property(name="text", data_type=DataType.TEXT), Property(name="source", data_type=DataType.TEXT), Property(name="tenant", data_type=DataType.TEXT), ], vectorizer_config=Configure.Vectorizer.none(), ) chunks = client.collections.get("Chunk") chunks.data.insert( properties={"text": "PTO accrues monthly.", "source": "hr.md", "tenant": "acme"}, vector=embedding_list, ) result = chunks.query.hybrid( query="vacation policy", vector=query_embedding, alpha=0.5, fusion_type=HybridFusion.RELATIVE_SCORE, filters=Filter.by_property("tenant").equal("acme"), limit=5, ) for obj in result.objects: print(obj.properties["text"], obj.metadata.score) client.close()

Modules: Convenience vs Control

Module vectorizers

  • Faster prototypes
  • Provider keys in Weaviate
  • Less app-side code

BYO vectors

  • Full model control
  • Easier offline/air-gap
  • Consistent with FAISS pipelines

Hybrid

  • Keyword + semantic
  • Tune alpha / fusion
  • Matches 14.1 lessons

Strengths

  • Hybrid search first-class
  • Rich object/property model
  • Modules accelerate demos
  • OSS + cloud options

Tradeoffs

  • Schema design overhead
  • Module coupling to vendors
  • Ops for self-host clusters
  • API surface to learn
Common Misconception

“Hybrid alpha = 0.5 is always optimal.” Keyword-heavy SKU queries and paraphrase questions need different blends. Tune with labeled queries like any other IR hyperparameter.

Knowledge Check

  1. Short Answer: What two signals does Weaviate hybrid search combine? Answer: BM25/lexical and vector/semantic.
  2. True/False: Weaviate can store properties (metadata) with objects. Answer: True.
  3. Multiple Choice: BYO vectors means: (a) Weaviate trains GPT, (b) you supply embeddings, (c) no vectors allowed. Answer: (b).
  4. Short Answer: Why use filters on tenant properties? Answer: Multi-tenant isolation / ACL-style scoping.
  5. True/False: Vectorizer modules are mandatory. Answer: False.
  6. Multiple Choice: Alpha in hybrid search typically balances: (a) CPU vs GPU, (b) keyword vs vector weight, (c) batch size. Answer: (b).
  7. Short Answer: Name one benefit of Weaviate vs raw FAISS. Answer: Object schema, hybrid search, filters, modules (any).
  8. Short Answer: Name a deployment option. Answer: Self-hosted or Weaviate Cloud.
  9. Multiple Choice: Module vectorizers trade convenience for: (a) zero cost always, (b) less control / provider coupling, (c) larger kernels. Answer: (b).
  10. True/False: Hybrid search aligns with Module 14.1 hybrid retrieval ideas. Answer: True.

Key Takeaways

  • Weaviate models RAG data as objects with properties and vectors.
  • Hybrid BM25 + vector search is a core differentiator.
  • Choose modules for speed or BYO embeddings for control.
  • Tune fusion weights with real query slices.
  • Next: Qdrant—Rust-powered vector DB with strong filtering and payloads.
Trainer’s Guide

Lab: Insert the same corpus; compare pure vector vs hybrid at alpha 0.25 / 0.5 / 0.75 on keyword vs paraphrase queries.

Debate: Module vectorizer vs app-side Sentence-Transformers for regulated data.

Recap: Weaviate pairs object search with hybrid retrieval. Continue with Qdrant.