Next ‘26 Developer Keynote: Enhancing Agents with Memory

1. परिचय

इस कोडलैब में, ADK एजेंटों को बेहतर बनाने के लिए, लगातार और खास जानकारी जोड़ने का तरीका बताया गया है. आपको Agent Platform Sessions की मदद से बातचीत की स्थिति को मैनेज करने, Memory Bank की मदद से लंबे समय तक सीखने की सुविधा चालू करने, और RAG (Retrieval-Augmented Generation) के लिए Spark और AlloyDB का इस्तेमाल करके, शहर के नियमों से जुड़े जटिल डेटा को इंटिग्रेट करने का तरीका बताया जाएगा.

आपको क्या करना होगा

  • बातचीत को जारी रखने के लिए, Agent Platform Sessions को कॉन्फ़िगर करें.
  • मेमोरी बैंक लागू करें, ताकि एजेंट पिछली बातचीत से सीख सकें.
  • शहर के नियमों से जुड़े दस्तावेज़ों को इंपोर्ट और प्रोसेस करने के लिए, Spark Lightning Engine का इस्तेमाल करें.
  • AlloyDB और वेक्टर सर्च का इस्तेमाल करके, आरएजी सिस्टम बनाना.
  • बेहतर एजेंट को एजेंट प्लैटफ़ॉर्म पर डिप्लॉय करें.

आपको किन चीज़ों की ज़रूरत होगी

अनुमानित अवधि: 60 मिनट

इस कोडलैब में बनाए गए संसाधनों की लागत 5 डॉलर से कम होनी चाहिए.

2. शुरू करने से पहले

Google Cloud प्रोजेक्ट बनाना

  1. Google Cloud Console में, प्रोजेक्ट चुनने वाले पेज पर, Google Cloud प्रोजेक्ट चुनें या बनाएं.
  2. पक्का करें कि आपके Cloud प्रोजेक्ट के लिए बिलिंग चालू हो. किसी प्रोजेक्ट के लिए बिलिंग चालू है या नहीं, यह देखने का तरीका जानें.

Cloud Shell शुरू करना

Cloud Shell, Google Cloud में चलने वाला एक कमांड-लाइन एनवायरमेंट है. इसमें ज़रूरी टूल पहले से लोड होते हैं.

  1. Google Cloud कंसोल में सबसे ऊपर मौजूद, Cloud Shell चालू करें पर क्लिक करें.
  2. Cloud Shell से कनेक्ट होने के बाद, अपने क्रेडेंशियल की पुष्टि करें:
    gcloud auth list
    
  3. पुष्टि करें कि आपका प्रोजेक्ट कॉन्फ़िगर किया गया है:
    gcloud config get project
    
  4. अगर आपका प्रोजेक्ट उम्मीद के मुताबिक सेट नहीं है, तो इसे सेट करें:
    export PROJECT_ID=<YOUR_PROJECT_ID>
    gcloud config set project $PROJECT_ID
    

पुष्टि करें:

gcloud auth list

अपने प्रोजेक्ट की पुष्टि करें:

gcloud config get project

अगर ज़रूरी हो, तो इसे सेट करें:

export PROJECT_ID=<YOUR_PROJECT_ID>
gcloud config set project $PROJECT_ID

एपीआई चालू करें

सेशन मैनेजमेंट, Spark प्रोसेसिंग, और AlloyDB के लिए ज़रूरी सभी एपीआई चालू करने के लिए, यह निर्देश चलाएं:

gcloud services enable \
  aiplatform.googleapis.com \
  run.googleapis.com \
  alloydb.googleapis.com \
  dataproc.googleapis.com \
  documentai.googleapis.com \
  storage.googleapis.com \
  secretmanager.googleapis.com

3. अपना एनवायरमेंट सेट अप करने का तरीका

इस कोडलैब के लिए, आपको कीनोट रिपॉज़िटरी में पहले से कॉन्फ़िगर किए गए एनवायरमेंट का इस्तेमाल करना होगा.

  1. रिपॉज़िटरी का क्लोन बनाएं और प्रोजेक्ट फ़ोल्डर पर जाएं:
