Vector Databases Exercises
Fill in the blanks to test your knowledge.
Name the search method used in vector databases
// Finds vectors most similar to a query
// Called search
Complete the ChromaDB client creation
Create or retrieve a ChromaDB collection
collection = client.get_or_create_collection(name=)
Name the PostgreSQL extension for vector storage
-- Enable vector support in PostgreSQL
CREATE EXTENSION IF NOT EXISTS ;
Use pgvector cosine distance operator in SQL
SELECT content
FROM documents
ORDER BY embedding $1::vector
LIMIT 5;
Name the popular ANN algorithm used by pgvector and Qdrant
-- Creates a graph-based ANN index
CREATE INDEX USING (embedding vector_cosine_ops);
Name the parameter that limits results in vector search
results = index.query(vector=query_vec, =10)
Identify what ANN stands for
// Trades perfect accuracy for speed in large datasets
// ANN = Nearest Neighbor