Registry / llm-agents / langchain-google-community

langchain-google-community

JSON →
library5.0.0pypypi✓ verified 25d ago

langchain-google-community is an integration package that connects LangChain with various miscellaneous Google products and services, such as BigQuery, Document AI, Firestore, and Google Cloud Storage. As of version 3.0.5, it provides components like chat message histories, document loaders, and vector stores for these services. The library follows a frequent release cadence, often aligning with updates in the broader LangChain ecosystem.

pip install langchain-google-community
INSTALL
IMPORT
SIG · LANGCHAIN-GOOGLE-C
L
langchain-google-community
llm-agentspythonv5.0.0
Install
18.7s avg
Import
Disk
326MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 308.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 18.7s · import 0.000s · 312MB
326MB installed
● package 326MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BigQueryChatMessageHistory
from langchain_google_community import BigQueryChatMessageHistory
from langchain_google_community import BigQueryChatMessageHistory

This quickstart demonstrates using `BigQueryChatMessageHistory` to store and retrieve chat messages in Google BigQuery. It requires Google Cloud project, dataset, and table names, and assumes appropriate GCP authentication and enabled BigQuery API.

import os from langchain_google_community.chat_message_histories import BigQueryChatMessageHistory from langchain_core.messages import HumanMessage, AIMessage # Ensure you have GOOGLE_CLOUD_PROJECT, BIGQUERY_DATASET_NAME, BIGQUERY_TABLE_NAME set as environment variables # or pass them directly to the constructor. project_id = os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-gcp-project-id') dataset_name = os.environ.get('BIGQUERY_DATASET_NAME', 'langchain_chat_history') table_name = os.environ.get('BIGQUERY_TABLE_NAME', 'chat_sessions') session_id = 'test_session_123' if not all([project_id, dataset_name, table_name]) or project_id == 'your-gcp-project-id': print("Warning: Skipping BigQuery history quickstart. Please set GOOGLE_CLOUD_PROJECT, BIGQUERY_DATASET_NAME, and BIGQUERY_TABLE_NAME environment variables.") print("Alternatively, replace 'your-gcp-project-id' with a valid project ID.") else: try: # Initialize BigQuery Chat Message History history = BigQueryChatMessageHistory( project_id=project_id, dataset_name=dataset_name, table_name=table_name, session_id=session_id ) # Add messages history.add_user_message("Hi there!") history.add_ai_message("Hello! How can I help you today?") history.add_message(HumanMessage(content="Tell me a joke.")) history.add_message(AIMessage(content="Why don't scientists trust atoms? Because they make up everything!")) # Retrieve messages messages = history.messages print(f"Retrieved {len(messages)} messages for session '{session_id}':") for msg in messages: print(f" {type(msg).__name__}: {msg.content}") # Clear messages (optional, for cleanup) # history.clear() # print("History cleared.") except Exception as e: print(f"Error running BigQuery history quickstart: {e}") print("Ensure you have authenticated with Google Cloud (e.g., `gcloud auth application-default login`) and BigQuery API is enabled in project: {project_id}.")
Debug
Known issues
breakingThis library has strict version constraints on `langchain` and `langchain-core` (currently `<0.3.0,>=0.2.0`). Upgrading your main `langchain` installation beyond these bounds will break functionality in `langchain-google-community`.
fix
Ensure your `langchain` and `langchain-core` versions are compatible. Check `pip show langchain-google-community` for exact dependency requirements. Upgrade `langchain-google-community` if a newer version supports your desired `langchain` version.
affects: All versions 3.x.x
gotchaGoogle Cloud authentication is required for all integrations. The library relies on Google Application Default Credentials (ADC). Common setup involves `gcloud auth application-default login` or setting the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
fix
Refer to Google Cloud's official documentation on 'Authenticating to Google Cloud' for setting up Application Default Credentials or service account key files.
affects: All versions
gotchaMany specific components are imported from submodules (e.g., `langchain_google_community.chat_message_histories`, `langchain_google_community.documentai`, `langchain_google_community.vectorstores`). Importing directly from `langchain_google_community` for these specific classes will result in an `ImportError`.
fix
Always check the official documentation or source code for the correct import path for each component. For example, `from langchain_google_community.chat_message_histories import BigQueryChatMessageHistory`.
affects: All versions
gotcha`langchain-google-community` does not include integrations for Google Generative AI models (Gemini) or Vertex AI (LLMs, embeddings, vector search). These are provided by separate packages: `langchain-google-genai` and `langchain-google-vertexai`, respectively.
fix
If you need Google GenAI or Vertex AI functionalities, install and use `langchain-google-genai` or `langchain-google-vertexai` instead or in addition to this package.
affects: All versions
breakingThe `langchain-google-community` package must be installed in your Python environment for any of its components to be importable. If the package is not installed, you will encounter `ModuleNotFoundError`.
fix
Run `pip install langchain-google-community` to ensure the library and its dependencies are available in your environment.
affects: All versions
Upgrade
Version history
5.0.0latest on PyPI · released Jun 18, 2026
Audit
Dependencies
langchain-corerequiredCore LangChain abstractions, specific version bounds are enforced.
langchainrequiredMain LangChain library, specific version bounds are enforced.
google-cloud-bigqueryrequiredRequired for BigQuery integrations (e.g., chat history, callbacks).
google-cloud-documentairequiredRequired for Document AI integrations.
google-cloud-firestorerequiredRequired for Firestore integrations (e.g., vector store).
google-cloud-storagerequiredRequired for Google Cloud Storage integrations.
Agent activity
50 hits · last 30 days
node
42
OpenAI (training)
1
Resources
langchain-google-community — pip install langchain-google-community · libregistry