Skip to main content

preview pypi versions

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Google Cloud Bigtable API.

  4. Setup Authentication.

Installation

Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Supported Python Versions

Python >= 3.9

Mac/Linux

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install langchain-google-bigtable

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install langchain-google-bigtable

Vector Store Usage

Use BigtableVectorStore to store documents and their vector embeddings, allowing you to search for the most similar or relevant documents from your database.

  • Full VectorStore Implementation: Supports all methods from the LangChain VectorStore abstract class.

  • Async/Sync Support: All methods are available in both asynchronous and synchronous versions.

  • Metadata Filtering: Supports filtering on metadata fields, including logical AND/OR combinations and filtering on document IDs with a specific prefix.

  • Multiple Distance Strategies: Supports both Cosine and Euclidean distance for similarity search.

  • Customizable Storage: Full control over how content, embeddings, and metadata are stored in Bigtable columns.

from langchain_google_bigtable import BigtableVectorStore, BigtableEngine

# Your embedding service and other configurations
# embedding_service = ...

engine = await BigtableEngine.async_initialize(project_id="your-project-id")
vector_store = await BigtableVectorStore.create(
    engine=engine,
    instance_id="your-instance-id",
    table_id="your-table-id",
    embedding_service=embedding_service,
    collection="your_collection_name",
)

See the full Vector Store tutorial.

Key-value Store Usage

Use BigtableByteStore for a key-value store in LangChain

  • ByteStore Interface: Follows LangChain’s ByteStore for string keys and byte values.

  • Sync/Async: Supports both synchronous and asynchronous operations.

  • BigtableEngine: Manages execution context.

from langchain_google_bigtable import BigtableByteStore, BigtableEngine

engine = await BigtableEngine.async_initialize(project_id="your-project-id")
store = await BigtableByteStore.create(
    engine=engine,
    instance_id="your-instance-id",
    table_id="your-table-id",
)
await store.amset([("key", b"value")])
retrieved = await store.amget(["key"])

See the full Key-value Store tutorial.

Document Loader Usage

Use a document loader to load data as LangChain Documents.

from langchain_google_bigtable import BigtableLoader


loader = BigtableLoader(
    instance_id="my-instance",
    table_id="my-table-name"
)
docs = loader.lazy_load()

See the full Document Loader tutorial.

Chat Message History Usage

Use ChatMessageHistory to store messages and provide conversation history to LLMs.

from langchain_google_bigtable import BigtableChatMessageHistory


history = BigtableChatMessageHistory(
    instance_id="my-instance",
    table_id="my-message-store",
    session_id="my-session_id"
)

See the full Chat Message History tutorial.

Contributions

Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.

License

Apache 2.0 - See LICENSE for more information.

Disclaimer

This is not an officially supported Google product.

Release files for langchain-google-bigtable 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-google-bigtable 0.8.0
File Size Uploaded
langchain_google_bigtable-0.8.0.tar.gz 63.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-google-bigtable 0.8.0
File Interpreter ABI Platform
langchain_google_bigtable-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 108.8 kB

Release files / langchain_google_bigtable-0.8.0.tar.gz

Download URL langchain_google_bigtable-0.8.0.tar.gz
Size 63.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6b3d9543187fa95db587611591c900a75df5f156777876bff2d074ff695a076b
BLAKE2b-256 checksum
How to use checksums
d0217a31dc8b87cd2601aa68315419a634721c30c989a708613886be83912e46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / langchain_google_bigtable-0.8.0-py3-none-any.whl

Download URL langchain_google_bigtable-0.8.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb176cf130b8e5b94386fd4d1a9025f1dd0a24cae5b3f7a9d2a7c69cff34ef6f
BLAKE2b-256 checksum
How to use checksums
b5f4c44e31e3676731646fcab25dc7a274e909b8df5024d797544a7fce910d1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page