Firestore is a serverless document-oriented database that scales to meet any demand. Extend your database application to build AI-powered experiences leveraging Firestoreβs Langchain integrations.This notebook goes over how to use Firestore to store vectors and query them using the
FirestoreVectorStore
class.
langchain-google-firestore
package, so we need to install it. For this notebook, we will also install langchain-google-genai
to use Google Generative AI embeddings.
gcloud config list
.gcloud projects list
.FirestoreVectorStore
allows you to store new vectors in a Firestore database. You can use it to store embeddings from any model, including those from Google Generative AI.
from_texts
and from_documents
method.
delete
method. Youβll need to provide the document ID of the vector you want to delete. This will remove the whole document from the database, including any other fields it may have.
add
method to update the vector of a document by providing the document ID and the new vector.
FirestoreVectorStore
to perform similarity searches on the vectors you have stored. This is useful for finding similar documents or text.
filters
parameter. This is useful for filtering by a specific field or value.