0
0
Agentic AIml~10 mins

Vector store selection (Pinecone, Chroma, FAISS) in Agentic AI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize a FAISS vector store.

Agentic AI
from langchain.vectorstores import FAISS
vector_store = FAISS.from_texts(texts, embeddings, index_factory=[1])
Drag options to blanks, or click blank then click option'
A"Pinecone"
B"Flat"
C"Chroma"
D"Annoy"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Pinecone' or 'Chroma' as FAISS index factory names.
Leaving the index_factory parameter empty.
2fill in blank
medium

Complete the code to create a Chroma vector store with a persist directory.

Agentic AI
from langchain.vectorstores import Chroma
vector_store = Chroma.from_texts(texts, embeddings, persist_directory=[1])
Drag options to blanks, or click blank then click option'
A"./chroma_db"
BNone
C"/tmp/faiss"
D"pinecone_index"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing None or invalid paths to persist_directory.
Using paths meant for other vector stores like FAISS or Pinecone.
3fill in blank
hard

Fix the error in the Pinecone initialization code by completing the missing parameter.

Agentic AI
import pinecone
pinecone.init(api_key=[1], environment="us-west1-gcp")
Drag options to blanks, or click blank then click option'
A12345
BNone
C"your-pinecone-api-key"
D"chroma"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing None or numeric values as api_key.
Confusing environment names with API keys.
4fill in blank
hard

Fill both blanks to create a FAISS vector store and save it to disk.

Agentic AI
from langchain.vectorstores import FAISS
vector_store = FAISS.from_texts(texts, embeddings, index_factory=[1])
vector_store.[2]("faiss_index")
Drag options to blanks, or click blank then click option'
A"Flat"
Bsave_local
Csave_local_index
Dsave
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names like 'save' or 'save_local_index'.
Using wrong index factory names.
5fill in blank
hard

Fill all three blanks to create a Pinecone vector store client with index name and namespace.

Agentic AI
import pinecone
pinecone.init(api_key=[1], environment=[2])
index = pinecone.Index(name=[3])
Drag options to blanks, or click blank then click option'
A"your-pinecone-api-key"
B"us-west1-gcp"
C"my-index"
D"chroma"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up environment and index name strings.
Using invalid API key formats.