git clone https://github.com/GoogleCloudPlatform/next-26-keynotes
cd next-26-keynotes/devkey/enhancing-agents-with-memory
  1. Python वर्चुअल एनवायरमेंट सेट अप करें और ज़रूरी ADK पैकेज इंस्टॉल करें:
uv venv
source .venv/bin/activate
uv sync

एनवायरमेंट वैरिएबल कॉन्फ़िगर करना

एजेंट को Agent Platform और AlloyDB से कनेक्ट करने के लिए, खास कॉन्फ़िगरेशन की ज़रूरत होती है.

  1. सैंपल एनवायरमेंट फ़ाइल कॉपी करें:
cp .env.example .env
  1. .env खोलें और इन फ़ील्ड को अपडेट करें:
    • GOOGLE_CLOUD_PROJECT: आपका प्रोजेक्ट आईडी.
    • GOOGLE_CLOUD_LOCATION: us-central1.
    • ALLOYDB_CLUSTER_ID: rules-db.
GOOGLE_CLOUD_PROJECT=<YOUR_PROJECT_ID>
GOOGLE_CLOUD_LOCATION=global
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_REGION=us-central1
ALLOYDB_CLUSTER_ID=rules-db
  1. बातचीत के सेशन और लंबे समय तक की मेमोरी के लिए, Agent Engine इंस्टेंस बनाने के लिए, यहां दी गई हेल्पर स्क्रिप्ट चलाएं. इससे आपकी .env फ़ाइल में AGENT_ENGINE_ID अपने-आप भर जाएगा:
uv run utils/setup_agent_engine.py

पुष्टि हो जाने के बाद, आपको यह दिखेगा:

Creating Agent Engine instance...
Successfully created Agent Engine. ID: 1234567890
Updated .env with AGENT_ENGINE_ID=1234567890

4. सेशन मैनेजमेंट की सुविधा का इस्तेमाल करके एजेंट बनाना

इस चरण में, आपको मैराथन प्लानर एजेंट को शुरू करना होगा. यह एजेंट, बातचीत के इतिहास को कई बार बनाए रख सकता है. इसके लिए, ADK App क्लास और Agent Platform Sessions का इस्तेमाल किया जाता है.

एजेंट और सेशन सेवा को शुरू करना

planner_agent/agent.py खोलें. आपको दिखेगा कि हम Agent Platform Sessions को इंटिग्रेट करने के लिए, ADK क्लास को कैसे जोड़ रहे हैं. इससे हमें समय के साथ अपने एजेंट को स्टेटफ़ुल बनाने और ज़रूरत के हिसाब से कॉन्टेक्स्ट में बदलाव करने की सुविधा मिलती है.

from google.adk.agents import LlmAgent
from google.adk.sessions import VertexAiSessionService
from vertexai.agent_engines import AdkApp

PROJECT_ID = os.environ.get("GOOGLE_CLOUD_PROJECT")
REGION = os.environ.get("GOOGLE_CLOUD_REGION", "us-central1")

# Initialize Vertex AI for regional services
if PROJECT_ID:
    vertexai.init(project=PROJECT_ID, location=REGION)

# Define the agent logic
root_agent = LlmAgent(
    name="planner_agent",
    model="gemini-3-flash-preview",
    instruction="You are a helpful marathon planning assistant...",
    tools=[] # We will add tools in the next steps
)

def session_service_builder():
    """Builder for Agent Platform Sessions."""
    return VertexAiSessionService(project=PROJECT_ID, location=REGION)

# Wrap the agent in an AdkApp to manage stateful context
app = AdkApp(
    agent=root_agent,
    session_service_builder=session_service_builder
)

5. मेमोरी बैंक की मदद से, लंबे समय तक सीखने की सुविधा चालू करना

