Skip to content

Commit 96b06bf

Browse files
committed
feat: add Bigtable documentation
1 parent 1a41ad1 commit 96b06bf

File tree

7 files changed

+810
-0
lines changed

7 files changed

+810
-0
lines changed

reference/packages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,3 +784,7 @@ packages:
784784
provider_page: oracleai
785785
downloads: 700
786786
downloads_updated_at: "2025-11-25T00:06:22.543193+00:00"
787+
- name: langchain-google-bigtable
788+
name_title: Bigtable
789+
repo: googleapis/langchain-google-bigtable-python
790+
provider_page: google
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Bigtable
2+
3+
Bigtable is a scalable, fully managed key-value and wide-column store ideal for fast access to structured, semi-structured, or unstructured data. This page provides an overview of Bigtable's LangChain integrations.
4+
5+
**Client Library Documentation:** [cloud.google.com/python/docs/reference/langchain-google-bigtable/latest](https://cloud.google.com/python/docs/reference/langchain-google-bigtable/latest)
6+
7+
**Product Documentation:** [cloud.google.com/bigtable](https://cloud.google.com/bigtable)
8+
9+
## Quick Start
10+
11+
To use this library, you first need to:
12+
13+
1. Select or create a Cloud Platform project.
14+
2. Enable billing for your project.
15+
3. Enable the Google Cloud Bigtable API.
16+
4. Set up Authentication.
17+
18+
## Installation
19+
20+
The main package for this integration is `langchain-google-bigtable`.
21+
22+
```bash
23+
pip install -U langchain-google-bigtable
24+
```
25+
26+
## Integrations
27+
28+
The `langchain-google-bigtable` package provides the following integrations:
29+
30+
### Document Loader
31+
32+
Use the `BigtableLoader` to load data from a Bigtable table and represent it as LangChain `Document` objects.
33+
34+
```python
35+
from langchain_google_bigtable import BigtableLoader
36+
37+
loader = BigtableLoader(
38+
project_id="your-project-id",
39+
instance_id="your-instance-id",
40+
table_id="your-table-name"
41+
)
42+
docs = loader.load()
43+
```
44+
45+
Learn more in the [Document Loader how-to guide](https://cloud.google.com/python/docs/reference/langchain-google-bigtable/latest/document-loader).
46+
47+
### Chat Message History
48+
49+
Use `BigtableChatMessageHistory` to store conversation histories, enabling stateful chains and agents.
50+
51+
```python
52+
from langchain_google_bigtable import BigtableChatMessageHistory
53+
54+
history = BigtableChatMessageHistory(
55+
project_id="your-project-id",
56+
instance_id="your-instance-id",
57+
table_id="your-message-store",
58+
session_id="user-session-123"
59+
)
60+
61+
history.add_user_message("Hello!")
62+
history.add_ai_message("Hi there!")
63+
```
64+
65+
Learn more in the [Chat Message History how-to guide](https://cloud.google.com/python/docs/reference/langchain-google-bigtable/latest/chat-message-history).
66+
67+
### Vector Store
68+
69+
With `BigtableVectorStore`, you can store documents and their vector embeddings to find the most similar or relevant information in your database.
70+
71+
* **Full `VectorStore` Implementation:** Supports all methods from the LangChain `VectorStore` abstract class.
72+
* **Async/Sync Support:** All methods are available in both asynchronous and synchronous versions.
73+
* **Metadata Filtering:** Powerful filtering on metadata fields, including logical AND/OR combinations.
74+
* **Multiple Distance Strategies:** Supports both Cosine and Euclidean distance for similarity search.
75+
* **Customizable Storage:** Full control over how content, embeddings, and metadata are stored in Bigtable columns.
76+
77+
```python
78+
from langchain_google_bigtable import BigtableVectorStore
79+
80+
# Your embedding service and other configurations
81+
# embedding_service = ...
82+
83+
engine = await BigtableEngine.async_initialize(project_id="your-project-id")
84+
vector_store = await BigtableVectorStore.create(
85+
engine=engine,
86+
instance_id="your-instance-id",
87+
table_id="your-table-id",
88+
embedding_service=embedding_service,
89+
collection="your_collection_name",
90+
)
91+
await vector_store.aadd_documents([your_documents])
92+
results = await vector_store.asimilarity_search("your query")
93+
```
94+
95+
Learn more in the [Vector Store how-to guide](https://colab.research.google.com/github/googleapis/langchain-google-bigtable-python/blob/main/docs/vector_store.ipynb).
96+
97+
### Key-value Store
98+
99+
Use `BigtableByteStore` as a persistent, scalable key-value store for caching, session management, or other storage needs. It supports both synchronous and asynchronous operations.
100+
101+
```python
102+
from langchain_google_bigtable import BigtableByteStore
103+
104+
# Initialize the store
105+
store = await BigtableByteStore.create(
106+
project_id="your-project-id",
107+
instance_id="your-instance-id",
108+
table_id="your-table-id",
109+
)
110+
111+
# Set and get values
112+
await store.amset([("key1", b"value1")])
113+
retrieved = await store.amget(["key1"])
114+
```
115+
116+
Learn more in the [Key-value Store how-to guide](https://cloud.google.com/python/docs/reference/langchain-google-bigtable/latest/key-value-store).
117+
118+
## Contributions
119+
120+
Contributions to this library are welcome. Please see the CONTRIBUTING guide in the [package repo](https://github.com/googleapis/langchain-google-bigtable-python/) for more details
121+
122+
## License
123+
124+
This project is licensed under the Apache 2.0 License - see the LICENSE file in the [package repo](https://github.com/googleapis/langchain-google-bigtable-python/blob/main/LICENSE) for details.
125+
126+
## Disclaimer
127+
128+
This is not an officially supported Google product.

src/oss/python/integrations/providers/google.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ Load documents from various Google Cloud sources.
225225
<Card title="Spanner" href="/oss/integrations/document_loaders/google_spanner" cta="Get started" arrow>
226226
Google Cloud Spanner is a fully managed, globally distributed relational database service.
227227
</Card>
228+
<Card title="Bigtable" href="/oss/integrations/document_loaders/google_bigtable" cta="Get started" arrow>
229+
Google Cloud Bigtable is a scalable, fully managed key-value and wide-column store ideal for fast access to structured, semi-structured, or unstructured data.
230+
</Card>
228231
<Card title="Speech-to-Text" href="/oss/integrations/document_loaders/google_speech_to_text" cta="Get started" arrow>
229232
Google Cloud Speech-to-Text transcribes audio files.
230233
</Card>
@@ -268,6 +271,9 @@ Store and search vectors using Google Cloud databases and Vertex AI Vector Searc
268271
<Card title="Spanner" href="/oss/integrations/vectorstores/google_spanner" cta="Get started" arrow>
269272
Vector store using Cloud Spanner
270273
</Card>
274+
<Card title="Bigtable" href="/oss/integrations/vectorstores/google_bigtable" cta="Get started" arrow>
275+
Vector store using Cloud Bigtable
276+
</Card>
271277
<Card title="Firestore (Native Mode)" href="/oss/integrations/vectorstores/google_firestore" cta="Get started" arrow>
272278
Vector store using Firestore
273279
</Card>

0 commit comments

Comments
 (0)