Firestore in Datastore Mode is a NoSQL document database built for automatic scaling, high performance and ease of application development. Extend your database application to build AI-powered experiences leveraging Datastoreβs Langchain integrations.This notebook goes over how to use Firestore in Datastore Mode to save, load and delete langchain documents with
DatastoreLoader
and DatastoreSaver
.
Learn more about the package on GitHub.
langchain-google-datastore
package, so we need to install it.
gcloud config list
.gcloud projects list
.DatastoreSaver.upsert_documents(<documents>)
. By default it will try to extract the entity key from the key
in the Document metadata.
kind
is specified the documents will be stored with an auto generated id.
DatastoreLoader.load()
or DatastoreLoader.lazy_load()
. lazy_load
returns a generator that only queries database during the iteration. To initialize DatastoreLoader
class you need to provide:
source
- The source to load the documents. It can be an instance of Query or the name of the Datastore kind to read from.DatastoreSaver.delete_documents(<documents>)
.
page_content_properties
and metadata_properties
will specify the Entity properties to be written into LangChain Document page_content
and metadata
.
page_content
contains only one field the information will be the field value only. Otherwise the page_content
will be in JSON format.