सेशन मैनेजमेंट की सुविधा, अलग-अलग बातचीत को ट्रैक करती है. इसी तरह, लॉन्ग-टर्म मेमोरी की सुविधा भी काम करती है. इस चरण में, आपको एजेंट को Agent Platform के Memory Bank से जोड़ना होगा. यह एंटरप्राइज़ के लिए तैयार की गई और पूरी तरह से मैनेज की गई मेमोरी सेवा है.

मेमोरी बैंक सेवा शुरू करना

मेमोरी बैंक की मदद से, एजेंट अलग-अलग सेशन में कॉन्टेक्स्ट को याद रख पाता है. मेमोरी सेवा को शामिल करने के लिए, planner_agent/agent.py को अपडेट करें:

from google.adk.memory import VertexAiMemoryBankService

def memory_service_builder():
    """Builder for Agent Platform Memory Bank."""
    return VertexAiMemoryBankService(
        project=PROJECT_ID,
        location=REGION,
        agent_engine_id=AGENT_ENGINE_ID
    )

ऑटोमैटिक मेमोरी इंजेस्शन की सुविधा लागू करना

हम after_agent_callback जोड़ते हैं, ताकि एजेंट हर बातचीत से सीख सके. यह फ़ंक्शन तब ट्रिगर होता है, जब एजेंट जवाब दे देता है. इससे एजेंट को सेशन की जानकारी "समझने" और बैंक में काम की यादें सेव करने में मदद मिलती है.

  1. कॉलबैक फ़ंक्शन तय करें:
async def auto_save_memories(callback_context):
    """Callback to ingest the session into the memory bank after the turn."""
    # In AdkApp, the memory service is available via the invocation context
    if hasattr(callback_context._invocation_context, 'memory_service') and callback_context._invocation_context.memory_service:
        await callback_context._invocation_context.memory_service.add_session_to_memory(
            callback_context._invocation_context.session
        )
  1. कॉलबैक को LlmAgent से अटैच करें:
root_agent = LlmAgent(
    # ... other params
    after_agent_callback=[auto_save_memories],
)

6. RAG के लिए AlloyDB सेट अप करना

शहर के नियमों का डेटा शामिल करने से पहले, हमें इसे सेव करने के लिए एक हाई-परफ़ॉर्मेंस डेटाबेस की ज़रूरत होती है. इस चरण में, आपको AlloyDB क्लस्टर बनाना होगा. साथ ही, वेक्टर सर्च के लिए डेटाबेस स्कीमा को शुरू करना होगा.

1. AlloyDB क्लस्टर और प्राइमरी इंस्टेंस बनाना

अपना क्लस्टर और उसका प्राइमरी इंस्टेंस बनाने के लिए, Cloud Shell में ये कमांड चलाएं:

# Create the cluster
gcloud alloydb clusters create rules-db \
  --password=postgres \
  --region=us-central1

# Create the primary instance with IAM authentication enabled
gcloud alloydb instances create rules-db-primary \
  --instance-type=PRIMARY \
  --cpu-count=2 \
  --region=us-central1 \
  --cluster=rules-db \
  --database-flags=alloydb.iam_authentication=on

2. ज़रूरी IAM भूमिकाएं असाइन करना

मैनेज किए गए AlloyDB एमसीपी सर्वर का इस्तेमाल करने के लिए, आपकी पहचान को कुछ अनुमतियों की ज़रूरत होती है. ज़रूरी भूमिकाएं देने के लिए, ये कमांड चलाएं:

export USER_EMAIL=$(gcloud config get-value account)

# Role to use MCP tools
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member="user:$USER_EMAIL" \
  --role="roles/mcp.toolUser"

# Role to execute SQL in AlloyDB
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member="user:$USER_EMAIL" \
  --role="roles/alloydb.admin"

# Role for IAM database authentication
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member="user:$USER_EMAIL" \
  --role="roles/alloydb.databaseUser"

# Create the IAM-based database user
gcloud alloydb users create "$USER_EMAIL" \
  --cluster=rules-db \
  --region=us-central1 \
  --type=IAM_BASED

