Commit 7a6d849
feat(tools/cloudsqlpg): Add vector assist tools for Cloud SQL Postgres (#2909)
## Description
Adds 4 new mcp tools for Cloud SQL Postgres source related to the vector
assist postgres extension. These tools enable the customers to set up
and optimize production-ready vector workloads by simply expressing your
intent and performance requirements.
| Tool Set | Description |
|:---------------------------------|:------------------------------------------------------------------------
|
| `vectorassist` | Use these skills to set up and optimize
production-ready vector workloads |
| | by simply expressing your intent and performance requirements |
| Tool Name | Description |
|:---------------------------------|:---------------------------------------------------------------|
| `define_spec` | Defines a new vector specification for search
workloads. |
| `modify_spec` | Modifies an existing vector specification. |
| `apply_spec` | Executes SQL recommendations for a vector
specification. |
| `generate_query` | Generates optimized SQL queries for vector
searches. |
## Manual testing
Workflows covered by these tools
### 1. Setup vector search in the database
Prompt : Set up the table 'cymbal_products' for vector workloads where I
want to perform a similarity search on the embeddings generated for the
column 'product_description'.
Expected tools to be used in the CUJ : define-spec -> apply-spec
<img width="1282" height="639" alt="Screenshot 2026-04-09 at 2 50 02 PM"
src="https://github.com/user-attachments/assets/0c05fb23-88df-4c26-9dd3-59678ed6cc90"
/>
<img width="1289" height="717" alt="Screenshot 2026-04-09 at 2 52 34 PM"
src="https://github.com/user-attachments/assets/e1a2e4ea-cadc-4692-b0f5-dc4c914710a6"
/>
<img width="1270" height="683" alt="Screenshot 2026-04-09 at 3 04 17 PM"
src="https://github.com/user-attachments/assets/a2ac1349-5815-45c1-abc6-fd8210a5570f"
/>
<img width="1281" height="462" alt="Screenshot 2026-04-09 at 3 06 12 PM"
src="https://github.com/user-attachments/assets/bce60906-2723-4a64-aaa0-9095fc83466b"
/>
### 2. Modify & apply spec
Prompt : Modify the vector specification 'cymbal_products' table to
generate embeddings on the column 'product_description' using the
embedding model 'text-embedding-004'
Expected tools to be used in the CUJ : define-spec -> modify-spec ->
apply-spec
<img width="1180" height="798" alt="Screenshot 2026-04-09 at 9 45 03 PM"
src="https://github.com/user-attachments/assets/d8566527-a04d-4209-b78f-693ffb8e9298"
/>
<img width="1171" height="373" alt="Screenshot 2026-04-09 at 9 35 27 PM"
src="https://github.com/user-attachments/assets/b6c894c3-1c6f-4d4b-85d1-59832d097b4f"
/>
<img width="1175" height="598" alt="Screenshot 2026-04-09 at 9 37 11 PM"
src="https://github.com/user-attachments/assets/45c79bb5-5509-4196-84c9-0e091fd1168f"
/>
<img width="1176" height="622" alt="Screenshot 2026-04-09 at 9 39 12 PM"
src="https://github.com/user-attachments/assets/5eaffd4c-5315-482f-8616-a3c4503a65ef"
/>
### 3. Find top-k similarity items
Prompt : find the top 10 products from cymbal_products table which have
description similar to this query "What kind of fruit trees grow well
here?"
Expected tools to be used in the CUJ : generate-query -> execute-sql
<img width="1273" height="259" alt="Screenshot 2026-04-09 at 3 25 48 PM"
src="https://github.com/user-attachments/assets/79d71a31-a9ce-4948-aa75-d35dc33f4420"
/>
<img width="1275" height="483" alt="Screenshot 2026-04-09 at 3 26 12 PM"
src="https://github.com/user-attachments/assets/2d54327d-c048-457e-9e44-4c710e1523d3"
/>
<img width="1246" height="619" alt="Screenshot 2026-04-09 at 3 27 12 PM"
src="https://github.com/user-attachments/assets/d2a1a021-f179-4d86-9050-50a2dbefac64"
/>
## PR Checklist
> 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:
- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change
🛠️ Fixes #<issue_number_goes_here>
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>1 parent 39c02e6 commit 7a6d849
17 files changed
Lines changed: 1660 additions & 0 deletions
File tree
- cmd/internal
- docs
- en/integrations/cloud-sql-pg/tools
- internal
- prebuiltconfigs/tools
- tools/cloudsqlpg
- vectorassistapplyspec
- vectorassistdefinespec
- vectorassistgeneratequery
- vectorassistmodifyspec
- tests/cloudsqlpg
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1747 | 1747 | | |
1748 | 1748 | | |
1749 | 1749 | | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1750 | 1754 | | |
1751 | 1755 | | |
1752 | 1756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
0 commit comments