Skip to content

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

Merged
mic-k3y merged 45 commits intogoogleapis:mainfrom
mic-k3y:main
Aug 12, 2025
Merged

feat: add playground notebook for key-value store#179
mic-k3y merged 45 commits intogoogleapis:mainfrom
mic-k3y:main

Conversation

@mic-k3y
Copy link
Contributor

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

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 #<issue_number_goes_here> 🦕

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 mic-k3y self-assigned this Aug 6, 2025
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/langchain-google-bigtable-python API. label Aug 6, 2025
@mic-k3y mic-k3y requested review from ad548 and georgecma August 6, 2025 18:27
@mic-k3y mic-k3y marked this pull request as ready for review August 6, 2025 19:17
@mic-k3y mic-k3y requested review from a team August 6, 2025 19:17
ad548
ad548 previously approved these changes Aug 11, 2025
"cell_type": "code",
"source": [
"# Setting Key-value Pairs using asynchronous method 'amset'\n",
"await store.amset(kv_pairs)"
Copy link
Member

Choose a reason for hiding this comment

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

not sure about this mixed usage of sync and async methods. I feel like we should just use async everywhere for consistency and showcasing best practice. wdyt?

Copy link
Contributor Author

@mic-k3y mic-k3y Aug 11, 2025

Choose a reason for hiding this comment

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

Yeah. I agree. I will make the change.

"source": [
"cached_embedder = CacheBackedEmbeddings.from_bytes_store(\n",
" underlying_embeddings=embeddings,\n",
" document_embedding_cache=store,\n",
Copy link
Member

Choose a reason for hiding this comment

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

should be embedding_store here and below

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 12, 2025 19:58
@mic-k3y mic-k3y merged commit a382284 into googleapis:main Aug 12, 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.

2 participants