3. AlloyDB Studio की मदद से डेटाबेस और टेबल बनाना

AlloyDB डेटाबेस और टेबल को SQL के ज़रिए मैनेज किया जाता है. इसलिए, हम स्कीमा को फ़ाइनल करने के लिए, Google Cloud Console में AlloyDB Studio का इस्तेमाल करेंगे.

  1. AlloyDB > क्लस्टर पर जाएं और rules-db पर क्लिक करें.
  2. बाईं ओर मौजूद नेविगेशन मेन्यू में, AlloyDB Studio पर क्लिक करें.
  3. postgres उपयोगकर्ता नाम और सेट किया गया पासवर्ड (postgres) डालकर लॉगिन करें.
  4. डेटाबेस बनाने के लिए, यह एसक्यूएल कमांड चलाएं:
    CREATE DATABASE city_rules;
    
  5. AlloyDB Studio में अपने डेटाबेस कनेक्शन को city_rules पर स्विच करें. इसके बाद, एक्सटेंशन इंस्टॉल करने और city_rules टेबल बनाने के लिए, यहां दिया गया SQL चलाएं:rules
    -- Install extensions for vector search and ML
    CREATE EXTENSION IF NOT EXISTS vector;
    CREATE EXTENSION IF NOT EXISTS google_ml_integration CASCADE;
    
    -- Create the rules table
    CREATE TABLE IF NOT EXISTS rules (
        id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
        text TEXT NOT NULL,
        city TEXT NOT NULL,
        embedding vector(3072) DEFAULT NULL
    );
    
    -- Grant your IAM user access to the table (replace with your email)
    GRANT ALL PRIVILEGES ON TABLE rules TO "YOUR_EMAIL_ADDRESS";
    

7. Spark Lightning Engine की मदद से, शहर के नियमों का डेटा इनजेस्ट करना

सटीक प्लानिंग के लिए, किसी एजेंट को सिर्फ़ अच्छी तरह से तैयार किए गए प्रॉम्प्ट की ज़रूरत नहीं होती. इसके लिए, उसे डेटा और संगठन के कॉन्टेक्स्ट में ग्राउंडिंग की ज़रूरत होती है. इस चरण में, बड़े शहर के नियमों वाले PDF को प्रोसेस करने के लिए, Dataproc Serverless पर Spark Lightning Engine का इस्तेमाल किया जाएगा. साथ ही, उन्हें AlloyDB में शामिल किया जाएगा.

Spark Lightning Engine क्यों इस्तेमाल करें?

बड़े पैमाने पर एजेंटों को ग्राउंड करने के लिए, बहुत ज़्यादा मात्रा में अनस्ट्रक्चर्ड डेटा को प्रोसेस करना पड़ता है. Spark Lightning Engine, Spark के लिए एक हाई-परफ़ॉर्मेंस एक्ज़ीक्यूशन इंजन है. यह इन वर्कलोड को काफ़ी हद तक तेज़ कर देता है. हम इसका इस्तेमाल, Google के Document AI का इस्तेमाल करके, दस्तावेज़ों पर सिमैंटिक चंकिंग करने के लिए करते हैं.

स्पार्क पाइपलाइन के बारे में जानकारी

डेटा ट्रांसफ़र करने का लॉजिक spark-setup/spark_alloydb_processor.py में बताया गया है. पाइपलाइन में ये चरण शामिल होते हैं:

  1. PDF की सूची बनाएं: यह फ़ंक्शन, Google Cloud Storage बकेट से दस्तावेज़ों के यूआरआई वापस लाता है.
  2. सिमेंटिक एक्सट्रैक्शन: यह Document AI API को कॉल करने के लिए, यूडीएफ़ (उपयोगकर्ता के तय किए गए फ़ंक्शन) का इस्तेमाल करता है.
  3. AlloyDB में लिखें: यह एक्सट्रैक्ट किए गए टेक्स्ट के हिस्सों को rules नाम की AlloyDB टेबल में सेव करता है.
