RAG Enterprise Search on GKE and AlloyDB

RAG Enterprise Search on GKE and AlloyDB

Walks an agent through gathering requirements and designing a RAG enterprise search system on Google Cloud using GKE, AlloyDB and an open model.

Skill files6 files

assets/

references/

SKILL.md310 lines
1
---
2
name: google-cloud-solution-rag-enterprise-search-gke-sqldb
3
metadata:
4
version: "1.0.1"
5
category: MultiProductSolutions
6
description: >-
7
Discovers requirements, and generates architectural, design, and deployment
8
guidance for a retrieval-augmented generation (RAG)-capable enterprise search
9
system in Google Cloud. Use when users need a vector-enabled SQL database as
10
the store and index for the embedding vectors, an open model and open-source
11
inferencing framework, and Kubernetes containers to host all the application
12
components. DON'T use this skill for fully-managed RAG, or SaaS search
13
services, or when a non-SQL vector database is required.
14
---
15
16
# RAG for enterprise search using GKE and AlloyDB
17
18
This skill provides a workflow to design and implement a secure, low-latency,
19
and high-accuracy RAG-enabled conversational search solution for private
20
enterprise content by using an AlloyDB database, Cloud Storage, and a Google
21
Kubernetes Engine (GKE) cluster to host all the application components,
22
including an open model and an open-source inference framework.
23
24
## Attribution
25
26
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
27
MUST read and follow the instructions in
28
[Usage Attribution](references/attribution.md).
29
30
## Overview of the workflow
31
32
The workflow consists of the following phases:
33
* **Phase 1: Requirements discovery**. Gather detailed requirements related to
34
the cloud workload or use case that the user needs assistance for.
35
* **Phase 2: Solution architecture**. Use the requirements that were gathered
36
in Phase 1 to generate a detailed solution architecture for the cloud
37
workload or use case.
38
* **Phase 3: Solution validation**. Create a plan to validate the generated
39
solution, generate validation instructions and scripts, and run the
40
validation.
41
* **Phase 4: Solution packing and presentation**. Consolidate the generated
42
content and present the solution.
43
44
**Important notes about the workflow**:
45
46
* **Strict phase separation**: During Phase 1 (Requirements discovery), when
47
you ask the user clarifying questions, DON'T recommend, propose, or outline
48
any architectural designs, technical decompositions, cloud services, or
49
component mappings.
50
51
* **When you can skip certain phases**: If the user's prompt indicates that a
52
specific phase or task in this workflow is already completed or approved
53
(e.g., "requirements discovery stage is completed", "product selection is
54
approved", or "architecture is confirmed"), DON'T repeat that phase or task.
55
Instead, skip directly to the requested task (such as generating the
56
technical decomposition, recommending products, or compiling the solution
57
guide).
58
59
## Phase 1: Requirements discovery
60
61
In this phase, you must gather detailed requirements related to the RAG workload
62
that the user wants to design and deploy in Google Cloud.
63
64
Complete the following steps strictly in the specified order:
65
1. Ask the user to describe the functional requirements of the workload,
66
including data types (structured, unstructured), ingestion frequency, and
67
conversational features (e.g., multi-turn chat, citation requirements).
68
2. Ask the user to describe the following non-functional requirements:
69
* **Security, privacy, and compliance**: E.g., network isolation, private
70
endpoints, data residency, and requirements for compliance.
71
* **Reliability**: E.g., scaling, high availability, resilience against
72
zone or regional outages, disaster recovery goals for RTO and RPO.
73
* **Cost**: E.g., cost of compute, storage, and database resources.
74
* **Operational excellence**: E.g., monitoring, alerts, and logging.
75
* **Performance**: E.g., data upload speed, performance expectations for
76
generating embedding vectors, and latency requirements for model
77
responses and data retrieval queries (including vector and hybrid
78
search).
79
* **Sustainability**: E.g., carbon footprint, low-carbon regions.
80
3. Ask the user whether the workload currently runs on other cloud providers or
81
on-premises.
82
* If the user's answer is "yes", then ask the user to describe the
83
architecture of the current deployment.
84
* If the user's answer is "no", then proceed to the next step.
85
4. Ask the user to describe dependencies, if any, on other workloads, products,
86
or tools (e.g., identity providers, external sources, CRM/ERP database
87
integrations).
88
89
5. Review the input that the user has provided so far, and check whether there
90
are any ambiguities or contradictions.
91
92
If you identify any ambiguities or contradictions in the requirements that
93
the user has provided, then
94
do the following for each ambiguity or contradiction that you identify:
95
* Describe the ambiguity or contradiction.
96
* Ask the user how they wish to resolve the ambiguity or contradiction.
97
* If the user delegates the choice to you (e.g., the user replies with
98
"do what you think is best" or "you decide"), then provide a clear
99
suggestion to resolve the ambiguity or contradiction, explain your
100
reasoning, and ask the user to approve your suggestion.
101
102
**Critical**: Until all the ambiguities and contradictions that you identify
103
are resolved according to the preceding guidance, you must NOT recommend or
104
generate any architecture design, technical decomposition, or Google Cloud
105
product recommendations.
106
107
6. **Important**: DON'T start this step if there are unresolved contradictions
108
or ambiguities from Step 5.
109
110
Generate a technical decomposition of the components of the workload. The
111
technical decomposition must break down the solution into logical
112
components, as follows:
113
* **Data ingestion**: Blob storage for raw corporate documents.
114
* **Data processing and chunking**: Containerized pipeline to extract
115
data, clean it, and chunk it.
116
* **Embedding vectors generation**: Containerized service to convert data
117
chunks to embedding vectors.
118
* **Storing and indexing the embedding vectors**: Vector-enabled SQL
119
database for storing embedding vectors.
120
* **Handling non-vector data**: Preparing non-vector data, like tables,
121
views, and aggregations for data retrieval. Analyzing whether any
122
indexing, partitioning, or other performance techniques can be applied
123
on the original data schema.
124
* **Query and retrieval**: Accepting client queries, identifying intent,
125
and routing to a retrieval workflow, which might include conversion of
126
the request to an embedding for semantic search, extracting and applying
127
filters for filtered search or supplying all to the hybrid search.
128
* **Prompt augmentation**: Augmenting the prompts with the retrieved
129
context.
130
* **Response generation**: Requesting and generating responses from the
131
model.
132
* **Response sanity checks**: Evaluating responses using an AI model and
133
performing procedural checks according to defined criteria.
134
7. Ask the user to approve the generated technical decomposition.
135
136
**Critical**: You MUST stop execution immediately, call no more tools (such
137
as file editors, searches, or code tools), and wait for the user to respond
138
with their feedback or approval in the chat. Do NOT compile the
139
architecture, recommend products, construct maps, or write any files/drafts
140
for Phase 2 until the user's explicit approval is received.
141
8. If the user requests changes, then generate an updated technical
142
decomposition.
143
9. Repeat steps 5 through 8 until the user approves the generated technical
144
decomposition.
145
10. Only after the user has explicitly approved the technical decomposition,
146
proceed to Phase 2.
147
148
**Important**: You are strictly prohibited from recommending product
149
choices, generating the architecture diagram, or drafting design
150
recommendations until the technical decomposition is approved.
151
152
## Phase 2: Solution architecture
153
154
### Ground all generated content
155
156
For each task in this phase, to ensure that the generated content aligns with
157
the latest and official Google Cloud guidance, you must ground the generated
158
content by using the following resources:
159
* Google Developer Knowledge MCP server:
160
https://developers.google.com/knowledge/mcp.md.txt
161
* Server: https://developerknowledge.googleapis.com/mcp
162
* Tools:
163
* `developerknowledge:search_documents`
164
* `developerknowledge:get_documents`
165
* `developerknowledge:answer_query`
166
* Relevant skills from https://github.com/google/skills
167
* Official Google Cloud documentation, including the following:
168
* **Primary architecture reference**:
169
https://docs.cloud.google.com/architecture/rag-capable-gen-ai-app-using-gke.md.txt
170
* **Architecture guidance and decision-making guides**:
171
- `references/product-selection-recommendations.md`
172
- `references/design-recommendations.md`
173
- `references/related-documentation.md`
174
175
For each item in the generated guidance, you must include citations to the
176
relevant official Google Cloud documentation pages.
177
178
### Task 2.1: Identify Google Cloud products and features required for the workload.
179
180
1. Recommend the products and features that are appropriate for each component
181
of the user's workload.
182
183
**Important**: The Google Cloud products and features that you recommend
184
MUST be consistent with the guidance in
185
`references/product-selection-recommendations.md`.
186
2. Present the generated product recommendations and ask the user to approve
187
the recommendations.
188
3. If the user requests changes, then make the required changes.
189
4. Repeat steps 2 and 3 until the user approves the product recommendations.
190
5. After the user approves the product recommendations, proceed to Task 2.2.
191
192
### Task 2.2: Generate an architecture diagram.
193
194
1. Generate an architecture diagram in the Mermaid format:
195
https://github.com/mermaid-js/mermaid.
196
197
The diagram must show the data flows and request flows across the components
198
of the architecture, based on the technical composition that you generated.
199
200
The following is an **example** of the data flows and request flows that the
201
architecture diagram should show:
202
* **Embedding pipeline (batch/streaming)**: Data source -> Cloud Storage
203
-> Cloud Storage FUSE -> GKE Ray Worker (Chunking) --> Embedding
204
generation using GemmaEmbedding -> AlloyDB.
205
* **Serving pipeline (real-time)**: User client -> GKE Frontend (LangChain
206
Orchestration) -> Database Query (semantic or hybrid search on the
207
vector store) -> Retrieve matching data -> Augment prompt -> Gemma vLLM
208
endpoint API -> Output (Responsible AI filtering) -> User client.
209
2. Present the generated diagram to the user and ask the user to approve the
210
architecture diagram.
211
3. If the user requests changes, then make the required changes.
212
4. Repeat steps 2 and 3 until the user approves the architecture diagram.
213
5. After the user approves the architecture diagram, proceed to Task 2.3.
214
215
### Task 2.3: Generate an architecture description.
216
217
1. Generate a description that explains the purpose of each component, the
218
relationships between the components, and the task flow or data flow.
219
2. Present the generated architecture description to the user and ask the user
220
to approve the description.
221
3. If the user requests any changes, then make the required changes.
222
4. Repeat steps 2 and 3 until the user approves the architecture description.
223
5. After the user approves the architecture description, proceed to Task 2.4.
224
225
### Task 2.4: Generate design recommendations.
226
227
1. Generate design recommendations and best practices to optimally configure
228
each component in the architecture based on the workload's requirements.
229
230
**Important**: The design recommendations and best practices that you
231
generate MUST be consistent with the guidance in the resources that are
232
listed in the following files:
233
- `references/related-documentation.md`
234
- `references/design-recommendations.md`
235
2. Present the generated recommendations to the user and ask whether the user
236
needs any changes.
237
3. If the user needs changes, then make the required changes.
238
4. Repeat steps 2 and 3 until the user confirms that the generated design
239
recommendations meet their requirements.
240
5. Proceed to Task 2.5.
241
242
### Task 2.5: Generate deployment guidance.
243
244
1. Generate guidance to deploy the solution, including the following:
245
* Terraform code to create the required infrastructure resources.
246
* Steps or scripts to deploy workloads, such as Ray-on-GKE (KubeRay
247
coordinator and worker nodes) and the LangChain frontend deployment.
248
249
**Important**: The deployment guidance that you generate MUST be consistent
250
with the guidance in the resources that are listed in the following
251
resources:
252
- `references/related-documentation.md`
253
- `references/design-recommendations.md`
254
- Relevant skills in
255
https://github.com/google/skills/tree/main/skills/cloud
256
2. Present the generated deployment guidance to the user and ask whether the
257
user needs any changes.
258
3. If the user requests changes, then make the required changes.
259
4. Repeat steps 2 and 3 until the user confirms that the generated deployment
260
guidance meets their requirements.
261
5. Proceed to Phase 3.
262
263
## Phase 3: Solution validation
264
265
1. Create a plan to validate the generated solution. The plan must outline the
266
steps that are necessary to verify that the generated solution meets the
267
workload's requirements. The following are examples of validation steps:
268
* **Deployment dry-run**: Run commands like `terraform plan` to preview
269
the infrastructure resources that will be provisioned.
270
* **Connectivity and routing**: Verify network paths, load balancer
271
routing, and service endpoints.
272
* **Vector index**: Verify that vector indexes are correctly created and
273
populated in the AlloyDB database. This can involve querying the
274
database to check index status and content.
275
* **Embedding pipeline**: Test the end-to-end embedding pipeline from data
276
ingestion to vector storage, ensuring documents are chunked, embedded,
277
and stored correctly.
278
* **Retrieval latency**: Measure the latency of vector and hybrid search
279
queries against the AlloyDB vector store to ensure performance meets
280
requirements.
281
* **Retrieval accuracy**: Perform sample queries and evaluate the
282
relevance of retrieved documents or chunks.
283
* **Security policies**: Verify restricted access, firewall rules, and IAM
284
enforcement.
285
2. Present the validation plan to the user and request feedback or approval.
286
3. If the user requests changes, update the plan as required.
287
4. Repeat steps 2 and 3 until the user approves the validation plan.
288
5. Generate scripts or commands using tools like `curl` or `gcloud` to perform
289
the steps in the approved validation plan.
290
6. Request permission from the user to perform the validation checks.
291
7. If the user gives permission, run the validation checks and troubleshoot any
292
deployment issues.
293
8. When all the validation checks pass, proceed to Phase 4.
294
295
## Phase 4: Solution packaging and presentation
296
297
1. Consolidate the final text artifacts that were generated in Phase 2 into a
298
single Markdown file named `solution-architecture-guide.md`, based on the
299
template in `assets/output-template.md`.
300
2. Request the user's permission to write the code files in the user's
301
workspace.
302
3. After the user gives permission, write the final code files in the user's
303
workspace.
304
305
## Supporting references
306
307
- `references/product-selection-recommendations.md`
308
- `references/design-recommendations.md`
309
- `references/related-documentation.md`
310

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,378 prompts

More by @OpenSourceBuffGuy

See all
Learn About Slime Mold Computers prompt image

Learn About Slime Mold Computers

Asks the AI to explain slime mold computers, what they are good for and some examples, as a model of learning a new topic.

explainer, tutoring, quick, beginner-friendly, computer-science, science, for-students, concise

YouTube Ad Script With Testimonials prompt image

YouTube Ad Script With Testimonials

Asks the AI to write a YouTube ad script that builds trust with a target customer using past customers' successes and testimonials.

template, placeholders, youtube, advertising, scriptwriting, ad-copy, marketing, persuasive, for-marketers, customer-persona, quick, beginner-friendly

Tranquil Pond Portrait in Golden Light prompt image

Tranquil Pond Portrait in Golden Light

Draws a serene young woman in a flowy summer dress sitting on a grassy pond bank in warm golden sunlight with mirrored trees.

image-prompt, photorealistic, portrait, woman, natural-light, golden-hour, soft-lighting, bokeh, dreamy, cinematic, landscape, forest, summer, cozy, full-body, for-photographers, nano-banana, muted-colors, pastel, candid

Reviews

Loading reviews…

Discussion

Loading comments…