Registry /
llm-agents / langchain-google-community
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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 308.9MB
glibcpy 3.10–3.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`.fixEnsure 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.fixRefer 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`.fixAlways 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.fixIf 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`.fixRun `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.