# Extract from spark_alloydb_processor.py
def process_document(gcs_uri: str):
    # ... calls Document AI to parse PDF ...
    return chunks

# Parallel processing with Spark Lightning Engine
process_udf = udf(process_document, chunk_schema)
chunked_df = uri_df.withColumn("chunks", process_udf(col("gcs_uri"))) \
                   .select(explode(col("chunks")).alias("chunk")) \
                   .select("chunk.*")

# Save to AlloyDB for Vector Search
chunked_df.write.format("jdbc") \
    .option("url", jdbc_url) \
    .option("dbtable", "rules") \
    .mode("append") \
    .save()

डेटा डालने का जॉब चलाना

दी गई स्क्रिप्ट का इस्तेमाल करके, डेटा ट्रांसफ़र करने की प्रोसेस शुरू करें:

./spark-setup/run_dataproc.sh

8. AlloyDB के साथ RAG

शहर के नियमों का डेटा AlloyDB में मौजूद होने की वजह से, एजेंट इसका इस्तेमाल Retrieval-Augmented Generation (आरएजी) के लिए कर सकता है. इससे यह पक्का किया जाता है कि मैराथन प्लान में शहर के कोड के हिसाब से जानकारी दी गई हो.

RAG के लिए AlloyDB की क्षमता

AlloyDB, वेक्टर सर्च के लिए सबसे अच्छा विकल्प है. इसकी मदद से, स्ट्रक्चर्ड डेटा और वेक्टर एम्बेडिंग, दोनों को एक ही जगह पर सेव किया जा सकता है. एजेंट, AlloyDB में पहले से मौजूद embedding फ़ंक्शन का इस्तेमाल करके, नियमों के बारे में सबसे काम की जानकारी ढूंढ सकता है.

हम एजेंट को इस डेटा का ऐक्सेस देने के लिए, एक टूल उपलब्ध कराते हैं. यह टूल, वेक्टर सिमिलैरिटी का इस्तेमाल करके AlloyDB से क्वेरी करता है. इस लॉजिक को hybrid_recall.sql में देखा जा सकता है. इसमें बताया गया है कि किसी क्वेरी और सेव किए गए नियमों के बीच की दूरी की गणना कैसे की जाती है:

SELECT
    text,
    (embedding <=> 
     embedding('gemini-embedding-001', 
               'Restrictions for running a race on the Las Vegas strip')::vector) 
    as distance
FROM
    rules
WHERE city = 'Las Vegas'
ORDER BY
    distance ASC
LIMIT 5;

RAG टूल की मदद से, एजेंट को स्थानीय नियमों के बारे में जानकारी देना

एजेंट के लिए टूल उपलब्ध कराने के लिए, आपको इसे planner_agent/tools.py में तय करना होगा. इसके बाद, इसे planner_agent/agent.py में रजिस्टर करना होगा. हम अपने डेटाबेस से कनेक्ट करने के लिए, Google Cloud के मैनेज किए गए रिमोट AlloyDB MCP सर्वर का इस्तेमाल करेंगे.

  1. "हाइब्रिड रीकॉल" पैटर्न का इस्तेमाल करके, planner_agent/tools.py में टूल को तय करें. हम मैनेज किए जा रहे AlloyDB एमसीपी सर्वर से कनेक्ट करने के लिए, streamable_http प्रोटोकॉल का इस्तेमाल करेंगे:
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def get_local_and_traffic_rules(query: str) -> str:
    """Uses vector search in AlloyDB via managed MCP server."""
    # Vector search query using built-in AlloyDB embedding functions
    sql = f"SELECT text FROM rules WHERE city = 'Las Vegas' ORDER BY embedding <=> google_ml.embedding('gemini-embedding-001', '{query}')::vector ASC LIMIT 5;"
    
    # Establish a streamable HTTP connection to the MCP server
    async with streamablehttp_client(url, headers=get_auth_headers()) as (read_stream, write_stream, _):
        async with ClientSession(read_stream, write_stream) as session:
            await session.initialize()
            result = await session.call_tool(
                "execute_sql",
                arguments={
                    "instance": full_instance_name,
                    "database": "city_rules",
                    "sqlStatement": sql
                }
            )
            return "\n".join([c.text for c in result.content if hasattr(c, 'text')])
  1. टूल रजिस्टर करें और planner_agent/agent.py को फ़ाइनल करें:
