{"id":1528,"library":"langchain-google-community","title":"LangChain Google Community","description":"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.","status":"active","version":"3.0.5","language":"en","source_language":"en","source_url":"https://github.com/langchain-ai/langchain-google/tree/master/libs/community","tags":["Google Cloud","LangChain","Integrations","BigQuery","Document AI","Firestore","GCS","Data Store"],"install":[{"cmd":"pip install langchain-google-community","lang":"bash","label":"Install core package"}],"dependencies":[{"reason":"Core LangChain abstractions, specific version bounds are enforced.","package":"langchain-core","optional":false},{"reason":"Main LangChain library, specific version bounds are enforced.","package":"langchain","optional":false},{"reason":"Required for BigQuery integrations (e.g., chat history, callbacks).","package":"google-cloud-bigquery","optional":false},{"reason":"Required for Document AI integrations.","package":"google-cloud-documentai","optional":false},{"reason":"Required for Firestore integrations (e.g., vector store).","package":"google-cloud-firestore","optional":false},{"reason":"Required for Google Cloud Storage integrations.","package":"google-cloud-storage","optional":false}],"imports":[{"note":"Many specific integrations are nested within submodules like `chat_message_histories`, `documentai`, or `vectorstores`.","wrong":"from langchain_google_community import BigQueryChatMessageHistory","symbol":"BigQueryChatMessageHistory","correct":"from langchain_google_community.chat_message_histories import BigQueryChatMessageHistory"},{"symbol":"DocumentAIWrapper","correct":"from langchain_google_community.documentai import DocumentAIWrapper"},{"symbol":"FirestoreVectorStore","correct":"from langchain_google_community.vectorstores import FirestoreVectorStore"},{"symbol":"BigQueryCallbackHandler","correct":"from langchain_google_community.bigquery import BigQueryCallbackHandler"}],"quickstart":{"code":"import os\nfrom langchain_google_community.chat_message_histories import BigQueryChatMessageHistory\nfrom langchain_core.messages import HumanMessage, AIMessage\n\n# Ensure you have GOOGLE_CLOUD_PROJECT, BIGQUERY_DATASET_NAME, BIGQUERY_TABLE_NAME set as environment variables\n# or pass them directly to the constructor.\nproject_id = os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-gcp-project-id')\ndataset_name = os.environ.get('BIGQUERY_DATASET_NAME', 'langchain_chat_history')\ntable_name = os.environ.get('BIGQUERY_TABLE_NAME', 'chat_sessions')\nsession_id = 'test_session_123'\n\nif not all([project_id, dataset_name, table_name]) or project_id == 'your-gcp-project-id':\n    print(\"Warning: Skipping BigQuery history quickstart. Please set GOOGLE_CLOUD_PROJECT, BIGQUERY_DATASET_NAME, and BIGQUERY_TABLE_NAME environment variables.\")\n    print(\"Alternatively, replace 'your-gcp-project-id' with a valid project ID.\")\nelse:\n    try:\n        # Initialize BigQuery Chat Message History\n        history = BigQueryChatMessageHistory(\n            project_id=project_id,\n            dataset_name=dataset_name,\n            table_name=table_name,\n            session_id=session_id\n        )\n\n        # Add messages\n        history.add_user_message(\"Hi there!\")\n        history.add_ai_message(\"Hello! How can I help you today?\")\n        history.add_message(HumanMessage(content=\"Tell me a joke.\"))\n        history.add_message(AIMessage(content=\"Why don't scientists trust atoms? Because they make up everything!\"))\n\n        # Retrieve messages\n        messages = history.messages\n        print(f\"Retrieved {len(messages)} messages for session '{session_id}':\")\n        for msg in messages:\n            print(f\"  {type(msg).__name__}: {msg.content}\")\n\n        # Clear messages (optional, for cleanup)\n        # history.clear()\n        # print(\"History cleared.\")\n    except Exception as e:\n        print(f\"Error running BigQuery history quickstart: {e}\")\n        print(\"Ensure you have authenticated with Google Cloud (e.g., `gcloud auth application-default login`) and BigQuery API is enabled in project: {project_id}.\")\n","lang":"python","description":"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."},"warnings":[{"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.","message":"This 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`.","severity":"breaking","affected_versions":"All versions 3.x.x"},{"fix":"Refer to Google Cloud's official documentation on 'Authenticating to Google Cloud' for setting up Application Default Credentials or service account key files.","message":"Google 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.","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"Many 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`.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"`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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}