0
0
Agentic AIml~20 mins

Vector store selection (Pinecone, Chroma, FAISS) in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vector Store Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Choosing a vector store for large-scale real-time search

You want to build a system that handles millions of vectors and requires fast, real-time similarity search with automatic scaling. Which vector store is the best choice?

AChroma, because it is an open-source vector database designed for small datasets and local use only.
BPinecone, because it is a managed cloud service that automatically scales and supports real-time search at large scale.
CFAISS, because it is optimized for CPU and GPU and supports large datasets but requires manual scaling.
DAny of the three will perform equally well for large-scale real-time search without extra setup.
Attempts:
2 left
💡 Hint

Think about which option offers managed scaling and cloud support for millions of vectors.

Metrics
intermediate
2:00remaining
Evaluating vector store retrieval accuracy

You run a similarity search on a vector store and get a list of retrieved items. Which metric best measures how many relevant items are retrieved among the top results?

ARecall, because it measures the fraction of relevant items retrieved out of all relevant items.
BPrecision, because it measures the fraction of retrieved items that are relevant.
CMean Squared Error, because it measures the average squared difference between predicted and true vectors.
DAccuracy, because it measures the overall correct predictions over all queries.
Attempts:
2 left
💡 Hint

Recall focuses on how many relevant items you find, not how many you retrieved.

Predict Output
advanced
2:00remaining
Output of FAISS index search code snippet

What is the output of this Python code using FAISS for a simple vector search?

Agentic AI
import numpy as np
import faiss

# Create 5 vectors of dimension 3
vectors = np.array([[1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1]], dtype='float32')

# Build index
index = faiss.IndexFlatL2(3)
index.add(vectors)

# Query vector
query = np.array([[1,0,0]], dtype='float32')

# Search top 2 nearest neighbors
D, I = index.search(query, 2)
print(I[0].tolist())
A[0, 3]
B[0, 1]
C[1, 4]
D[3, 0]
Attempts:
2 left
💡 Hint

Remember FAISS returns nearest neighbors by distance. The query is [1,0,0].

Model Choice
advanced
2:00remaining
Selecting vector store for offline batch processing

You want to perform offline batch similarity searches on a dataset of 100,000 vectors without needing real-time responses. Which vector store is most suitable?

APinecone, because it is optimized for real-time cloud queries and automatic scaling.
BNone of these, you should use a relational database for vector search.
CFAISS, because it is optimized for fast batch processing on large datasets locally or on GPU.
DChroma, because it is designed for small datasets and local use only.
Attempts:
2 left
💡 Hint

Consider which tool is best for offline batch processing and large datasets without cloud dependency.

🔧 Debug
expert
2:00remaining
Identifying error in Pinecone vector insertion code

What error will this Pinecone vector insertion code raise?

Agentic AI
import pinecone
pinecone.init(api_key='fake_key', environment='us-west1-gcp')
index = pinecone.Index('example-index')
vectors = [(1, [0.1, 0.2, 0.3]), (2, [0.4, 0.5])]  # Note second vector has length 2
index.upsert(vectors)
ANo error; vectors will be inserted successfully.
BKeyError because the index name 'example-index' does not exist.
CTypeError because vectors must be a dictionary, not a list of tuples.
DValueError due to inconsistent vector dimensions in the upsert list.
Attempts:
2 left
💡 Hint

Check if all vectors have the same dimension length.