Skip to main content
All functionality related to Google Cloud, Google Gemini and other Google products.
  1. Google Generative AI (Gemini API & AI Studio): Access Google Gemini models directly via the Gemini API. Use Google AI Studio for rapid prototyping and get started quickly with the langchain-google-genai package. This is often the best starting point for individual developers.
  2. Google Cloud (Vertex AI & other services): Access Gemini models, Vertex AI Model Garden and a wide range of cloud services (databases, storage, document AI, etc.) via the Google Cloud Platform. Use the langchain-google-vertexai package for Vertex AI models and specific packages (e.g., langchain-google-cloud-sql-pg, langchain-google-community) for other cloud services. This is ideal for developers already using Google Cloud or needing enterprise features like MLOps, specific model tuning or enterprise support.
See Google’s guide on migrating from the Gemini API to Vertex AI for more details on the differences. Integration packages for Gemini models and the Vertex AI platform are maintained in the langchain-google repository. You can find a host of LangChain integrations with other Google APIs and services in the googleapis Github organization and the langchain-google-community package.

Google Generative AI (Gemini API & AI Studio)

Access Google Gemini models directly using the Gemini API, best suited for rapid development and experimentation. Gemini models are available in Google AI Studio.
Start for free and get your API key from Google AI Studio.

Chat Models