# ... imports ...

# Assemble the Agent
root_agent = LlmAgent(
    name="planner_agent",
    model="gemini-3-flash-preview",
    instruction="You are a helpful marathon planning assistant...",
    tools=[
        get_local_and_traffic_rules,
    ],
    after_agent_callback=[auto_save_memories],
)

# 2. Wrap the agent in an AdkApp to manage the stateful lifecycle
app = AdkApp(
    agent=root_agent,
    session_service_builder=session_service_builder,
    memory_service_builder=memory_service_builder
)

9. एजेंट की क्षमताओं के साथ विशेषज्ञ की सलाह

एजेंट की स्किल ऐसे मॉड्यूल होते हैं जिनमें खास निर्देश, दिशा-निर्देश, और संसाधन शामिल होते हैं. इनसे एजेंट को टास्क ज़्यादा असरदार तरीके से पूरे करने में मदद मिलती है. हर टूल के लिए जटिल निर्देशों को सिस्टम प्रॉम्प्ट में शामिल करने के बजाय, उस विशेषज्ञता को एक स्किल में शामिल किया जा सकता है. इस स्किल को सिर्फ़ तब लोड किया जाता है, जब इसकी ज़रूरत होती है.

Google, Google प्रॉडक्ट के लिए पहले से तैयार की गई स्किल उपलब्ध कराता है. जैसे, AlloyDB और BigQuery. इससे यह पक्का किया जा सकता है कि आपके एजेंट, डेटा पर क्वेरी करने और संसाधनों को मैनेज करने के लिए, इंडस्ट्री के सबसे सही तरीकों का पालन करें. इनके अलावा, अन्य खास पैटर्न के बारे में जानने के लिए Google Skills Depot पर जाएं. आपको AlloyDB की बुनियादी स्किल यहां मिलेंगी.

1. स्किल फ़ाइल एक्सप्लोर करना

planner_agent/skills/get-local-and-traffic-rules/SKILL.md पर जाकर, पहले से कॉन्फ़िगर की गई स्किल फ़ाइल खोलें. यह इस तरह दिखता है:

---
name: get-local-and-traffic-rules
description: Retrieve local rules and traffic information for a specific jurisdiction.
---
# get_local_and_traffic_rules Skill

This skill provides guidelines on how to effectively use the `get_local_and_traffic_rules` tool.

## Overview
The `get_local_and_traffic_rules` tool interfaces with an AlloyDB database to perform vector similarity searches on a corpus of rules and traffic information using a provided natural language query.

## Usage Guidelines
1. **Query Specificity**: When calling the tool, provide specific details in the `query` argument. For example, instead of querying "food rules", use "rules regarding food vendors during public events".
2. **Contextual Use**: Use the tool when planning events or activities that require adherence to local municipal or state rules (e.g., street closures, noise ordinances, environmental rules).
3. **Handling Results**: The tool returns a string containing the text of the top 5 most relevant rules. If no error occurs, parse the returned string to inform your planning tasks.
4. **Error Handling**: If an error string is returned (e.g., "Error querying rules: ..."), you must report this failure or attempt an alternative approach if applicable.

## Underlying Mechanism
- The tool uses `google_ml.embedding` to convert the query into a vector representation.
- It calculates distance (`<=>`) against the `embedding` column in the `rules` table on an AlloyDB instance.
- Results are fetched in descending order of similarity, limited to 5 results.

2. स्किल रजिस्टर करने का तरीका

planner_agent/agent.py में, स्किल को डायरेक्ट्री से लोड किया जाता है और एजेंट के टूल में जोड़ा जाता है. कोड ऐसा दिखता है:

