Skip to content

feat: integrate AlloyDB AI features#620

Closed
madamsetty-pavan wants to merge 6 commits into
googleapis:mainfrom
madamsetty-pavan:feat/alloydb-ai-features
Closed

feat: integrate AlloyDB AI features#620
madamsetty-pavan wants to merge 6 commits into
googleapis:mainfrom
madamsetty-pavan:feat/alloydb-ai-features

Conversation

@madamsetty-pavan

Copy link
Copy Markdown

Integrate AlloyDB AI Features (Fixes b/531729585)

Description

This pull request brings comprehensive support for the latest AlloyDB AI capabilities directly into the LangChain provider. The integration enables developers to leverage AlloyDB's native Postgres extensions for advanced AI workflows without manually writing raw SQL strings or building ad-hoc wrappers.

Features Implemented

  1. RUM Indexing for Full-Text Search (b/531741249)
    • Added the RUMIndex dataclass to indexes.py for advanced text-search index configurations.
  2. Multimodal Embeddings (b/531740488)
    • Added embed_image() and aembed_image() methods to AlloyDBEmbeddings.
    • Integrates seamlessly with AlloyDB's google_ml.image_embedding() function.
  3. Auto Vector Embeddings (b/531739593)
    • Added initialize_auto_vector_embeddings() to AlloyDBVectorStore (and its async counterpart).
    • Allows automatic invocation of ai.initialize_embeddings() on the target tables.
  4. Time-Series Forecasting Integrations (b/531740822)
    • Built forecast() and aforecast() integrations on the AlloyDBEngine class.
    • Interfaces directly with the native google_ml.forecast() table function.
  5. AI Functions - Sentiment Analysis & Summarization (b/531739592)
    • Introduced AlloyDBSentimentTool and AlloyDBSummaryTool in a new tools.py module.
    • Provides native LangChain BaseTool abstractions that call google_ml.sentiment_analysis() and google_ml.summarize_content().
  6. Columnar Engine Integration (b/531740612)
    • Added enable_columnar_engine() and enable_auto_columnarization() methods to the VectorStore classes to leverage google_columnar_engine_add.
  7. Vector Assist Support (b/531740441)
    • Exposed define_vector_assist_spec(), apply_vector_assist_spec(), and get_vector_assist_recommendations() in the VectorStore.
    • Utilizes the vector_assist Postgres extension to optimize vector queries automatically.
  8. Natural Language to SQL (b/531740565)
    • Created a native AlloyDBToolkit and AlloyDBNL2SQLTool inside toolkit.py.
    • Delegates Natural-Language-to-SQL generation to AlloyDB's alloydb_ai_nl.get_sql() / google_ml.generate_sql() instead of relying on generic LLM schemas, taking advantage of local model tuning and native Postgres understanding.

Motivation and Context

Closes the gap on b/531729585, bringing langchain-google-alloydb-pg-python up to parity with the latest and greatest AlloyDB AI features.

How Has This Been Tested?

The features hook into existing AlloyDBEngine connectivity and leverage _run_as_sync and _run_as_async patterns established within the codebase. The Python syntax is validated successfully. Next steps for the author would be adding integration tests against a live AlloyDB instance equipped with the google_ml_integration and vector_assist extensions.

- Implement RUM Indexing for full-text search
- Add Multimodal Embeddings
- Support Auto Vector Embeddings configuration
- Add Time-Series Forecasting integration
- Create Sentiment and Summarization tools
- Provide LangChain SQL Agent Toolkit for NL2SQL
- Add Vector Assist support
- Add Columnar Engine integration

Fixes b/531729585
@madamsetty-pavan
madamsetty-pavan requested review from a team as code owners July 14, 2026 21:24
@product-auto-label product-auto-label Bot added the api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API. label Jul 14, 2026
@madamsetty-pavan
madamsetty-pavan marked this pull request as draft July 14, 2026 21:26
@madamsetty-pavan

Copy link
Copy Markdown
Author

Superseded by #621, #622, and #623 to make reviews easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants