Skip to content

feat: add playground notebook for the vector store#191

Merged
mic-k3y merged 95 commits intogoogleapis:mainfrom
mic-k3y:main
Aug 29, 2025
Merged

feat: add playground notebook for the vector store#191
mic-k3y merged 95 commits intogoogleapis:mainfrom
mic-k3y:main

Conversation

@mic-k3y
Copy link
Contributor

@mic-k3y mic-k3y commented Aug 29, 2025

This PR adds the playground notebook for BigtableVectorStore Usage.
It also updates the library documentation.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #190 🦕

mic-k3y and others added 30 commits July 17, 2025 16:51
…context

Added the engine class that manages the client and execution context which handles the async and sync conversion via a background event loop.

Added a test file for the engine class.
…tion

Removes the option to pre-instantiate and pass a BigtableDataClientAsync
to the BigtableEngine. The engine now creates its own client instance,
making it more self-contained.
Adjusted test cases and assertions to align with the recent modifications
in the BigtableEngine class API and behavior.
This change introduces BigtableEngine.async_initialize for non-blocking
asynchronous initialization.
…n LangChain's key-value store.

This commit introduces the `AsyncBigtableByteStore` class. This class is designed to handle setting,
getting, deleting, and yielding keys asynchronously. It will be used by the main public-facing
`BigtableByteStore` for all the data operations on the table. It also includes a test suite.
The `shutdown_default_loop` method was not closing the asyncio event loop, only that class level variables were reassigned. This commit adds a line that closes the loop when the thread is successfully terminated.
# Conflicts:
#	src/langchain_google_bigtable/engine.py
#	tests/test_engine.py
The `shutdown_default_loop` method was not closing the asyncio event loop, only that class level variables were reassigned. This commit adds a line that closes the loop when the thread is successfully terminated.
…context (googleapis#163)

* feat: add BigtableEngine Class for managing the client and execution context

Added the engine class that manages the client and execution context which handles the async and sync conversion via a background event loop.

Added a test file for the engine class.

* fix(engine): update BigtableEngine setup by internalizing client creation

Removes the option to pre-instantiate and pass a BigtableDataClientAsync
to the BigtableEngine. The engine now creates its own client instance,
making it more self-contained.

* test(engine): update tests to match BigtableEngine class changes

Adjusted test cases and assertions to align with the recent modifications
in the BigtableEngine class API and behavior.

* style(engine): update test_engine.py and engine.py format

* test(engine): add tests for async_initialize workflow

* feat(engine): add async_initialize factory and shared loop management

This change introduces BigtableEngine.async_initialize for non-blocking
asynchronous initialization.

* style(engine): update test_engine.py
# Conflicts:
#	src/langchain_google_bigtable/async_key_value_store.py
…lementation.

This class will be used for interacting with LangChain's key-value store for Bigtable. It contains methods that add, delete, get, and yield key-value pairs from the store. It's an implementation of LangChain's BaseStore(ByteStore) abstract interface. This commit also contains comprehensive test suites. It also contains a change for the table creation fixture for the engine test, simplifying it from previous approach.
… raises error.

address error handling test compatibility for Python 3.9
mic-k3y and others added 6 commits August 29, 2025 06:40
feat: add BigtableVectorStore Playground notebook.

fix: make sure the typing_extensions is supported across all python versions supported by this library

feat: change documentation for the library

fix: update vector_store.ipynb

fix: update vector_store.ipynb

fix: update vector_store.ipynb

feat: add BigtableVectorStore Playground notebook.

fix: update vector_store.ipynb
feat: update documentation for the library
feat: update documentation for the library

feat: update documentation for the library
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/langchain-google-bigtable-python API. label Aug 29, 2025
@mic-k3y mic-k3y self-assigned this Aug 29, 2025
@mic-k3y mic-k3y requested review from ad548 and georgecma August 29, 2025 07:23
@mic-k3y mic-k3y marked this pull request as ready for review August 29, 2025 07:23
@mic-k3y mic-k3y requested review from a team August 29, 2025 07:23
@@ -0,0 +1,769 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the title is Google Bigtable, does it need to be more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other integrations only had their name, so I kept it for consistency.

{
"cell_type": "markdown",
"source": [
"## Embedding Service Setup"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe a short blurb explaining embedding service

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

georgecma
georgecma previously approved these changes Aug 29, 2025
Copy link

@georgecma georgecma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 nit comments but otherwise it covers vector store use cases well.

" search_type=\"mmr\",\n",
" search_kwargs={\n",
" \"k\": 2,\n",
" \"lambda_mult\": 0.8, # prioritizes similarity over diversity\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmr would be diversity over priority no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the comment to explain what the 0.8 value would represent. I think that might be misleading actually. I just changed it to 0.2 and wrote prioritizes diversity over similarity.

"`BigtableVectorStore` supports three main categories of filters to refine your search:\n",
"\n",
"* **Row Key (Document ID) Filters**:\n",
" * `RowKeyFilter`: Narrows the search to document IDs with a specific prefix.\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we mention that document ID filter is always applied? Maybe something like "Narrows the search to document IDs and a specific row prefix. The document ID filter is always applied by default."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mic-k3y mic-k3y requested a review from ad548 August 29, 2025 16:56
@mic-k3y mic-k3y merged commit d85f4cc into googleapis:main Aug 29, 2025
11 checks passed
yangyzs pushed a commit to yangyzs/langchain-google-bigtable-python that referenced this pull request Aug 31, 2025
…lementation (googleapis#176)

This class will be used for interacting with LangChain's key-value store for Bigtable. It contains methods that add, delete, get, and yield key-value pairs from the store. It's an implementation of LangChain's BaseStore(ByteStore) abstract interface. This commit also contains comprehensive test suites. It also contains a change for the table creation fixture for the engine test, simplifying it from previous approach.

chore(main): release 0.5.0 (googleapis#167)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

feat: add playground notebook for key-value store (googleapis#179)

* feat: add playground notebook for key-value store

This commit adds a notebook for how to use key-value stores.

* fix: update embedding model used in key_value_store notebook

This commit also updates the embedding model used for playground notebook.

* fix: update readme.rst file

* fix: address PR comments for the notebook

chore(main): release 0.6.0 (googleapis#182)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

initial get_table and execute_query implementation

feat: add `AsyncBigtableVectorStore` Class for the async-only vector value store implementation (googleapis#186)

* feat: add AsyncBigtableVectorStore Class for the async-only vector value store implementation

This commit adds the async-only vector store class that handles the underlying data operations for the main vector store class along with its test files.

* fix: include comments on the key-value store usage cells

Included comments explaining how the embedding cache key-value store works.

* fix: include comments on the key-value store usage cells

Included comments explaining how the embedding cache key-value store works.

* fix: header date for async_vector_store.py

fix: include comments on the key-value store usage cells

Included comments explaining how the embedding cache key-value store works.

* fix: typing for tests and async vector store class

fix: add os environment function for the tests

* fix: isort for imports for test files

* fix: revert removed test_async_key_value_store.py file.

* fix: address PR comments

* fix: address PR comments

* fix: address PR comments

* fix: address PR comments

* fix: address PR comments

* fix: address PR comments

* fix: address PR comments

* fix: add check to make sure each document has an ID.

feat: add `BigtableVectorStore` Class for LangChain Vector Store integration (googleapis#189)

* feat: add `BigtableVectorStore` class for Bigtable <> LangChain Vector Store integration.

* feat: add `BigtableVectorStore` class for Bigtable <> LangChain Vector Store integration.

* fix: isort imports for test file.

* fix: fixture return types.

* chore: add more test cases

* fix: remove await from sync store test suite

* fix: reformat test_vector_store.py

* fix: address PR comments.

chore(main): release 0.7.0 (googleapis#187)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

feat: add playground notebook for the vector store (googleapis#191)

* feat: add BigtableVectorStore Playground notebook.

* feat: add BigtableVectorStore Playground notebook.

fix: update vector_store.ipynb

* fix: update vector_store.ipynb

* fix: update vector_store.ipynb

* fix: update vector_store.ipynb

* feat: change documentation for the library

feat: add BigtableVectorStore Playground notebook.

fix: make sure the typing_extensions is supported across all python versions supported by this library

feat: change documentation for the library

fix: update vector_store.ipynb

fix: update vector_store.ipynb

fix: update vector_store.ipynb

feat: add BigtableVectorStore Playground notebook.

fix: update vector_store.ipynb

* feat: update documentation for the library

feat: update documentation for the library

* feat: update documentation for the library

feat: update documentation for the library

feat: update documentation for the library

* feat: update documentation for the library

* fix: reformat vector_store.ipynb

* fix: address PR comments

* fix: address PR comments.

* fix: address PR comments.

chore(main): release 0.8.0 (googleapis#192)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

resolve merge conflict with upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/langchain-google-bigtable-python API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add playground notebook for the vector store

3 participants