import pathlib
from google.adk.skills import load_skill_from_dir
from google.adk.tools import skill_toolset

# Load the AlloyDB skill from its directory
alloydb_skill = load_skill_from_dir(pathlib.Path(__file__).parent / "skills" / "get-local-and-traffic-rules")

# Assemble the Agent with the Skill Toolset
root_agent = LlmAgent(
    name="planner_agent",
    model="gemini-3-flash-preview",
    instruction="You are a helpful marathon planning assistant...",
    tools=[
        get_local_and_traffic_rules,
        skill_toolset.SkillToolset(skills=[alloydb_skill])
    ],
    after_agent_callback=[auto_save_memories],
)

10. एजेंट को टेस्ट करना

  1. एजेंट को स्थानीय तौर पर शुरू करें:
uv run adk run planner_agent
  1. शहर के नियमों के बारे में कोई सवाल पूछें: [user]: What are the rules for running a race on the Las Vegas strip?

एजेंट, get_local_and_traffic_rules टूल को कॉल करेगा. इसके बाद, AlloyDB में वेक्टर सर्च करेगा. इसके बाद, Spark की मदद से प्रोसेस किए गए आधिकारिक नियमों के आधार पर जवाब देगा.

11. एजेंट को डिप्लॉय करना

एजेंट प्लैटफ़ॉर्म पर डिप्लॉय करना

uv run adk deploy agent_engine \
  --env_file .env \
  planner_agent

12. व्यवस्थित करें

शुल्क से बचने के लिए, इस कोडलैब के दौरान बनाए गए संसाधनों को मिटाएं.

AlloyDB क्लस्टर मिटाना

# Delete the AlloyDB Cluster
gcloud alloydb clusters delete rules-db --region=us-central1 --force

एजेंट रनटाइम ऐप्लिकेशन मिटाना

आपके पास कंसोल के ज़रिए या gcloud कमांड का इस्तेमाल करके, Reasoning Engine इंस्टेंस को मिटाने का विकल्प होता है. हालांकि, इसके लिए आपके पास संसाधन का नाम होना चाहिए. आसानी से समझने के लिए, कंसोल का इस्तेमाल करें:

  1. एजेंट रनटाइम पेज पर जाएं.
  2. planner_agent चुनें –> दाईं ओर मौजूद तीन बिंदु वाले बटन पर क्लिक करें.
  3. मिटाएं पर क्लिक करें.

13. बधाई हो

बधाई हो! आपने ADK एजेंट को बेहतर मेमोरी और डेटा ग्राउंडिंग की सुविधाओं के साथ अपग्रेड कर लिया है.

आपको क्या सीखने को मिला

  • स्टेटफ़ुल एजेंट: बातचीत के कॉन्टेक्स्ट को बनाए रखने के लिए, एजेंट प्लैटफ़ॉर्म सेशन को इंटिग्रेट करना.
  • लंबे समय तक सीखने की क्षमता: एजेंट प्लैटफ़ॉर्म मेमोरी बैंक को अटैच करना, ताकि एजेंट लोगों के इंटरैक्शन से सीख सके.
  • डेटा इंपोर्ट करना: अनस्ट्रक्चर्ड दस्तावेज़ों को प्रोसेस करने के लिए, Spark Lightning Engine और Document AI का इस्तेमाल करना.
  • RAG: एजेंट को असल दुनिया के नियमों के बारे में जानकारी देने के लिए, AlloyDB में वेक्टर सर्च सिस्टम बनाना.

अगले चरण

  • मैनेज किए गए डिप्लॉयमेंट के बारे में ज़्यादा जानने के लिए, Agent Platform का दस्तावेज़ पढ़ें.
  • ऐडवांस RAG पैटर्न के लिए, AlloyDB Vector Search के बारे में ज़्यादा जानें.
  • Dataproc Serverless की मदद से, डेटा इंटेक पाइपलाइन को स्केल करें.