Use the ChatGoogleGenerativeAI class to interact with Gemini models. See details in this guide.
The image_url can be a public URL, a GCS URI (gs://...), a local file path, a base64 encoded image string (data:image/png;base64,...), or a PIL Image object.

Embedding Models

Generate text embeddings using models like gemini-embedding-001 with the GoogleGenerativeAIEmbeddings class. See a usage example.

LLMs

Access the same Gemini models using the (legacy) LLM interface with the GoogleGenerativeAI class. See a usage example.

Google Cloud

Access Gemini models, Vertex AI Model Garden and other Google Cloud services via Vertex AI and specific cloud integrations. Vertex AI models require the langchain-google-vertexai package. Other services might require additional packages like langchain-google-community, langchain-google-cloud-sql-pg, etc.
Google Cloud integrations typically use Application Default Credentials (ADC). Refer to the Google Cloud authentication documentation for setup instructions (e.g., using gcloud auth application-default login).

Chat Models

Vertex AI

Access chat models like Gemini via the Vertex AI platform. See a usage example.

Anthropic on Vertex AI Model Garden

See a usage example.

Llama on Vertex AI Model Garden

Mistral on Vertex AI Model Garden

Gemma local from Hugging Face

Local Gemma model loaded from HuggingFace. Requires langchain-google-vertexai.

Gemma local from Kaggle

Local Gemma model loaded from Kaggle. Requires langchain-google-vertexai.

Gemma on Vertex AI Model Garden

Requires langchain-google-vertexai.

Vertex AI image captioning

Implementation of the Image Captioning model as a chat. Requires langchain-google-vertexai.

Vertex AI image editor

Given an image and a prompt, edit the image. Currently only supports mask-free editing. Requires langchain-google-vertexai.

Vertex AI image generator

Generates an image from a prompt. Requires langchain-google-vertexai.

Vertex AI visual QnA

Chat implementation of a visual QnA model. Requires langchain-google-vertexai.

LLMs

You can also use the (legacy) string-in, string-out LLM interface.

Vertex AI Model Garden

Access Gemini, and hundreds of OSS models via Vertex AI Model Garden service. Requires langchain-google-vertexai. See a usage example.

Gemma local from Hugging Face

Local Gemma model loaded from HuggingFace. Requires langchain-google-vertexai.

Gemma local from Kaggle

Local Gemma model loaded from Kaggle. Requires langchain-google-vertexai.

Gemma on Vertex AI Model Garden

Requires langchain-google-vertexai.

Vertex AI image captioning

Implementation of the Image Captioning model as an LLM. Requires langchain-google-vertexai.

Embedding Models

Vertex AI

Generate embeddings using models deployed on Vertex AI. Requires langchain-google-vertexai. See a usage example.

Document Loaders

Load documents from various Google Cloud sources.

AlloyDB for PostgreSQL

Google Cloud AlloyDB is a fully managed PostgreSQL-compatible database service.
Install the python package:
See usage example.

BigQuery

Google Cloud BigQuery is a serverless data warehouse.
Install with BigQuery dependencies:
See a usage example.

Bigtable

Google Cloud Bigtable is a fully managed NoSQL Big Data database service.
Install the python package:
See usage example.

Cloud SQL for MySQL

Google Cloud SQL for MySQL is a fully-managed MySQL database service.
Install the python package:
See usage example.

Cloud SQL for SQL Server

Google Cloud SQL for SQL Server is a fully-managed SQL Server database service.
Install the python package:
See usage example.

Cloud SQL for PostgreSQL

Google Cloud SQL for PostgreSQL is a fully-managed PostgreSQL database service.
Install the python package:
See usage example.

Cloud Storage

Cloud Storage is a managed service for storing unstructured data.
Install with GCS dependencies:
Load from a directory or a specific file: See directory usage example.
See file usage example.

Cloud Vision loader

Load data using Google Cloud Vision API. Install with Vision dependencies:

El Carro for Oracle Workloads

Google El Carro Oracle Operator runs Oracle databases in Kubernetes.
Install the python package:
See usage example.

Firestore (Native Mode)

Google Cloud Firestore is a NoSQL document database.
Install the python package:
See usage example.

Firestore (Datastore Mode)

Google Cloud Firestore in Datastore mode.
Install the python package:
See usage example.

Memorystore for Redis

Google Cloud Memorystore for Redis is a fully managed Redis service.
Install the python package:
See usage example.

Spanner

Google Cloud Spanner is a fully managed, globally distributed relational database service.
Install the python package:
See usage example.

Speech-to-Text

Google Cloud Speech-to-Text transcribes audio files.
Install with Speech-to-Text dependencies:
See usage example and authorization instructions.

Document Transformers

Transform documents using Google Cloud services.

Document AI

Google Cloud Document AI is a Google Cloud service that transforms unstructured data from documents into structured data, making it easier to understand, analyze, and consume.
We need to set up a GCS bucket and create your own OCR processor The GCS_OUTPUT_PATH should be a path to a folder on GCS (starting with gs://) and a processor name should look like projects/PROJECT_NUMBER/locations/LOCATION/processors/PROCESSOR_ID. We can get it either programmatically or copy from the Prediction endpoint section of the Processor details tab in the Google Cloud Console.
See a usage example.

Google Translate

Google Translate is a multilingual neural machine translation service developed by Google to translate text, documents and websites from one language into another.
The GoogleTranslateTransformer allows you to translate text and HTML with the Google Cloud Translation API. First, we need to install the langchain-google-community with translate dependencies.
See usage example and authorization instructions.

Vector Stores

Store and search vectors using Google Cloud databases and Vertex AI Vector Search.

AlloyDB for PostgreSQL

Google Cloud AlloyDB is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL.
Install the python package:
See usage example.
Google Cloud BigQuery, BigQuery is a serverless and cost-effective enterprise data warehouse in Google Cloud. Google Cloud BigQuery Vector Search BigQuery vector search lets you use GoogleSQL to do semantic search, using vector indexes for fast but approximate results, or using brute force for exact results.
It can calculate Euclidean or Cosine distance. With LangChain, we default to use Euclidean distance.
We need to install several python packages.
See usage example.

Memorystore for Redis

Vector store using Memorystore for Redis.
Install the python package:
See usage example.

Spanner

Vector store using Cloud Spanner.
Install the python package:
See usage example.

Firestore (Native Mode)

Vector store using Firestore.
Install the python package:
See usage example.

Cloud SQL for MySQL

Vector store using Cloud SQL for MySQL.
Install the python package:
See usage example.

Cloud SQL for PostgreSQL

Vector store using Cloud SQL for PostgreSQL.
Install the python package:
See usage example.
Google Cloud Vertex AI Vector Search from Google Cloud, formerly known as 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.
Install the python package:
See a usage example.
With DataStore Backend
Vector search using Datastore for document storage.
See usage example.
With GCS Backend
Alias for VectorSearchVectorStore storing documents/index in GCS.

Retrievers

Retrieve information using Google Cloud services.
Build generative AI powered search engines using Vertex AI Search. from Google Cloud allows developers to quickly build generative AI powered search engines for customers and employees.
See a usage example. Note: GoogleVertexAISearchRetriever is deprecated. Use the components below from langchain-google-community. Install the google-cloud-discoveryengine package for underlying access.
VertexAIMultiTurnSearchRetriever
VertexAISearchRetriever
VertexAISearchSummaryTool

Document AI Warehouse

Search, store, and manage documents using Document AI Warehouse.
Note: GoogleDocumentAIWarehouseRetriever (from langchain) is deprecated. Use DocumentAIWarehouseRetriever from langchain-google-community. Requires installation of relevant Document AI packages (check specific docs).

Tools

Integrate agents with various Google services.

Text-to-Speech

Google Cloud Text-to-Speech is a Google Cloud service that enables developers to synthesize natural-sounding speech with 100+ voices, available in multiple languages and variants. It applies DeepMind’s groundbreaking research in WaveNet and Google’s powerful neural networks to deliver the highest fidelity possible.
Install required packages:
See usage example and authorization instructions.

Google Drive

Tools for interacting with Google Drive. Install required packages:
See usage example and authorization instructions.

Google Finance

Query financial data. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Jobs

Query job listings. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Lens

Perform visual searches. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Places

Search for places information. Requires googlemaps package and a Google Maps API key.
See usage example and authorization instructions.

Google Scholar

Search academic papers. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.
Perform web searches using Google Custom Search Engine (CSE). Requires GOOGLE_API_KEY and GOOGLE_CSE_ID. Install langchain-google-community:
Wrapper:
Tools:
Agent Loading:
See detailed notebook. Query Google Trends data. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Toolkits

Collections of tools for specific Google services.

Gmail

Google Gmail is a free email service provided by Google. This toolkit works with emails through the Gmail API.
See usage example and authorization instructions.

MCP Toolbox

MCP Toolbox provides a simple and efficient way to connect to your databases, including those on Google Cloud like Cloud SQL and AlloyDB. With MCP Toolbox, you can seamlessly integrate your database with LangChain to build powerful, data-driven applications.

Installation

To get started, install the Toolbox server and client. Configure a tools.yaml to define your tools, and then execute toolbox to start the server:
Then, install the Toolbox client:

Getting Started

Here is a quick example of how to use MCP Toolbox to connect to your database:
See usage example and setup instructions.

Memory

Store conversation history using Google Cloud databases.

AlloyDB for PostgreSQL

Chat memory using AlloyDB.
Install the python package:
See usage example.

Cloud SQL for PostgreSQL

Chat memory using Cloud SQL for PostgreSQL.
Install the python package:
See usage example.

Cloud SQL for MySQL

Chat memory using Cloud SQL for MySQL.
Install the python package:
See usage example.

Cloud SQL for SQL Server

Chat memory using Cloud SQL for SQL Server.
Install the python package:
See usage example.

Spanner

Chat memory using Cloud Spanner.
Install the python package:
See usage example.

Memorystore for Redis

Chat memory using Memorystore for Redis.
Install the python package:
See usage example.

Bigtable

Chat memory using Cloud Bigtable.
Install the python package:
See usage example.

Firestore (Native Mode)

Chat memory using Firestore.
Install the python package:
See usage example.

Firestore (Datastore Mode)

Chat memory using Firestore in Datastore mode.
Install the python package:
See usage example.

El Carro: The Oracle Operator for Kubernetes

Chat memory using Oracle databases run via El Carro.
Install the python package:
See usage example.

Callbacks

Track LLM/Chat model usage.

Vertex AI callback handler

Callback Handler that tracks VertexAI usage info.
Requires langchain-google-vertexai.

Evaluators

Evaluate model outputs using Vertex AI. Requires langchain-google-vertexai.

VertexPairWiseStringEvaluator

Pair-wise evaluation using Vertex AI models.

VertexStringEvaluator

Evaluate a single prediction string using Vertex AI models.

Other Google Products

Integrations with various Google services beyond the core Cloud Platform.

Document Loaders

Google Drive

Google Drive file storage. Currently supports Google Docs.
Install with Drive dependencies:
See usage example and authorization instructions.

Vector Stores

ScaNN (Local Index)

Google ScaNN (Scalable Nearest Neighbors) is a python package. ScaNN is a method for efficient vector similarity search at scale.
ScaNN includes search space pruning and quantization for Maximum Inner Product Search and also supports other distance functions such as Euclidean distance. The implementation is optimized for x86 processors with AVX2 support. See its Google Research github for more details.
Install the scann package:
See a usage example.

Retrievers

Google Drive

Retrieve documents from Google Drive. Install required packages:
See usage example and authorization instructions.

Tools

Google Drive

Tools for interacting with Google Drive. Install required packages:
See usage example and authorization instructions.

Google Finance

Query financial data. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Jobs

Query job listings. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Lens

Perform visual searches. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Places

Search for places information. Requires googlemaps package and a Google Maps API key.
See usage example and authorization instructions.

Google Scholar

Search academic papers. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Google Search

Perform web searches using Google Custom Search Engine (CSE). Requires GOOGLE_API_KEY and GOOGLE_CSE_ID. Install langchain-google-community:
Wrapper:
Tools:
Agent Loading:
See detailed notebook. Query Google Trends data. Requires google-search-results package and SerpApi key.
See usage example and authorization instructions.

Toolkits

Gmail

Google Gmail is a free email service provided by Google. This toolkit works with emails through the Gmail API.
See usage example and authorization instructions.

Chat Loaders

Gmail

Load chat history from Gmail threads.
Install with Gmail dependencies:
See usage example and authorization instructions.

3rd Party Integrations

Access Google services via third-party APIs.

SearchApi

SearchApi provides API access to Google search, YouTube, etc. Requires langchain-community.
See usage examples and authorization instructions.

SerpApi

SerpApi provides API access to Google search results. Requires langchain-community.
See a usage example and authorization instructions.

Serper.dev

Google Serper provides API access to Google search results. Requires langchain-community.
See a usage example and authorization instructions.

YouTube

YouTube Search Tool

Search YouTube videos without the official API. Requires youtube_search package.
See a usage example.

YouTube Audio Loader

Download audio from YouTube videos. Requires yt_dlp, pydub, librosa.
See usage example and authorization instructions.

YouTube Transcripts Loader

Load video transcripts. Requires youtube-transcript-api.
See a usage example.