Google Cloud Solution Hybrid Search Alloydb
GoogleOfficialPublished by Google
- Skill
- Workflow
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill guides users through a comprehensive, multi-phase workflow to architect and implement hybrid search systems. It combines semantic vector search with structured SQL filtering, faceted metadata, and AI-driven reranking within AlloyDB. The process ensures a secure, scalable, and high-performance deployment by strictly following requirements discovery, architectural design, validation, and implementation steps.
What it does
- Facilitates requirements gathering for hybrid search workloads.
- Generates tailored solution architectures for AlloyDB-based search.
- Provides best practices for security, reliability, and performance.
- Produces deployment scripts for database extensions and infrastructure.
- Includes static and runtime validation plans to ensure system integrity.
- Consolidates design artifacts into a final architecture guide.
When to use it
- When building search systems requiring both vector similarity and structured SQL filtering.
- When implementing semantic reranking or in-database AI validation.
- When deploying hybrid search solutions on Google Cloud AlloyDB.
- When you need a structured, step-by-step approach to cloud architecture design.
Advantages
- Ensures architectural consistency through strict phase-based guidance.
- Promotes security by integrating IAM and database-native access controls.
- Provides clear paths for both ingestion and serving pipelines.
- Reduces risk through mandatory validation and approval checkpoints.
Usage examples
- “I need to build a hybrid search system for my e-commerce product catalog using AlloyDB.”
- The agent will initiate Phase 1, asking for functional requirements like catalog size and search modalities, and non-functional requirements like latency and security targets.
- “Can you design an architecture for a hybrid search system that uses vector search and SQL filters?”
- The agent will guide you through the requirements discovery phase first, ensuring all constraints are understood before proposing a specific architecture diagram.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/google-cloud-solution-hybrid-search-alloydb/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-cloud-solution-hybrid-search-alloydb.zip -d .agents/skills
Documentation by Google
Dynamic Hybrid Search using AlloyDB
This skill provides a workflow to design and implement secure, low-latency, and high-accuracy hybrid search solutions combining structured dataset filtering, vector search indexing, faceted metadata filtering, semantic reranking, recall evaluation, in-database AI validation, database abstraction layers, and serverless application hosting.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Overview of the workflow
The workflow consists of the following phases:
Requirements discovery. Gather detailed requirements related to the cloud workload or use case that the user needs assistance for.
Solution architecture. Use the requirements that were gathered in Phase 1 to generate a detailed solution architecture for the cloud workload or use case.
Solution validation. Create a plan to validate the generated solution, generate validation instructions and scripts, and run the validation.
Solution packaging and presentation. Consolidate the generated content and present the solution.
Important notes about the workflow:
Strict phase separation: During Phase 1 (Requirements discovery), when you ask the user clarifying questions, DON'T recommend, propose, or outline any architectural designs, cloud services, or component mappings. This prevents premature architecture commitments or hallucinations before the full scope is understood.
Halting for approval: For any step where you are instructed to "obtain approval before proceeding", you MUST stop executing, present the completed tasks to the user, and wait for their explicit approval. You MUST NOT proceed to execute any subsequent tasks or generate any further guidance in that response.
Ground all generated content: For all tasks across all phases, you MUST first look in the following resources:
Design Recommendations for the required guidance. If the guidance does not provide the required information, you MUST ground the generated content by using the following resources:
Google Developer Knowledge MCP server: https://developers.google.com/knowledge/mcp.md.txt
Server: https://developerknowledge.googleapis.com/mcp
Tools:
developerknowledge:search_documentsdeveloperknowledge:get_documentsdeveloperknowledge:answer_query
Relevant skills from https://github.com/google/skills
Official Google Cloud documentation in Related Guidance
Product Renaming & Terminology
When generating solution designs, architecture diagrams, and documentation, check the latest Google Cloud documentation for the most up-to-date product names. The table below provides examples of name mappings to be aware of. Note that underlying APIs, Terraform resources, and IAM roles may retain their legacy identifiers.
<table> <thead> <tr> <th>Legacy Name</th> <th>Updated Name</th> <th>Notes</th> </tr> </thead> <tbody> <tr> <td>Vertex AI</td> <td>Gemini Enterprise Agent Platform</td> <td>Gemini Enterprise Agent Platform can be shortened to Agent Platform after first instance</td> </tr> <tr> <td>Vertex AI Embedding</td> <td>Text embedding on Gemini Enterprise Agent Platform</td> <td>This refers to the text embedding models available on Gemini Enterprise Agent Platform</td> </tr> <tr> <td>Vertex AI Matching Engine</td> <td>Vector Search</td> <td></td> </tr> </tbody> </table>
Phase 1: Requirements discovery
In this phase, you must gather detailed requirements related to the hybrid search workload that the user wants to design and deploy in Google Cloud.
Acknowledge provided requirements: If the user's prompt already contains some requirements (functional or non-functional, such as catalog size, search modalities, faceted attributes, or latency targets), you MUST explicitly acknowledge and restate all of these requirements in your response. Do NOT ask the user to describe or re-describe any requirements that they have already provided in the prompt.
Complete the following steps strictly in the specified order:
[ ] [ ] Step 1: Ask the user to describe the functional requirements of the workload, including catalog dataset details (e.g., e-commerce apparel, retail products, patent database), search modalities (natural language text, visual search, attribute filters), metadata attributes for faceted filtering (e.g.,
category,sub_category,color,gender,price), and quality checks (reranking, LLM validation).[ ] [ ] Step 2: You MUST explicitly ask the user to describe ALL of the following six categories of non-functional requirements. You need this information because each category represents a critical architectural pillar, and neglecting any of them can result in a solution that is insecure, unreliable, or inefficient (do NOT omit any of them):
Security, privacy, and compliance: E.g., private VPC endpoints, Private Service Connect, Direct VPC Egress, and access control.
Reliability: E.g., high availability, failover, disaster recovery goals (RTO/RPO), regional vs multi-region AlloyDB topology.
Cost: E.g., budget constraints for compute, database instances, and Gemini Enterprise Agent Platform API calls.
Operational excellence: E.g., monitoring, logging, dashboards, and automated deployment.
Performance: E.g., target P95 query latency (e.g., < 100ms), vector search recall target (e.g., > 95%), catalog item scale, and QPS expectations.
Sustainability: E.g., carbon footprint, low-carbon region selection.
[ ] [ ] Step 3: Ask the user whether the workload currently runs on other cloud providers or on-premises.
If the user's answer is "yes", then ask the user to describe the architecture of the current deployment.
If the user's answer is "no", then proceed to the next step.
[ ] [ ] Step 4: Ask the user to describe dependencies, if any, on other workloads, products, or tools (e.g., existing inventory databases, ERP systems, application runtime languages like Java or Python).
[ ] [ ] Step 5: Review the input that the user has provided so far, and check whether there are any ambiguities, conflicts, or contradictions in the functional requirements, non-functional requirements, and dependencies. You MUST compare all requirements against each other to identify any conflicts.
If you identify any ambiguities, conflicts, or contradictions in the requirements that the user has provided, you MUST do the following for each ambiguity, conflict, or contradiction:
[ ] Identify exactly where each contradiction lies and explain to the user why the requirements are incompatible and cannot be simultaneously satisfied. Do NOT treat fundamental contradictions as design choice questions (e.g., asking how to implement or configure a conflicting requirement).
[ ] Ask the user to clarify their trade-off preferences to resolve the contradiction.
[ ] If the user delegates the choice to you (e.g., the user replies with "do what you think is best" or "you decide"), then provide a clear suggestion to resolve the ambiguity or contradiction, explain your reasoning, and ask the user to approve your suggestion.
Critical: Until all the ambiguities and contradictions that you identify are resolved according to the preceding guidance, you must NOT recommend or generate any architecture design or Google Cloud product recommendations.
[ ] [ ] Step 6: Summarize the functional and non-functional requirements provided by the user into a consolidated requirements summary.
[ ] [ ] Step 7: Present the generated requirements summary to the user and obtain approval (the user MUST explicitly say "yes" or "I approve") before proceeding to Phase 2.
Important: STOP, DON'T proceed to generate architecture diagram, architecture description or product recommendations until you have confirmed the generated requirements summary and resolved all ambiguities and contradictions in this phase.
Phase 2: Solution architecture
Task 2.1: Identify Google Cloud products and features required for the workload.
[ ] [ ] Step 1: Recommend products and features that are appropriate for each component of the user's workload, prioritizing Google Cloud products.
Important: The Google Cloud products and features that you recommend MUST be consistent with the guidance in Product Mapping.
[ ] [ ] Step 4: Present the generated product recommendations to the user and obtain approval (the user MUST explicitly say "yes" or "I approve") before proceeding to Task 2.2.
Important: STOP, DON'T proceed to generate architecture diagram until you have confirmed the generated product recommendations with the user.
Task 2.2: Generate an architecture diagram and description
[ ] [ ] Step 1: Generate an architecture diagram in the Mermaid format: https://github.com/mermaid-js/mermaid.
The diagram must show the data flows and request flows across the components of the architecture, based on the gathered requirements and product recommendations. The diagram MUST explicitly show both the ingestion pipeline and serving pipeline.
The following is an example of the data flows and request flows that the architecture diagram should show:
Ingestion pipeline: Catalog Data -> AlloyDB Table (
apparels) -> B-Tree Indexes on Facets -> Text embedding (text-embedding-005) -> ScaNN Vector Index.Serving pipeline: User Browser -> Cloud Run Web App -> MCP Toolbox for Databases -> AlloyDB Single-Query Hybrid Search (ScaNN Vector Search + SQL WHERE Filters) ->
ai.rankReranker -> Gemini Proai.generateQuality Validation -> Validated Results -> User Browser.
[ ] [ ] Step 2: Generate a description that explains the purpose of each component, the relationships between the components, and the task flow or data flow.
[ ] [ ] Step 3: Present the generated architecture diagram and description to the user and obtain approval (the user MUST explicitly say "yes" or "I approve") before proceeding to Task 2.3.
Important: STOP, DON'T proceed to generate design recommendations until you have confirmed the generated architecture description with the user.
Task 2.3: Generate design recommendations.
[ ] [ ] Step 1: Generate design recommendations and best practices to optimally configure each component in the architecture based on the workload requirements.
Important:
When you generate design recommendations, consider the following:
Functional requirements that were gathered in Phase 1.
Non-functional requirements that were gathered in Phase 1.
Align the generated design recommendations with the recommendations in Design Recommendations.
To generate guidance for the non-functional requirements, use the following skills:
google-cloud-waf-securitygoogle-cloud-waf-reliabilitygoogle-cloud-waf-cost-optimizationgoogle-cloud-waf-operational-excellencegoogle-cloud-waf-performance-optimizationgoogle-cloud-waf-sustainability
[ ] [ ] Step 2: Present the generated recommendations to the user and obtain approval (the user MUST explicitly say "yes" or "I approve") before proceeding to Task 2.4.
Important: STOP, DON'T proceed to generate deployment guidance until you have confirmed the design recommendations with the user.
Task 2.4: Generate deployment guidance.
[ ] [ ] Step 1: Generate guidance to deploy the solution, including the following:
AlloyDB DDL & SQL setup scripts for extensions (
google_ml_integration,alloydb_scan), tables, B-Tree indexes, ScaNN vector indexes, hybrid search SQL, and Gemini validation CTEs.MCP Toolbox deployment configuration on Cloud Run.
Python Cloud Run Function shim deployment command.
Application deployment command (
gcloud run deploy {app_name}).Terraform code or
gcloudCLI commands to create required infrastructure.
Important: The deployment guidance that you generate MUST be consistent with the guidance in the following resources:
Relevant skills in https://github.com/google/skills/tree/main/skills/cloud
[ ] [ ] Step 2: Present the generated deployment guidance to the user and obtain approval (the user MUST explicitly say "yes" or "I approve") before proceeding to Phase 3.
Important: STOP, DON'T proceed to generate solution validation until you have confirmed the deployment guidance with the user.
Phase 3: Solution validation
Task 3.1: Pre-deployment validation
[ ] Step 1: Create a pre-deployment plan to statically validate the generated solution and verify that it meets the workload requirements without provisioning live resources:
Deployment dry-run: Validate infrastructure syntax and preview the resources that will be provisioned using dry-run commands (e.g.,
terraform planor (where supported)gcloud ... --dry-run).Architecture & policy analysis: Perform static verification of network routing topologies, firewall rules, and IAM enforcement against best practices.
[ ] Step 2: Present the static validation plan to the user, obtain approval (the user MUST explicitly say "yes" or "I approve"), and execute the dry-run commands.
[ ] Step 3: Troubleshoot and fix any errors or policy discrepancies identified during dry-run checks until validation succeeds.
[ ] Step 4: Proceed to Task 3.2
Task 3.2: Runtime validation (Post-deployment)
[ ] Step 1: Ask the user whether they choose to deploy the infrastructure now to perform live runtime verification, or skip directly to Phase 4.
[ ] Step 2: If the user chooses to deploy the infrastructure:
After the user deploys the infrastructure, generate runtime verification commands (using tools like
curl,ping, orgcloud) and provide them to the user to execute, to test live endpoint reachability, networking paths, and load balancer routing.Troubleshoot any deployment or runtime routing issues until checks pass.
[ ] Step 3: Proceed to Phase 4.
Phase 4: Solution packaging and presentation
[ ] Step 1: Consolidate the final text artifacts that were generated in Phase 2 into a single Markdown file named
solution-architecture-guide.md, based on the template in Output Template.[ ] Step 2: Request the user's permission to write the code files in the user's workspace.
[ ] Step 3: After the user gives permission, write the final code files in the user's workspace.
Files
- ATTRIBUTION.mdAdded by AutoGineer904 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md15.7 KiB
- assets/output-template.md7.2 KiB
- references/attribution.md1.9 KiB
- references/design-recommendations.md5.9 KiB
- references/product-mapping.md10.7 KiB
- references/related-guidance.md2.6 KiB
assets/output-template.md
<!-- Use this template to compile the content that you generate based on the instructions in `SKILL.md`. -->
Google Cloud solution architecture: Hybrid Search
1. Executive summary and workload overview
[A brief description of the workload, its business goals, and the high-level solution architecture proposed.]
2. Requirements and current state
2.1. Functional requirements
Business processes: [Details of the business processes supported]
Activities and use cases: [Details of the key activities and use cases]
2.2. Non-functional requirements
Security: [Details of the security requirements including compliance, encryption, access control requirements]
Reliability: [Details of the reliability requirements including SLA, RTO/RPO, backup, redundancy requirements]
Cost: [Details of the cost constraints and pricing models]
Operations: [Details of the operational requirements including monitoring, logging, deployment, maintenance requirements]
Performance: [Details of the performance requirements including latency, throughput, scaling requirements]
Sustainability: [Details of the sustainability requirements including carbon footprint, resource optimization requirements]
2.3. Current state
[If applicable, describe the current on-premises or other-cloud architecture.]
Current infrastructure: [Details of existing setup]
Pain points and drivers for migration/redesign: [Details of the drivers for migration/redesign]
2.4. Dependencies
Internal dependencies: [Details of internal dependencies including other workloads and internal services]
External dependencies: [Details of external dependencies including third-party products and on-premises tools]
3. Technical decomposition of the workload
[Technical decomposition of the workload components, breaking down the application into logical layers: data ingestion & embedding pipeline, relational & vector data store, hybrid query engine & reranker, database abstraction & agentic tooling, and web application UI.]
4. Proposed solution architecture
4.1. Google Cloud products and features mapping
[Identify Google Cloud products and features mapped to the technical components. For each component, justify the selection, note alternatives considered, and describe the pros and cons of the recommended product/feature and alternatives.]
| Component | Recommended Google Cloud product/feature | Justification and citations | Alternatives considered | Pros and cons of alternatives |
|---|---|---|---|---|
| [Component Name] | [Product Name] | [Why this product is chosen, citing official docs] | [Alternative product] | Pros: ... <br> Cons: ... |
4.2. Architecture diagram
[Architecture diagram in Mermaid format showing the relationships and flows between the components of the architecture.]
%% Example hybrid search topology
graph TD
User([User Browser]) --> LoadBalancer[Application Load Balancer]
LoadBalancer --> WebApp[Cloud Run Web App]
WebApp --> MCPToolbox[MCP Toolbox for Databases]
MCPToolbox --> AlloyDB[(AlloyDB for PostgreSQL)]
subgraph AlloyDB for PostgreSQL
AlloyDB -->|Embedding Generation| GeminiEnterpriseAgentPlatform[Agent Platform text-embedding-005]
AlloyDB -->|ScaNN Vector Search| ScaNNIndex[ScaNN Index Scan]
AlloyDB -->|In-Database LLM Reranking| Gemini[ Gemini AI Operators]
end4.3. Architecture description
[Detailed description of the architecture. Describe the task flow and data flow between the components of the architecture.]
Data flow: [Describe the flow of data.]
Tasks/control flow: [Describe the flow of tasks/control.]
5. Design and configuration recommendations
[Best practices and configuration recommendations for each pillar of the Google Cloud Architecture Framework.]
5.1. Security, privacy, and compliance
Access control: [E.g., IAM least privilege roles (roles/alloydb.client, roles/aiplatform.user), PostgreSQL database-native CREATE ROLE permissions, search_path isolation]
Data protection: [E.g., CMEK encryption at rest, mTLS Auth Proxy transit encryption, DLP de-identification templates]
Network Security: [E.g., Direct VPC Egress, Private Services Access/PSC, Cloud Armor WAF rules, disabled default run.app URLs]
5.2. Reliability
Redundant deployment: [E.g., AlloyDB multi-zone HA instance, regional Cloud Run deployment]
Backup and DR: [E.g., AlloyDB continuous microsecond PITR backups, cross-region replication]
5.3. Operational excellence
Monitoring and logging: [E.g., Cloud Logging structured JSON logs, Cloud Trace, AlloyDB Query Insights and System Insights dashboards]
Infrastructure as Code (IaC): [E.g., Terraform manifests, gcloud CLI commands]
5.4. Cost optimization
Sizing and scaling: [E.g., Cloud Run scale-to-zero, Cloud Storage Object Lifecycle Management]
Pricing models: [E.g., Committed Use Discounts (CUDs) for AlloyDB compute]
5.5. Performance efficiency
Caching and database indexing: [E.g., ScaNN multi-level tree tuning (num_leaves, num_leaves_to_search), B-tree facet indexes, leaf search streaming (scann.satisfy_limit = 'relaxed_order')]
Data updates: [E.g., Automated embedding generation, automatic ScaNN index self-maintenance (
MODE='AUTO')]
5.6. Sustainability
[E.g., Serverless compute scaling, in-database query execution and AI function evaluation]
6. Deployment guidance
[Instructions and code for deploying the architecture.]
6.1. Deployment prerequisites
[Prerequisite 1: E.g., Enabling APIs (alloydb.googleapis.com, aiplatform.googleapis.com, run.googleapis.com)]
[Prerequisite 2: E.g., Installing SDKs/tools (gcloud, terraform, psql)]
...and so on
6.2. Step-by-step deployment instructions
[Step 1: E.g., Authenticate with Google Cloud and set project environment]
[Step 2: E.g., Initialize and apply Terraform infrastructure manifests]
[Step 3: E.g., Deploy containerized application and MCP tools to Cloud Run]
7. Validation plan
[Details of the pre-deployment static dry-run checks and post-deployment runtime verification steps (e.g., ScaNN vector query recall measurement using evaluate_query_recall, endpoint health checks).]
8. References
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/google-cloud-solution-hybrid-search-alloydb · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-solution-hybrid-search-alloydb.zip