Bigtable is a key-value and wide-column store, ideal for fast access to structured, semi-structured, or unstructured data. Extend your database application to build AI-powered experiences leveraging Bigtableβs Langchain integrations.This notebook goes over how to use Bigtable to save, load and delete langchain documents with
BigtableLoader
and BigtableSaver
.
Learn more about the package on GitHub.
langchain-google-bigtable
package, so we need to install it.
gcloud config list
.gcloud projects list
.BigtableSaver.add_documents(<documents>)
. To initialize BigtableSaver
class you need to provide 2 things:
instance_id
- An instance of Bigtable.table_id
- The name of the table within the Bigtable to store langchain documents.BigtableLoader.load()
or BigtableLoader.lazy_load()
. lazy_load
returns a generator that only queries database during the iteration. To initialize BigtableLoader
class you need to provide:
instance_id
- An instance of Bigtable.table_id
- The name of the table within the Bigtable to store langchain documents.BigtableSaver.delete(<documents>)
.
langchain
, that has a column called content
, that contains values encoded in UTF-8. These defaults can be changed like so:
metadata
map on the Document
object will contain a single key, rowkey
, with the value of the rowβs rowkey value. To add more items to that map, use metadata_mapping.
metadata_as_json_encoding
is UTF-8.