Skip to main content
LangChain provides integrations with Google AI Studio and Google Cloud Vertex AI through the @langchain/google package.
Looking for the older @langchain/google-genai or @langchain/google-vertexai packages? They are maintained under long-term support but are no longer recommended for new projects.

Chat models

The ChatGoogle class is the recommended way to access Gemini models (such as gemini-2.5-pro, gemini-2.5-flash, and gemini-3-pro-preview) and open models like Gemma. It supports both Google AI Studio and Vertex AI in a single interface
npm install @langchain/google @langchain/core
Configure your API key:
export GOOGLE_API_KEY=your-api-key
import { ChatGoogle } from "@langchain/google";

const model = new ChatGoogle("gemini-2.5-flash");

const res = await model.invoke([
  ["human", "What would be a good company name for a company that makes colorful socks?"],
]);
ChatGoogle supports tool calling, structured output, multimodal inputs (images, audio, video), reasoning/thinking, image generation, text-to-speech, and Gemini-specific native tools like Google Search grounding and code execution.

Third-party models on Vertex AI

Anthropic Claude models are also available through the Vertex AI platform. See here for more information about enabling access to the models and the model names to use.

Vector stores

Vertex AI Vector Search, 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.
import { MatchingEngine } from "@langchain/community/vectorstores/googlevertexai";

Postgres vector store

The PostgresVectorStore module from the @langchain/google-cloud-sql-pg package provides a way to use CloudSQL for PostgreSQL to store vector embeddings.
npm install @langchain/google-cloud-sql-pg

Community tools

Google-related community tools are available in the @langchain/community package:

Legacy packages

The following packages are maintained under long-term support for existing users. New projects should use @langchain/google instead.

@langchain/google-genai

The @langchain/google-genai package provides ChatGoogleGenerativeAI for accessing Gemini models through Google AI Studio. This package is built on a deprecated Google SDK and will not receive new features.

@langchain/google-vertexai

The @langchain/google-vertexai package provides ChatVertexAI for accessing Gemini models through Vertex AI. This package is superseded by the Vertex AI support built into @langchain/google.

@langchain/google-common

The @langchain/google-common package contains shared abstractions used internally by the Google integration packages. It is not intended to be used directly.
To migrate from @langchain/google-genai or @langchain/google-vertexai to @langchain/google, see the ChatGoogle page for setup instructions. The ChatGoogle class provides equivalent functionality with unified access to both Google AI Studio and Vertex AI.

Connect these docs to Claude, VSCode, and more via MCP for real-time answers.