Skip to main content


All functionality related to Google Platform


Vertex AI

Access PaLM LLMs like text-bison and code-bison via Google Cloud.

from langchain.llms import VertexAI

API Reference:

Model Garden

Access PaLM and hundreds of OSS models via Vertex AI Model Garden.

from langchain.llms import VertexAIModelGarden

API Reference:

Chat models

Vertex AI

Access PaLM chat models like chat-bison and codechat-bison via Google Cloud.

from langchain.chat_models import ChatVertexAI

API Reference:

Document Loader

Google BigQuery

Google BigQuery is a serverless and cost-effective enterprise data warehouse that works across clouds and scales with your data. BigQuery is a part of the Google Cloud Platform.

First, you need to install google-cloud-bigquery python package.

pip install google-cloud-bigquery

See a usage example.

from langchain.document_loaders import BigQueryLoader

API Reference:

Google Cloud Storage

Google Cloud Storage is a managed service for storing unstructured data.

First, you need to install google-cloud-storage python package.

pip install google-cloud-storage

There are two loaders for the Google Cloud Storage: the Directory and the File loaders.

See a usage example.

from langchain.document_loaders import GCSDirectoryLoader

API Reference:

See a usage example.

from langchain.document_loaders import GCSFileLoader

API Reference:

Google Drive

Google Drive is a file storage and synchronization service developed by Google.

Currently, only Google Docs are supported.

First, you need to install several python package.

pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib

See a usage example and authorizing instructions.

from langchain.document_loaders import GoogleDriveLoader

API Reference:

Vector Store

Google Vertex AI MatchingEngine

Google Vertex AI Matching Engine provides the industry's leading high-scale low latency vector database. These vector databases are commonly referred to as vector similarity-matching or an approximate nearest neighbor (ANN) service.

We need to install several python packages.

pip install tensorflow google-cloud-aiplatform tensorflow-hub tensorflow-text

See a usage example.

from langchain.vectorstores import MatchingEngine

API Reference:


  • Install requirements with pip install google-api-python-client
  • Set up a Custom Search Engine, following these instructions
  • Get an API Key and Custom Search Engine ID from the previous step, and set them as environment variables GOOGLE_API_KEY and GOOGLE_CSE_ID respectively

There exists a GoogleSearchAPIWrapper utility which wraps this API. To import this utility:

from langchain.utilities import GoogleSearchAPIWrapper

For a more detailed walkthrough of this wrapper, see this notebook.

You can easily load this wrapper as a Tool (to use with an Agent). You can do this with:

from langchain.agents import load_tools
tools = load_tools(["google-search"])

API Reference: