<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yash Kavaiya on Medium]]></title>
        <description><![CDATA[Stories by Yash Kavaiya on Medium]]></description>
        <link>https://medium.com/@yashkavaiya?source=rss-7648c222eaf0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8aabXWi5qo9SNt5CZNF5XQ.jpeg</url>
            <title>Stories by Yash Kavaiya on Medium</title>
            <link>https://medium.com/@yashkavaiya?source=rss-7648c222eaf0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:24:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashkavaiya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Always-On Agents Work: Building Persistent Digital Colleagues]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://yashkavaiya.medium.com/how-always-on-agents-work-building-persistent-digital-colleagues-419fac8d5ff9?source=rss-7648c222eaf0------2"><img src="https://cdn-images-1.medium.com/max/1672/1*Doiz1beMdsi4QlyND8ESHA.png" width="1672"></a></p><p class="medium-feed-snippet">Imagine you give an AI a task, close your laptop, and go to sleep. When you wake up, the work is done.</p><p class="medium-feed-link"><a href="https://yashkavaiya.medium.com/how-always-on-agents-work-building-persistent-digital-colleagues-419fac8d5ff9?source=rss-7648c222eaf0------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://yashkavaiya.medium.com/how-always-on-agents-work-building-persistent-digital-colleagues-419fac8d5ff9?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/419fac8d5ff9</guid>
            <category><![CDATA[agent-harness]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 18:31:09 GMT</pubDate>
            <atom:updated>2026-10-13T18:31:09.031Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Playbooks in Dialogflow CX: The Building Blocks of Truly Intelligent Generative Agents]]></title>
            <link>https://medium.com/google-cloud/playbooks-in-dialogflow-cx-the-building-blocks-of-truly-intelligent-generative-agents-3c3d89b2dd77?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c3d89b2dd77</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[conversational-agents]]></category>
            <category><![CDATA[ansible-playbook]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 06:06:27 GMT</pubDate>
            <atom:updated>2026-06-06T06:06:27.320Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How Goals, Instructions, Examples, and Smart Orchestration Are Redefining Conversational AI — and Why Every CX Practitioner Should Master Them in 2026</em></p><p>As a Developer focused on Conversational AI, I’ve spent years building production-grade agents across Dialogflow CX, and now the generative capabilities in Google’s Conversational Agents platform. The introduction of <strong>Playbooks</strong> represents one of the most significant leaps in how we design, maintain, and scale intelligent conversations.</p><p>If you’re still thinking of agents purely in terms of intents, flows, and pages, it’s time to expand your mental model. Playbooks bring the power of large language models directly into agent design — while giving you the structure and control that pure “chat with an LLM” approaches lack.</p><h3>What Exactly Is a Playbook?</h3><p>A <strong>playbook</strong> is the fundamental building block of generative agents in Dialogflow CX (now part of the broader Conversational Agents experience).</p><p>Instead of hand-crafting dozens of intents and complex state machines for every possible user journey, you define high-level <strong>goals</strong> and <strong>step-by-step instructions</strong> in natural language. The LLM then handles the reasoning, routing, tool use, and response generation at runtime.</p><blockquote><em>“A playbook is the basic building block of generative agents. A generative agent typically has many playbooks, where each playbook is defined to handle specific tasks.” — Google Cloud Documentation</em></blockquote><p>This modular approach lets you break complex domains into focused, reusable units — much like microservices for conversation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fjq4oJdcQkjY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2Fjq4oJdcQkjY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fjq4oJdcQkjY%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cbacefa4d6276031d62345a591cd94d/href">https://medium.com/media/1cbacefa4d6276031d62345a591cd94d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gONA_ut1cfaSCgBIgBcYdg.png" /></figure><p><strong>Key components of every playbook:</strong></p><ul><li><strong>Name</strong> — Clear, natural-language identifier (keep it under 64 characters)</li><li><strong>Goal</strong> — High-level description of what the playbook should accomplish</li><li><strong>Instructions</strong> — Structured, step-by-step process (the real “prompt engineering” layer)</li><li><strong>Examples</strong> — Few-shot conversation samples (often more important than perfect instructions)</li><li><strong>Parameters</strong> — Explicit input/output context variables</li><li><strong>Tools</strong> — Connections to data stores, APIs, or external systems</li><li><strong>Conditional Actions</strong> — Optional explicit control layer for triggers and deterministic behavior</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZqp166NSlk5cHrUrJc5-w.png" /></figure><h3>The Heart of It All: Playbook Goals</h3><p>A <strong>goal</strong> is a concise, high-level description of the playbook’s purpose.</p><p><strong>Example from the docs:</strong></p><blockquote><em>“Help customers to book flights and hotels.”</em></blockquote><p>You can also embed response-style instructions directly in the goal:</p><blockquote><em>“You’re a helpful assistant that uses your knowledge to generate code, compare products, find images, or other. Return your responses in markdown format.”</em></blockquote><p>With this goal, users can naturally ask:</p><ul><li>“Compare Google Pixel 7 versus Google Pixel 8 in a table.”</li><li>“Find a picture of two people high fiving.”</li></ul><p><strong>GDE Tip:</strong> Treat the goal as your north star. It sets the tone, personality, and output format expectations for the entire playbook. Keep it focused — one clear objective per playbook.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F38mEaaynQDk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F38mEaaynQDk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F38mEaaynQDk%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/00f811b5849db52c889dfe1a37ca057e/href">https://medium.com/media/00f811b5849db52c889dfe1a37ca057e/href</a></iframe><h3>Instructions: Where the Magic (and Control) Happens</h3><p>This is where most of the prompt engineering power lives. <strong>Instructions</strong> define the <em>process</em> the LLM should follow to achieve the goal.</p><p>They support:</p><ul><li>Simple natural language steps</li><li>Routing to other playbooks using ${PLAYBOOK: playbook_name}</li><li>Invoking tools with ${TOOL: tool_name}</li><li>Handing off to traditional flows with ${FLOW: flow_name}</li><li>Referencing parameters with $parameter_name</li><li>Calling code blocks</li><li>Hierarchical numbering and strict sequencing (“Do not proceed until…”)</li></ul><p><strong>Excellent real example from Google’s documentation (flight booking style):</strong></p><p><a href="https://youtube.com/shorts/cAJ2TFnpYhk">https://youtube.com/shorts/cAJ2TFnpYhk</a></p><pre>- Step 1. Greet the user and ask how you can assist them today.<br>- Step 2. Collect the user&#39;s basic flight information in the following order...<br>  - Step 2.1 The traveler&#39;s $origin city. Do not proceed until...<br>  - Step 2.2 The traveler&#39;s $destination city...<br>  - Assume the user is an adult.</pre><p>This level of explicit sequencing dramatically reduces hallucinations and off-track behavior.</p><p><strong>Pro Tip:</strong> The quality and quantity of your <strong>examples</strong> usually matter more than hyper-polished instructions. Google explicitly states that if a playbook behaves unpredictably, the first thing to improve is your examples.</p><h3>Routine vs Task Playbooks: Choosing the Right Pattern</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcAJ2TFnpYhk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FcAJ2TFnpYhk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcAJ2TFnpYhk%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/81d805bc92b8057cab2eb40bede1c5f9/href">https://medium.com/media/81d805bc92b8057cab2eb40bede1c5f9/href</a></iframe><p>Dialogflow CX now offers two playbook types — understanding the difference is crucial for production performance:</p><p><a href="https://youtube.com/shorts/cAJ2TFnpYhk">https://youtube.com/shorts/cAJ2TFnpYhk</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEUk8xShwjWANVjy-OyQJg.png" /></figure><p><strong>My recommendation:</strong> Start with <strong>Routine playbooks</strong> for most new agents. They offer better latency and cleaner session state handling. Use Task playbooks when you need heavy reusable sub-task composition.</p><h3>A Practical Example: Shirt Store Agent (from Google’s Quickstart)</h3><p>Google’s own quickstart demonstrates a clean three-playbook architecture:</p><ol><li><strong>Default Playbook</strong> — Greets the user and routes to the right specialist.</li><li><strong>Information Playbook</strong> — Answers store hours and location.</li><li><strong>Order Playbook</strong> — Guides the customer through size/color selection and confirmation.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihX9pbayshf6SDP3_AjZpw.png" /></figure><p>The Default playbook’s instructions contain clean routing logic:</p><pre>- If the customer wants information about the store, route them to ${PLAYBOOK: Information}.<br>- If the customer wants to purchase a shirt, route them to ${PLAYBOOK: Order}.</pre><p>This is the power of playbooks: clean separation of concerns with natural language orchestration.</p><h3>Best Practices I’ve Learned Building Production Agents</h3><ol><li><strong>Naming matters</strong> — Use clear, descriptive English names (e.g., “Customer Help Center” not “company_specialist”).</li><li><strong>Prioritize examples</strong> — Aim for at least 4 high-quality examples per playbook, including happy paths and tool usage.</li><li><strong>Prevent hallucinations on tool results</strong> — Explicitly instruct: “If you don’t get any data back from the tool, respond that you don’t know the answer.”</li><li><strong>Keep responses concise</strong> — Instruct the model to be brief. Output length has a massive impact on latency.</li><li><strong>Avoid giant monolithic playbooks</strong> — Break complex domains into focused, single-responsibility playbooks.</li><li><strong>Watch for routing loops</strong> — Never route back to an ancestor playbook.</li><li><strong>Hybrid is powerful</strong> — Use playbooks for flexible, open-ended parts of the conversation and traditional flows for high-stakes deterministic paths (payments, compliance, order confirmation).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*gwNe800bZOqHswvXaUj_TQ.png" /></figure><h3>The Road Ahead: Consolidation &amp; The Future of Agent Design</h3><p>Google is actively consolidating generative playbook features with traditional flows into a single, unified console experience. This is excellent news — it means we’ll soon have the best of both worlds: the reliability and control of flows <em>and</em> the natural flexibility of playbooks in one place.</p><h3>Getting Started Today</h3><ol><li>Go to the <strong>Conversational Agents</strong> console.</li><li>Create a new agent and choose <strong>Playbook</strong> as the conversation start option.</li><li>Create your first Routine playbook.</li><li>Write a clear goal + 3–4 strong examples.</li><li>Test extensively in the simulator and save good conversations as examples.</li></ol><p>Playbooks aren’t just a new feature — they represent a fundamental shift in how we architect conversational experiences. They reward clear thinking, good prompt engineering, and modular design.</p><p>If you’re building customer support, internal tools, or industry-specific agents, mastering playbooks will give you a significant edge in both development speed and user experience quality.</p><p><strong>What’s your experience with Playbooks so far?</strong> Have you tried Routine vs Task patterns, or built any interesting multi-playbook orchestrations? I’d love to hear your stories and answer questions in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c3d89b2dd77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/playbooks-in-dialogflow-cx-the-building-blocks-of-truly-intelligent-generative-agents-3c3d89b2dd77">Playbooks in Dialogflow CX: The Building Blocks of Truly Intelligent Generative Agents</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Variables and State Management in AI Agents :CX Agent Studio]]></title>
            <link>https://medium.com/google-cloud/mastering-variables-and-state-management-in-ai-agents-cx-agent-studio-2c48ec4edadc?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c48ec4edadc</guid>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[sessions]]></category>
            <category><![CDATA[gecx]]></category>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[state]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Tue, 26 May 2026 04:51:22 GMT</pubDate>
            <atom:updated>2026-05-26T04:51:22.535Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Developer in Conversational AI, I’ve architected and reviewed dozens of production agents. One pattern separates reliable, maintainable agents from those that eventually become brittle and expensive to debug: disciplined variable and state management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkHMRom6X4FzV6NtF7CiJA.png" /></figure><p>Most developers coming from simpler chatbot platforms treat variables like template placeholders. In modern agent platforms like CX Agent Studio, that mental model is not just incomplete — it’s actively harmful.</p><p>The Core Truth About Variables</p><p>In CX Agent Studio, variables come in two flavors:</p><ul><li>Static variables (`{{variable_name}}`): Compiled directly into the prompt before the model call. Ideal for configuration, business rules, and large unchanging context.<br>- Dynamic variables (`{variable_name}`): Not directly substituted** into the prompt. When a tool or callback updates them, the platform appends structured `&lt;state_update&gt;var_name: value&lt;/state_update&gt;` events to the conversation history.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-WXDJVNYwSl06xigzHu0w.png" /></figure><p>This is the part many teams miss. The model doesn’t magically see the current value of a dynamic variable sitting in a magic slot. It has to find the most recent state update in the history. This design gives you powerful observability and control, but it also creates new responsibilities.</p><p>If you create dozens of flat dynamic variables, you pollute the history with noisy state events, increase the chance of context trimming in long sessions, and make it harder for the model to maintain coherent reasoning. This is what we call variable explosion leading to context rot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6TUgs49ft2Ya3thEz1-xjA.png" /></figure><h3>Observability Variables: Your Diagnostic Windows</h3><p>Treat certain variables as internal lenses, not business logic.</p><p>Best practices:<br>- Use a clear naming convention (many teams prefix with `_` or use a dedicated namespace like `debug_*`).<br>- Store intermediate reasoning, routing decisions, or confidence scores.<br>- Keep them separate from core domain state so you can inspect “what the agent was thinking” without cluttering the main context.</p><p>These variables become invaluable during evaluation and root-cause analysis.</p><h3>State Management Guidelines That Actually Scale</h3><p>Here’s how to think about state in production agents:</p><p>Semantic naming matters. <br>Give variables names the model can reason about (`user_onboarding_stage`, `claim_validation_status`, `escalation_reason`). Vague names like `var_3` or `data` force the model to do extra work.</p><p>Use state variables for the right jobs:<br>- Collecting and updating user information<br>- Driving routing and state transitions<br>- Remembering checkpoints in long-running flows<br>- Controlling which instructions or tools are active</p><p>Kill variable explosion with JSON schemas. <br>Instead of 15–20 individual variables for a complex flow, consolidate related data into Custom Object variables backed by a clear schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g1V3--qlkS839m-8s2xF5g.png" /></figure><p>This single change dramatically reduces history noise. One structured state update is far cleaner than fifteen separate ones.</p><p>Feature encapsulation <br>Group variables that belong to the same logical feature or bounded context into one object. Examples:<br>- `user_profile` (demographics, preferences, verification status)<br>- `current_ticket` (issue_type, priority, resolution_stage, related_entities)<br>- `conversation_control` (current_phase, pending_actions, retry_count)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-RL4pYpdfbd-xFT4HTiQw.png" /></figure><p>This makes your agent’s mental model explicit and easier to maintain.</p><p>Deterministic steering<br>Use state as the primary signal for tool selection and callback triggers. When your state object clearly reflects “where we are,” you can write much more reliable instructions and leverage `before_model_callback` / `after_model_callback` for deterministic behavior.</p><p>Dynamic prompting <br>State variables are the foundation for advanced dynamic prompting. Update a `current_instruction_set` variable (or similar) via a callback, then reference it to swap tone, rules, or available tools mid-conversation without rebuilding the entire agent.</p><p>Instruction density <br>Every variable you introduce increases cognitive load. ruthlessly eliminate “ghost” variables that seemed useful during development but no longer influence decisions. Fewer, higher-signal variables almost always produce better results.</p><h3>Practical Pattern: Structured State Over Flat Variables</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4DN9NSRe5g4Wc8yMA42WA.png" /></figure><p>Before (variable explosion):</p><pre>user_name, user_email, user_phone, ticket_id, issue_category, issue_subcategory, <br>priority_level, resolution_stage, last_tool_used, escalation_flag, …</pre><p>After (encapsulated):<br>One `ticket_state` Custom Object variable with a proper schema containing nested objects for `customer`, `issue`, and `workflow`.</p><p>Your history now contains clean, meaningful updates instead of a flood of individual state events. The model can parse the structure more reliably, and your Python tools can update nested fields cleanly using `context.state`.</p><p><strong>Practical variable limits</strong> <strong>At maximum, aim to create around 100 variables</strong> (especially dynamic ones). Going significantly beyond this threshold makes the agent harder to reason about, bloats conversation history, and increases the risk of context trimming in long sessions. Treat 100 as a soft ceiling for maintainability.</p><h3>Pro Tips from Building Production Agents</h3><ul><li>Combine structured state with callbacks for true deterministic behavior (greetings, mandatory content, post-processing).</li><li>Be mindful of long sessions — dynamic variables live in history and can disappear if the context window is trimmed.</li><li>Version your agent frequently after major changes to state or instructions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6a4IXEM80KBJo3hKD2Fm1g.png" /></figure><p><strong>Use mocked tool responses during development and evaluation</strong> For faster iteration and dramatically lower cost, leverage CX Agent Studio’s built-in <strong>Tool Fake</strong> capability in the Simulator and Evaluation framework.</p><p>Instead of calling real production APIs during development and automated test runs, define expected tool calls and provide mock responses. The platform intercepts matching tool calls and returns your predefined data. This approach:</p><ul><li>Speeds up evaluation cycles significantly</li><li>Eliminates unnecessary API costs during testing</li><li>Allows you to validate complex tool orchestration and state transitions safely</li><li>Makes golden tests and scenario-based evaluations much more reliable and repeatable</li></ul><p>Variables are not just storage — they are the nervous system of your agent. Treat them with the same rigor you apply to prompt design and tool definitions.</p><p>By moving from dozens of flat variables to well-designed JSON-backed state objects, you reduce context rot, improve observability, enable cleaner dynamic prompting, and build agents that remain maintainable as complexity grows.</p><p>This is one of the highest-leverage improvements you can make when moving from prototype to production in CX Agent Studio or similar agent frameworks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c48ec4edadc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/mastering-variables-and-state-management-in-ai-agents-cx-agent-studio-2c48ec4edadc">Mastering Variables and State Management in AI Agents :CX Agent Studio</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CX Agent Studio Tool Design Best Practices That Make Agents Actually Do Things Reliably]]></title>
            <link>https://medium.com/google-cloud/cx-agent-studio-tool-design-best-practices-that-make-agents-actually-do-things-reliably-f51a4486288b?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f51a4486288b</guid>
            <category><![CDATA[gecx]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[llm-powered-agent-tools]]></category>
            <category><![CDATA[calling-tool]]></category>
            <category><![CDATA[functioncall]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Sun, 24 May 2026 07:33:51 GMT</pubDate>
            <atom:updated>2026-05-24T07:33:51.362Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>From bad vague tools to production-grade wrappers</strong></p><p>CX Agent Studio Tool Design Best Practices That Make Agents Actually Do Things Reliably</p><p>From bad vague tools to production-grade wrappers</p><p>If your CX Agent Studio agent knows what to do but still fails to execute reliably, the culprit is almost always poor tool design.</p><p>I’ve seen this across production deployments: beautifully written instructions, thoughtful sub-agent hierarchies, and strong evaluations — yet the agent hallucinates parameters, picks the wrong tool, or returns bloated unusable data. The model isn’t the problem. The tools are.</p><p>Tool design is the hidden foundation of reliable agents. In CX Agent Studio (built on patterns from Google’s Agent Development Kit), tools are how your agent actually does things. Get them wrong and everything downstream suffers.</p><p>Here are the battle-tested best practices that separate flaky demos from production-grade agents.</p><h3>1. Tool Docstrings Are as Important as Your Instructions</h3><p>In CX Agent Studio’s Python tools (and many other tool types), the docstring becomes the primary description the model sees when deciding whether and how to call the tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0364wwBTGrY2Rth0LK-rMw.png" /></figure><p>This is not optional documentation. It is part of the agent’s reasoning context.</p><p>Weak docstring example:</p><pre>def book_slot(date: str, time: str):<br> &quot;&quot;&quot;Books a slot.&quot;&quot;&quot;</pre><ul><li>Strong docstring example:</li></ul><pre>def book_appointment_slot(preferred_date: str, preferred_time: str, service_type: str = &quot;general&quot;) -&gt; dict:<br> &quot;&quot;&quot;Books an appointment slot for the user.<br> <br> Use this tool when the user wants to schedule, reschedule, or confirm <br> an appointment. Accepts natural language date/time expressions <br> (e.g., “tomorrow afternoon”, “next Tuesday at 3pm”).<br> <br> Returns a dict with:<br> — status: “success” | “error” | “pending”<br> — confirmation_id: str (when successful)<br> — slot_details: dict with date, time, location<br> — message: human-readable confirmation or error<br> <br> Always confirm details with the user before calling if any field <br> is ambiguous.<br>&quot;&quot;&quot;<br>return None<br> </pre><p>Rule of thumb: Write the docstring as if you’re briefing a very capable but literal junior colleague who has never seen your system before.</p><h3>2. Good Tool vs Bad Tool — Side by Side</h3><p>Bad tool pattern:<br>- Name: `process_request`<br>- Description: “Handles various user requests and processes data.”<br>- Parameters: Generic `input_data: dict`<br>- Returns: Raw API response with 40+ fields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzTrNBmRDT2KcqvMx3cZJw.png" /></figure><p>Problems: Ambiguous name, vague description, forces the model to guess intent and structure. High chance of wrong usage and bloated context.</p><p>Good tool pattern:<br>- Name: `reschedule_appointment`<br>- Description: Clear purpose, when to use, input expectations, output contract<br>- Parameters: Flattened, descriptive names (`appointment_id`, `new_date`, `new_time_window`)<br>- Returns: Clean, minimal dict with `status`, `confirmation_id`, and only the fields the agent needs</p><p>The difference in reliability is dramatic.</p><h3>Common Pitfalls That Kill Reliability</h3><p>Watch out for these recurring issues:</p><ol><li>Ambiguous naming &amp; high cardinality <br>Similar tool names (`update_record`, `modify_entry`, `change_data`) confuse the model’s tool router. Keep names semantically distinct and task-specific.</li></ol><p>2. Tool explosion <br>Having 20–30+ tools is a red flag. The model struggles to choose correctly. Fewer, more powerful tools win.</p><p>3. Instructing sequential tool calls in prompts <br> Telling the agent “first call check_availability, then call book_slot, then send_confirmation” is unreliable. The model can hallucinate the sequence or parameters. This is explicitly called out as a bad pattern in the official CX Agent Studio best practices.</p><p>4. Return value bloat <br>Returning entire API responses (or deeply nested objects) overwhelms the context window and increases hallucination risk. The model starts reasoning over irrelevant fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CU3N7tN1MjYfbxEEBuyc0Q.png" /></figure><p>4. The Tool Wrapper Pattern (The Highest-ROI Fix)</p><p>This is the single most effective pattern I recommend.</p><p>Instead of exposing many granular tools and hoping the agent chains them correctly, create **Python wrapper tools** that encapsulate the orchestration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a01N70Y4uBqRXS-VF0NyOg.png" /></figure><p>Official guidance strongly recommends this:</p><p>&gt; It is a best practice to use Python tools to wrap API calls. Wrapping lets you obfuscate unnecessary data from the agent and the context history.</p><p>Example wrapper pattern:</p><pre>def manage_appointment_flow(action: str, details: dict) -&gt; dict:<br>    &quot;&quot;&quot;<br>    High-level tool to handle appointment management flows.<br>    Internally orchestrates availability check → booking/rescheduling → confirmation.<br>    Use this for any appointment-related request instead of calling individual tools.<br>    &quot;&quot;&quot;<br>    if action == &quot;reschedule&quot;:<br>        availability = check_availability(details)<br>        if availability[&quot;available&quot;]:<br>            result = tools.book_slot(details)<br>            notify_user(result)<br>            return {&quot;status&quot;: &quot;success&quot;, &quot;confirmation_id&quot;: result[&quot;id&quot;], ...}<br>    </pre><p>Benefits:<br>- Dramatically reduces non-determinism<br>- Lets you control exactly what the agent sees<br>- Enables proper error handling and business logic in one place<br>- Makes evaluation and golden tests much easier</p><p>You can also use `after_tool_callback` for additional orchestration when needed.</p><h3>5. Design Inputs That Work in Voice Mode</h3><p>CX Agent Studio supports multimodal and voice agents. This changes how you should think about tool inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCcE3RqV8uY4_8dAVU2ELQ.png" /></figure><p>Users don’t speak JSON or internal IDs. They say things like:<br>- “Move my appointment to sometime next week”<br>- “Book the earliest slot available with Dr. Sharma”</p><p>Design principles for voice-friendly tools:<br>- Accept natural language date/time expressions (parse inside the tool or via upstream components)<br>- Use descriptive parameter names that map to spoken concepts<br>- Prefer flattened parameters over deeply nested objects<br>- Make critical fields optional with smart defaults when safe<br>- Let the tool or a preceding NLU step resolve entities rather than forcing the model to guess exact formats</p><p>Voice exposes weak tool design faster than text ever will.</p><h3>6. Structured Outputs &amp; Predictable Contracts</h3><p>Reliable agents need predictable data flowing between tools and the model.</p><p>Best practices:<br>- Python tools should return clean `dict` objects with consistent top-level keys (`status`, `data`, `message`, `error_code`)<br>- Document the exact return shape in the docstring<br>- When possible, flatten responses — avoid forcing the model to navigate complex nested structures<br>- For OpenAPI tools, consider using `x-ces-session-context` for context variables instead of making the model pass session IDs</p><p>In the broader Agent Development Kit ecosystem, structured output schemas (via Pydantic or JSON Schema) are increasingly used on agents and formatters. Apply the same discipline to your tool return values.</p><p>Production Story: From 65% to 94% Tool Success</p><p>One team I worked with had built a sophisticated CX agent for a large service provider handling appointment booking, rescheduling, and technician dispatch.</p><p>They started with 18 individual OpenAPI tools + direct instructions to chain them. Tool selection accuracy was poor. Complex flows frequently failed. Latency was high because of multiple back-and-forth tool calls.</p><p>What we changed:<br>1. Consolidated into 5 high-level Python wrapper tools (e.g., `manage_appointment`, `handle_technician_dispatch`, `update_billing_preference`)<br>2. Each wrapper handled sequencing, data transformation, and only returned minimal relevant fields<br>3. Rewrote docstrings with precise usage guidance and return contracts<br>4. Updated root agent instructions to prefer the wrapper tools</p><p>Results:<br>- Tool-related failures dropped significantly<br>- Average turns to complete complex flows decreased<br>- Golden test pass rate improved dramatically<br>- The agent became much more reliable in both text and voice channels</p><p>The biggest unlock wasn’t a better model or more instructions — it was treating tools as first-class, carefully designed production components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaXN2JF5GE-7dvD-5UPfmA.png" /></figure><p>Quick Best Practices Checklist</p><p>- Write excellent docstrings (they are the tool description)<br>- Use clear, distinct, snake_case names<br>- Prefer Python wrapper tools over exposing raw APIs<br>- Never instruct the agent to chain multiple tools in one turn — wrap instead<br>- Return minimal, structured data only<br>- Design parameters for natural voice input<br>- Flatten structures wherever possible<br>- Remove unused tools regularly<br>- Test tools both in isolation and inside full agent flows<br>- Use CX Agent Studio evaluations and golden tests to measure tool reliability</p><h3>Final Thoughts</h3><p>In CX Agent Studio, tools are where the agent meets reality. Beautiful instructions can’t save poorly designed tools.</p><p>The teams that treat tool design with the same rigor as prompt engineering and evaluation design are the ones shipping agents that actually get work done reliably — especially in voice and complex multi-step scenarios.</p><p>Start with one high-impact flow in your agent. Identify the granular tools. Wrap them. Write excellent docstrings. Measure the difference.</p><p>You’ll be surprised how much reliability you can unlock without touching the model or the core instructions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f51a4486288b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/cx-agent-studio-tool-design-best-practices-that-make-agents-actually-do-things-reliably-f51a4486288b">CX Agent Studio Tool Design Best Practices That Make Agents Actually Do Things Reliably</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Sub-Agent Orchestration and Hierarchical Design in CX Agent Studio]]></title>
            <link>https://medium.com/google-cloud/mastering-sub-agent-orchestration-and-hierarchical-design-in-cx-agent-studio-143796163877?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/143796163877</guid>
            <category><![CDATA[sub-agents]]></category>
            <category><![CDATA[gemini-agent-platform]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Sat, 23 May 2026 09:42:38 GMT</pubDate>
            <atom:updated>2026-05-23T09:42:38.127Z</atom:updated>
            <content:encoded><![CDATA[<p>CX Agent Studio represents a fundamental shift from the monolithic flow-based paradigm of traditional Dialogflow CX to a true multi-agent system built on hierarchical orchestration. Instead of one giant agent trying to do everything, we now design systems where a root agent (the orchestrator) intelligently delegates to specialized sub-agents.</p><p>This is where complexity stops being a liability and becomes a manageable, modular asset.</p><h3>Why Sub-Agents? The Case for Hierarchy</h3><p>Monolithic agents eventually collapse under their own weight. As capabilities grow, prompts become bloated, testing becomes impossible, and every small change risks breaking unrelated flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-D2EF8uNm4oEVTqIdAtFw.png" /></figure><p>Sub-agents solve this through:</p><p>- Modularity— Each agent owns a clear domain.<br>- Specialization — Narrow, deep expertise beats shallow generalists.<br>- Reusability — The same Returns sub-agent can serve multiple root agents or channels.<br>- Maintainability &amp; Testing — You can evolve, test, and version one specialist without touching the rest of the system.<br>- Team Scalability — Different domain experts can own different sub-agents.</p><p>This mirrors how real organizations work: you don’t ask one person to be the entire support, sales, and logistics team.</p><h3>Designing Hierarchies: Root as Orchestrator</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQbda9izlT-gdVdNDu8Gxw.png" /></figure><p>In CX Agent Studio, every agent application has one root agent (also called the steering agent) and zero or more sub-agents (child agents). The root agent is the primary entry point. Its job is not to answer everything — it’s to understand intent and delegate effectively.</p><p>Typical hierarchy for a retail support agent:</p><ul><li>Root Agent (Steering)<br> — Order Management Sub-Agent<br> — Returns &amp; Refunds Sub-Agent<br> — Product Information Sub-Agent<br> — Escalation / Human Handoff Sub-Agent<br> — (Optional) Proactive/Notification Sub-Agent</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hg7mqClf1baQuFTdMH6Zcg.png" /></figure><p>The root agent’s description and instructions are critical. They tell the model which sub-agents exist and when to use them.</p><h3>Visual Builder for Orchestration</h3><p>One of the most delightful aspects of CX Agent Studio is the visual canvas. You can:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQKMMMq9SfODRo8IcKk8iA.png" /></figure><p>- See the entire hierarchy at a glance<br>- Add sub-agents with a single click on the `+` under any agent node<br>- Visually understand the delegation structure<br>- Reorder and reorganize without digging through pages of flows</p><p>This visual-first approach dramatically improves cognitive load compared to traditional intent/flow builders.</p><h3>Best Practices for Effective Orchestration</h3><p>1. Clear Responsibilities &amp; Minimal Overlap <br>Every sub-agent should have a crisp, non-overlapping mandate. If two sub-agents could reasonably handle the same query, the root agent will get confused.</p><p>2. Strong Delegation Logic in the Root<br>Write explicit instructions in the root agent:</p><pre>You are the root orchestrator for customer support.<br>Available specialized sub-agents:<br>- {@AGENT: Order Management Agent} - Handles order status, modifications, tracking<br>- {@AGENT: Returns Agent} - Handles returns, refunds, and exchanges<br>- {@AGENT: Product Info Agent} - Answers questions about products, specs, availability<br>Analyze the user&#39;s intent. Delegate to the most appropriate sub-agent using the exact syntax {@AGENT: Agent Name}.<br>If the query doesn&#39;t clearly match any sub-agent, handle it yourself or ask clarifying questions.</pre><p>3. Global vs Agent-Specific Instructions<br>Use global instructions for brand voice, core principles, and shared context. Use agent-specific instructions for deep domain logic and tool usage.</p><p>4. Leverage Handoff Rules for Deterministic Control <br>While instructions are powerful, they are probabilistic. For critical routing decisions, use Handoff Rules (available under each agent node).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hkLVMH2Pnn40Sax0pnxIXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MnlLtUnNmZEiwlIl-OScg.png" /></figure><p>Handoff rules let you define deterministic conditions based on session variables (text, number, boolean) or Python callbacks. Perfect for:<br>- Routing authenticated vs unauthenticated users<br>- High-stakes actions (financial, PII)<br>- Retry logic and backward handoffs from sub-agent to root</p><h3>Advanced Patterns</h3><ul><li>Chaining: Sub-agents can themselves delegate to other sub-agents (creating deeper hierarchies when needed).<br>- Conditional Routing: Combine strong root instructions + handoff rules.<br>- Fallback &amp; Escalation Agents: Create dedicated sub-agents for out-of-scope queries or human escalation. This keeps the root clean.<br>- Specialized Context: Each sub-agent can have its own tools, variables, and model overrides.</li></ul><h3>Nuances &amp; Challenges (The Real Talk)</h3><p>No architecture is free. Be aware of these realities:</p><ul><li>Latency from Multiple Hops: Every delegation adds an LLM call. Keep hierarchies reasonably shallow for latency-sensitive flows.<br>- Context Passing: Use session variables and global variables deliberately. Don’t assume full conversation history automatically flows perfectly between every level.<br>- Debugging Complexity: Rich tracing and the built-in simulator become essential. Learn to read delegation traces.<br>- Agent Sprawl: It’s easy to create too many tiny sub-agents. Start with 3–5 strong specialists. Only add more when clear value emerges.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3HWM9bi30ICCP3CEyPl5Q.png" /></figure><h3>Real-World Examples</h3><p>Retail Support Agent (most common starting point)<br>Root handles greeting, small talk, and high-level routing. Sub-agents own orders, returns, product catalog, and escalation. This pattern dramatically improves containment rates while keeping each agent focused.</p><p>Real Estate Inquiry Handler<br>- Root: Understands intent and qualifies the lead<br>- Sub-agents: Property Search, Viewing Scheduler, Mortgage/Financing Info, Neighborhood Insights, and Follow-up Nurture</p><p>The visual hierarchy makes it obvious who owns what.</p><h3>Evaluation Implications</h3><p>CX Agent Studio’s evaluation capabilities shine here. You should:</p><p>- Test individual sub-agents in relative isolation (invoke them directly when possible)<br>- Run end-to-end scenario evaluations through the root agent<br>- Use the built-in evaluation framework with scenario tests and AI-assisted analysis<br>- Measure both functional correctness and delegation quality (did the right agent get invoked?)</p><p>Good evaluation strategy catches routing issues before they reach production.</p><h3>Organizational Implications</h3><p>This architecture changes how teams work.</p><p>Instead of one person (or small team) owning an entire monolithic agent, you can now have:</p><p>- Domain specialists owning individual sub-agents<br>- Orchestration/platform team owning the root agent, shared tools, variables, and handoff rules<br>- Clearer ownership boundaries and faster iteration cycles</p><p>This is how mature conversational AI teams will organize in 2026 and beyond.</p><h3>Final Thoughts</h3><p>Sub-agent orchestration in CX Agent Studio isn’t just a feature — it’s the core paradigm for building production-grade conversational experiences at scale.</p><p>The visual builder lowers the barrier, the instruction system + handoff rules give you both flexibility and control, and the evaluation tooling helps you maintain quality as complexity grows.</p><p>Master this pattern, and you move from building chatbots to architecting intelligent agent systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Y9k0bfnYb_ijmWOq7nr5g.png" /></figure><p>Written from the perspective of a Developerin Conversational AI who has moved from building 5+ production Dialogflow CX agents to architecting the next generation of systems in CX Agent Studio.*</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=143796163877" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/mastering-sub-agent-orchestration-and-hierarchical-design-in-cx-agent-studio-143796163877">Mastering Sub-Agent Orchestration and Hierarchical Design in CX Agent Studio</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Structuring Agent Instructions with XML for Dramatically Better LLM Performance]]></title>
            <link>https://medium.com/google-cloud/structuring-agent-instructions-with-xml-for-dramatically-better-llm-performance-8582c472c21b?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8582c472c21b</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[gemini-agent-platform]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Fri, 22 May 2026 06:27:06 GMT</pubDate>
            <atom:updated>2026-05-22T06:27:06.390Z</atom:updated>
            <content:encoded><![CDATA[<p>Structuring Agent Instructions with XML for Dramatically Better LLM Performance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yt5iDMMdoh2NRaAesZTErw.png" /></figure><p>How Google’s GECX team uses XML tags to make agents follow complex instructions reliably</p><p>As a Developer focused on AI, conversational agents, and Google Cloud’s generative AI stack, I’ve helped numerous enterprises move from brittle, hallucination-prone agents to reliable, production-grade systems. One of the highest-leverage techniques I’ve seen — and one that Google’s own Gemini Enterprise CX (GECX) teams champion — is structuring agent instructions with XML.</p><p>In CX Agent Studio, the “Restructure instructions” feature (powered by Gemini) can take your free-form natural language and transform it into a clean, hierarchical XML format. The results? Dramatically better instruction following, fewer hallucinations, more consistent behavior across complex multi-turn flows, and easier maintenance when you have root agents + specialized sub-agents.</p><p>In this post, I’ll break down exactly why this works, share the official recommended tag set, show real before/after examples (including a full Troubleshooting Support Specialist role), and give you a practical exercise you can run today in the simulator.</p><h3>Why Natural Language Alone Often Fails</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CS6irXUe7IZ7kZwJ0yVnwA.png" /></figure><p>Large language models are incredibly capable, but they are still probabilistic parsers. When you hand them a long wall of text with mixed goals, constraints, step-by-step flows, persona rules, and tool-calling logic, several things commonly go wrong:</p><p>- Ambiguity and missed priorities— The model may emphasize the wrong part of the instructions.<br>- Inconsistent step ordering — Especially in troubleshooting or multi-step processes.<br>- Poor handling of edge cases — Constraints get forgotten under pressure.<br>- Sub-agent routing confusion — Root agents struggle to decide when to delegate.<br>- Context drift over long conversations— Later turns ignore earlier rules.</p><p>I’ve seen agents that worked 70% of the time in testing collapse to ~40% in production because a single ambiguous paragraph caused cascading failures.</p><p>Structured XML changes the game by giving the model an explicit schema it can reliably parse.</p><p>The Power of XML Structure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPMr1VopHH4Z4vqr955zEg.png" /></figure><p>XML tags create clear boundaries and hierarchy. Instead of the model trying to infer structure from prose, you explicitly declare:</p><ul><li>What the agent is (`&lt;role&gt;`)<br>- How it should behave and its core objective (`&lt;persona&gt;` + `&lt;primary_goal&gt;`)<br>- Hard rules it must never break (`&lt;constraints&gt;`)<br>- The logical conversation flow broken into subtasks and steps (`&lt;taskflow&gt;`)<br>- Triggers and precise actions (`&lt;trigger&gt;` + `&lt;action&gt;`)<br>- Few-shot examples for calibration (`&lt;examples&gt;`)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ku1pGe8CbBKJKbe9S7k3tA.png" /></figure><p>This mirrors how humans organize complex procedures (think SOPs with numbered sections and decision trees). Gemini (and other strong models) handles this format exceptionally well because it reduces cognitive load on the reasoning engine.</p><p>Recommended XML Tags from Google’s CX Agent Studio Guide</p><p>Here’s the official set of recommended tags (directly from the CX Agent Studio documentation):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*i4Xbh643AIGR0RhV8jGErg.png" /></figure><p>You can (and should) still use the special syntax for variables `{variable_name}`, tools `{<a href="http://twitter.com/TOOL">@TOOL</a>: tool_name}`, and sub-agents `{<a href="http://twitter.com/AGENT">@AGENT</a>: Agent Name}` inside these tags.</p><h3>Real Examples: Bad vs Good Role Definitions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KD6jFlrVWgI_VYGzxcipMA.png" /></figure><ul><li>Bad (Flat natural language):</li></ul><pre>You are a helpful troubleshooting support specialist. Be empathetic but efficient. <br>First understand the user&#39;s problem, then ask clarifying questions if needed. <br>Guide them through steps. Never promise things you can&#39;t deliver. Use tools when appropriate. <br>If it&#39;s hardware related escalate appropriately...</pre><p>This is vague, has no clear structure, and the model has to guess priority and sequencing.</p><p>Good (XML-structured — Troubleshooting Support Specialist):</p><pre>&lt;role&gt;<br>Troubleshooting Support Specialist for enterprise software and hardware issues<br>&lt;/role&gt;<br><br>&lt;persona&gt;<br>    &lt;primary_goal&gt;<br>    Help users quickly diagnose root causes and resolve technical issues with clear, <br>    step-by-step guidance while maintaining a calm, professional, and empathetic tone.<br>    &lt;/primary_goal&gt;<br>    <br>    You are patient, methodical, and data-driven. You always confirm understanding <br>    before moving to the next step. You celebrate small wins with the user.<br>&lt;/persona&gt;<br><br>&lt;constraints&gt;<br>    1. Never guess or fabricate technical details. If uncertain, use available tools <br>       or ask the user for more information.<br>    2. Always prioritize user safety and data security. Never instruct actions that <br>       could cause data loss or security risks without explicit confirmation.<br>    3. Escalate to human support only after exhausting self-service + tool-assisted <br>       troubleshooting paths (document the steps taken).<br>    4. Keep responses concise. Use numbered steps and bold key actions.<br>&lt;/constraints&gt;<br><br>&lt;taskflow&gt;<br>    &lt;subtask name=&quot;Issue Intake and Classification&quot;&gt;<br>        &lt;step name=&quot;Gather Initial Context&quot;&gt;<br>            &lt;trigger&gt;User describes a problem or error&lt;/trigger&gt;<br>            &lt;action&gt;<br>            Ask for: error messages, affected systems/versions, when it started, <br>            recent changes, and any screenshots or logs if available. <br>            Classify as software, hardware, network, or configuration issue.<br>            &lt;/action&gt;<br>        &lt;/step&gt;<br>    &lt;/subtask&gt;<br>    <br>    &lt;subtask name=&quot;Diagnostic Flow&quot;&gt;<br>        &lt;step name=&quot;Basic Checks&quot;&gt;<br>            &lt;trigger&gt;Initial context gathered&lt;/trigger&gt;<br>            &lt;action&gt;Guide user through standard first-line diagnostics <br>            (restart, check status pages, run built-in diagnostics). <br>            Use {@TOOL: run_diagnostics} when appropriate.&lt;/action&gt;<br>        &lt;/step&gt;<br>        &lt;!-- Additional steps for log analysis, reproduction steps, etc. --&gt;<br>    &lt;/subtask&gt;<br>&lt;/taskflow&gt;<br><br>&lt;examples&gt;<br>    &lt;!-- Add 1-2 strong few-shot examples here for tricky scenarios --&gt;<br>&lt;/examples&gt;</pre><p>The difference in reliability is night and day.</p><p>How XML Helps Parsing and Instruction Following in Gemini &amp; CX Agent Studio</p><p>Gemini models are excellent at following structured prompts. When instructions are wrapped in clear semantic tags:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8a2k2D2uM0vgF97VG7vwhw.png" /></figure><ul><li>The model can more reliably attend to the right section at the right time.<br>- Hierarchical flows (`taskflow` → `subtask` → `step`) reduce “lost in the middle” problems.<br>- Constraints become hard boundaries rather than suggestions.<br>- The built-in Restructure instructions button uses Gemini itself to convert your prose into this format automatically.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eo1I-fniUSH8eAOekTcvkg.png" /></figure><p>This is especially powerful in **multi-agent systems**. The root agent can have a high-level orchestration `taskflow`, while each sub-agent has its own tightly scoped `&lt;role&gt;`, `&lt;persona&gt;`, and specialized steps.</p><p>Practical Tips for CX Agent Studio</p><ol><li>Start with natural language, then restructure — Write freely first, then hit the Restructure instructions button.<br>2. Apply structure at every level— Use it for both the root agent (orchestration + routing) and every sub-agent (deep expertise).<br>3. Leverage Global Instructions for brand tone, compliance, and shared variables so you don’t repeat them everywhere.<br>4. Use `&lt;examples&gt;` strategically — Add them only when you see consistent failures on specific patterns (quality issues, formatting, nuanced logic). Don’t overdo it.<br>5. Combine with tools and callbacks — XML structure + well-wrapped Python tools + callbacks for deterministic behavior is an extremely strong pattern.<br>6. Iterate with Refine — Select sections and use the **Refine** button (Gemini-powered) to improve clarity.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jw3qEjnj3oJRa-Q5decRdw.png" /></figure><h3>Bonus: Let Gemini Help You Restructure and Refine</h3><p>CX Agent Studio has two powerful AI-assisted features right in the instructions panel:</p><p>- Restructure instructions → Converts natural language into the recommended XML format.<br>- Refine (on selected text) → Improves clarity, specificity, or structure based on your requirements.</p><p>This is meta-prompting at its best — you’re using Gemini to help you write better prompts for Gemini-powered agents.</p><p>Practical Exercise for You</p><p>Take one of your current agent instructions (ideally something non-trivial).</p><p>1. Paste it into a new or existing agent in CX Agent Studio.<br>2. Click Restructure instructions.<br>3. Review and lightly edit the generated XML (add missing constraints or steps).<br>4. Test the same set of scenarios in the built-in **simulator** before and after.<br>5. Measure: consistency, step adherence, hallucination rate, and user experience.</p><p>Most teams I work with see a noticeable jump in reliability on the very first structured version.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8582c472c21b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/structuring-agent-instructions-with-xml-for-dramatically-better-llm-performance-8582c472c21b">Structuring Agent Instructions with XML for Dramatically Better LLM Performance</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CX Agent Studio Architecture Deep Dive: Root Agents, Sub-Agents, Tools, and the Agentic Paradigm]]></title>
            <link>https://medium.com/google-cloud/cx-agent-studio-architecture-deep-dive-root-agents-sub-agents-tools-and-the-agentic-paradigm-1203ca2ddafe?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1203ca2ddafe</guid>
            <category><![CDATA[gemini-agent-platform]]></category>
            <category><![CDATA[gecx]]></category>
            <category><![CDATA[dialogflow-cx]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Thu, 21 May 2026 06:41:59 GMT</pubDate>
            <atom:updated>2026-05-21T06:41:59.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAru4o7NqzlsgU99F-VVBQ.png" /></figure><p>v</p><h3>Agentic vs. Intent/Flow Paradigm: The Fundamental Shift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoGWe974Es8HwCuvKqtNGA.png" /></figure><p>Dialogflow CX excels at structured, predictable experiences. You define intents, map them to flows, and control every transition with pages, conditions, and fulfillment. It’s deterministic, auditable, and great for compliance-heavy or highly scripted scenarios (think regulatory disclosures or step-by-step troubleshooting).</p><p>But as conversations grow complex — multiple domains, dynamic routing, tool use, personalization, and multi-turn reasoning — those graphs become a liability. Managing 100+ pages across interconnected flows turns into a maintenance nightmare. The mental model is “follow this flowchart.”</p><p><strong>CX Agent Studio flips the model.</strong> It’s built on Google’s Agent Development Kit (ADK) and powered by Gemini. Instead of rigid flows, you get <strong>LLM-native agents</strong> that:</p><ul><li>Reason about user goals</li><li>Delegate dynamically</li><li>Use tools</li><li>Maintain context across specialized components</li></ul><p>The question changes from “Which intent did the user trigger?” to “What does the user need, and which specialized agent or tool should handle it?”</p><p>This agentic paradigm shines in complex, ambiguous, or evolving scenarios. It trades some predictability for dramatically higher flexibility and lower long-term maintenance.</p><h3>Root Agent: The Orchestrator and Entry Point</h3><p>Every <strong>agent application</strong> in CX Agent Studio has exactly one <strong>root agent</strong> (also called the steering agent).</p><p>Think of the root agent as the CEO or air traffic controller:</p><ul><li>It’s the primary entry point for user conversations.</li><li>It handles initial greetings and high-level intent classification/routing.</li><li>It maintains the overall goal and conversation context.</li><li>It delegates specific tasks to the right sub-agents.</li><li>It synthesizes results and responds to the user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mL7V4CD3lEe-ckENJX-7ug.png" /></figure><p>The root agent doesn’t need to do everything itself. Its superpower is <strong>orchestration</strong>. With clear instructions and descriptions of available sub-agents, the LLM inside the root agent intelligently decides when and how to delegate.</p><p>You create the root agent automatically when you create a new agent application in the CX Agent Studio console.</p><h3>Sub-Agents: Specialization, Modularity, and Hierarchical Power</h3><p><strong>Sub-agents</strong> (child agents) are specialized agents designed for specific tasks, domains, or capabilities. Examples include:</p><ul><li>A “Returns &amp; Refunds” sub-agent</li><li>An “Order Tracking” sub-agent</li><li>A “Product Recommendation” sub-agent</li><li>A “Farewell” sub-agent for clean conversation closure</li></ul><p><strong>Why sub-agents matter</strong>:</p><ul><li><strong>Single Responsibility Principle</strong> — Each sub-agent owns one clear domain.</li><li><strong>Modularity &amp; Reusability</strong> — Build once, invoke from multiple parents.</li><li><strong>Hierarchical composition</strong> — Sub-agents can themselves have sub-agents, creating deep trees.</li><li><strong>Focused instructions &amp; tools</strong> — A specialist agent can have tighter prompts and only the tools it needs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OcdFYW_c0Gq6laRLFNx0uA.png" /></figure><p>Root agents invoke sub-agents (and sub-agents can invoke other sub-agents) primarily through well-crafted instructions using the special syntax {@AGENT: Sub Agent Name}. The LLM uses the sub-agent’s description + your routing instructions to decide delegation.</p><p>You add sub-agents visually in the agent builder by clicking the plus icon on a parent agent.</p><p>This hierarchical model is far more maintainable than flat, massive flow graphs.</p><h3>Tools: The Hands of Your Agents</h3><p>If agents are the brains, <strong>tools</strong> are the hands that connect to the real world.</p><p>CX Agent Studio supports a rich set of tools:</p><ul><li><strong>Pre-built</strong>: Data store tools, File search (RAG), Google Search grounding, System tools (e.g., end_session).</li><li><strong>Integration-focused</strong>: OpenAPI tools, Integration Connector tools, Salesforce, Service Now.</li><li><strong>Code &amp; Custom</strong>: Python code tools, Client function tools.</li><li><strong>Agent as a Tool</strong>: Reuse another agent’s capabilities <em>without</em> handing off the full conversation (great for focused capability reuse with sync or async execution).</li><li><strong>Widget tools</strong>: For rich interactive UI elements.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTK8qmSChhunpQa6bOqwLA.png" /></figure><p><strong>How agents use tools</strong>:</p><ol><li>Create the tool in the tool panel.</li><li>Attach it to specific agents.</li><li>Instruct the agent (using {@TOOL: tool_name} syntax) on <em>when</em> and <em>how</em> to use it.</li></ol><p>Tools support <strong>synchronous</strong> (blocking — agent waits for result) and <strong>asynchronous</strong> (non-blocking — agent can continue conversing while the tool works in the background, with pending/final response handling).</p><p>Global tool execution mode (parallel vs sequential) is configurable at the agent application level.</p><p><strong>Pro tip</strong>: Always give tools semantically rich names and high-quality descriptions — the LLM relies on them heavily for correct tool selection.</p><h3>Instructions &amp; Model Configuration: The Secret Sauce</h3><p>Instructions are where the magic (and most of the control) lives.</p><p><strong>Per-agent instructions</strong> define role, persona, goals, constraints, task flows, and routing logic. You can write in natural language and then use the <strong>Restructure instructions</strong> button to convert to a recommended XML-like structure (&lt;role&gt;, &lt;persona&gt;, &lt;constraints&gt;, &lt;taskflow&gt;, &lt;examples&gt;, etc.). This structured format often improves reliability.</p><p>Special syntax makes everything first-class:</p><ul><li>{@AGENT: Greeting Agent} for delegation</li><li>{@TOOL: get_order_status} for tool use</li><li>{variable_name} for context/variables</li></ul><p><strong>Global instructions</strong> (set at the agent application level) apply to <em>every</em> agent. Use them for shared personality, brand tone, DOs/DON’Ts, and common context. This is your primary lever for <strong>consistent personality</strong> across the hierarchy.</p><p><strong>Model configuration</strong>:</p><ul><li>Set a global default model for the entire application.</li><li>Override per agent (useful for using lighter/faster models on the root and heavier models on complex sub-agents or when using agents-as-tools).</li><li>Supported models include Gemini variants optimized for text or voice (e.g., gemini-2.5-flash, voice-optimized live models).</li></ul><p>Well-structured instructions + clear agent descriptions are the difference between flaky and reliable multi-agent systems.</p><h3>Supporting Components: Sessions, Tracing, and Observability</h3><p>CX Agent Studio provides first-class support for production needs:</p><ul><li><strong>Sessions</strong>: Manage conversation state and context.</li><li><strong>Global variables</strong>: Centralized state management (huge improvement over scattered flow variables).</li><li><strong>Tracing &amp; Evals</strong>: Inspect reasoning, tool calls, and delegation decisions. Use scenario-based testing (describe a goal → AI simulates) and golden tests for regression.</li><li><strong>Callbacks</strong>: Custom code hooks for advanced logic.</li><li><strong>Collaboration &amp; Versioning</strong>: Built-in support for team workflows.</li></ul><p>Observability is dramatically better than traditional flow debugging because you can see <em>why</em> the agent delegated or called a tool.</p><h3>Visual Orchestration in the UI</h3><p>One of the most delightful aspects of CX Agent Studio is the <strong>visual agent builder</strong>. You don’t just define hierarchies in code or docs — you see them.</p><p>The canvas-style interface lets you:</p><ul><li>Add sub-agents with a click</li><li>Visually arrange and understand the hierarchy</li><li>Move agents logically</li><li>Quickly grasp responsibilities at a glance</li></ul><p>This is a massive leap from managing tangled flow graphs in Dialogflow CX. It aligns the UI with how you <em>think</em> about the system: as a team of specialists reporting up to a coordinator.</p><h3>Nuances &amp; Edge Cases (Learn These the Hard Way)</h3><p>Even with great architecture, watch for these:</p><ul><li><strong>Over-delegation</strong>: Too many layers or too many sub-agents increases latency and can confuse routing. Keep hierarchies reasonably shallow.</li><li><strong>Consistent personality</strong>: Rely heavily on global instructions + shared persona guidelines.</li><li><strong>Tool failures &amp; async handling</strong>: Explicitly instruct agents on error handling, retries, pending states, and graceful fallbacks.</li><li><strong>State &amp; context</strong>: Use global variables and pass relevant context when delegating. Don’t assume sub-agents magically know everything.</li><li><strong>Agent-as-Tool vs Sub-Agent</strong>: Use sub-agents when you want full delegation with broader context. Use “Agent as a Tool” when you want to reuse capabilities synchronously or asynchronously without transferring conversational control.</li><li><strong>Rule of thumb</strong>: Use CX Agent Studio for most new complex or dynamic experiences. Keep or import Dialogflow flows for highly deterministic, compliance-critical paths if needed.</li></ul><h3>Design Principles for Mastery</h3><p>To build systems that scale:</p><ol><li><strong>Single Responsibility</strong> — One clear job per sub-agent.</li><li><strong>Clear Interfaces</strong> — Excellent descriptions + specific instructions for every agent and tool.</li><li><strong>Observability First</strong> — Design with tracing and evals in mind.</li><li><strong>Start Narrow, Expand</strong> — Begin with root + 2–3 focused sub-agents.</li><li><strong>Global Consistency</strong> — Use global instructions aggressively for tone and guardrails.</li><li><strong>Iterate with Evals</strong> — Scenario tests and golden tests are your friends.</li></ol><h3>Conclusion: Building the Future of Conversational AI</h3><p>CX Agent Studio’s architecture — root as orchestrator, specialized hierarchical sub-agents, rich tool ecosystem, and visual-first design — represents a genuine evolution in how we build production agentic systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1203ca2ddafe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/cx-agent-studio-architecture-deep-dive-root-agents-sub-agents-tools-and-the-agentic-paradigm-1203ca2ddafe">CX Agent Studio Architecture Deep Dive: Root Agents, Sub-Agents, Tools, and the Agentic Paradigm</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with CX Agent Studio: Setting Up and Building Your First Agent (Step-by-Step)]]></title>
            <link>https://medium.com/google-cloud/getting-started-with-cx-agent-studio-setting-up-and-building-your-first-agent-step-by-step-849d2a0aa5c5?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/849d2a0aa5c5</guid>
            <category><![CDATA[gemini-agent-platform]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[gecx]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Wed, 20 May 2026 03:09:25 GMT</pubDate>
            <atom:updated>2026-05-20T03:09:25.965Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Developer Google Cloud’s conversational AI and agent platforms, I’ve seen teams struggle for weeks (or months) with legacy intent-based builders. <strong>CX Agent Studio</strong> changes the game. It’s a low-code, AI-augmented platform (part of Gemini Enterprise for Customer Experience) built on the Agent Development Kit (ADK). You can go from zero to a working multimodal agent in minutes — not days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SOsIg3PP4P__-Dps9ghIQ.png" /></figure><p>This hands-on tutorial removes friction and gives you that early win. By the end, you’ll have a functional agent running in the simulator and the confidence to iterate fast.</p><h3>Prerequisites &amp; Access</h3><p>Before you build, you need a properly configured Google Cloud environment:</p><ol><li>A <strong>Google Cloud project</strong> with billing enabled.</li><li>The <strong>Gemini Enterprise for Customer Experience API</strong> enabled (ces.googleapis.com).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*v693493nsgDdnk39oaS97Q.png" /></figure><ol><li>Appropriate IAM permissions (Project Owner or equivalent for quickstarts; more granular roles for production).</li><li><strong>Steps:</strong></li></ol><ul><li>Go to the <a href="https://console.cloud.google.com/">Google Cloud Console</a> → create or select your project.</li><li>Enable billing if prompted.</li><li>Enable the API via the <a href="https://console.cloud.google.com/apis/enableflow?apiid=ces.googleapis.com">direct link</a> or search for it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5xuaGqrpSdT6RRGWBZJug.png" /></figure><ul><li>(Optional but recommended) Enable Data Access audit logs for the API.</li></ul><p><strong>Accessing CX Agent Studio:</strong> Open your browser and navigate to <a href="https://ces.cloud.google.com/"><strong>ces.cloud.google.com</strong></a> You’ll be prompted to select your Google Cloud project. This is your new home for building agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6H-y_ZFq44ZWx-gG-vtqg.png" /></figure><p><strong>Pro Tip:</strong> Bookmark it. The console experience is clean, modern, and significantly faster than older Dialogflow CX flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYoXJ5zA6pjLb0JodGUVpA.png" /></figure><h3>Creating Your First Agent Application &amp; Root Agent</h3><p>Let’s build a <strong>Helpful Weather Information Assistant</strong>.</p><ol><li>In the CX Agent Studio console, click <strong>Create agent</strong> (or <strong>New agent</strong>).</li></ol><p>Name it something clear like weather-assistant or Helpful Weather Bot.</p><ol><li>Click <strong>Create your first AI Agent or start from an agent template</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_ZUqbUj07kNdPut6B93pw.png" /></figure><h3>Exploring the Agent Builder Interface</h3><p>The interface is thoughtfully designed for both developers and non-technical users:</p><ul><li><strong>Central Canvas</strong> — Visual representation of your agent hierarchy (root + sub-agents). Drag-and-drop style orchestration.</li><li><strong>Agent Title Bars</strong> — Click any agent to open its settings panel (name, description, instructions, model, callbacks, etc.).</li><li><strong>Right Dock</strong> — Quick access to <strong>Tools</strong>, <strong>Variables</strong>, <strong>Guardrails</strong>, <strong>Versions</strong>, and <strong>Agent Settings</strong>.</li><li><strong>Instructions Editor</strong> — Where you define behavior (supports special syntax like {@AGENT: Weather agent} and {@TOOL: get_weather}).</li><li><strong>Bottom-Left Simulator</strong> — The <strong>Preview agent</strong> pane (expandable). This is your primary testing ground.</li><li><strong>+ Buttons</strong> — Add sub-agents, tools, instructions, or callbacks directly from an agent’s title bar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPDOB4w6LRJ3ALO5XZYXUg.png" /></figure><p>This visual + structured approach makes complex multi-agent systems intuitive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxtjDq0r-TCSDzplhbi4Gg.png" /></figure><h3>Using AI to Bootstrap (“Start with AI”)</h3><p>One of the most powerful features is <strong>Start with AI</strong> (powered by Gemini). Instead of writing everything from scratch:</p><ol><li>Create a new/empty agent (or use your freshly created root agent).</li><li>Click the <strong>Start with AI</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*Vqb5H-dXqtI_IDsqX7jCFQ.png" /></figure><ol><li>Provide a <strong>clear 1–2 sentence goal</strong>. Example: <em>“You are a helpful weather information assistant that greets users warmly, answers questions about current weather in major cities, and uses tools when needed to fetch accurate data.”</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukPAdD0oRegRZmce3pZBHQ.png" /></figure><ol><li>(Optional) Upload up to <strong>5 knowledge documents</strong> (total &lt; 8 MB). These can include FAQs, style guides, tool catalogs, or past transcripts.</li><li>Click <strong>Build a preview</strong>.</li></ol><p>Gemini generates:</p><ul><li>Core instructions</li><li>Suggested sub-agent structure (where supported)</li><li>Initial tool ideas</li><li>Basic configuration</li></ul><p>You then <strong>iterate</strong> — refine the generated instructions, add tools manually, or restructure with the built-in <strong>Structure</strong> button (converts to clean XML format that models handle better).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaCs2aLlBXa2nCdIB0MTaA.png" /></figure><p><strong>Best Practice:</strong> Even when using AI generation, always review and tighten the instructions. Vague goals produce vague agents.</p><h3>Basic Configuration</h3><p>After bootstrapping or building manually:</p><ul><li><strong>Global Instructions / Personality</strong> — Define tone, guardrails, and core behavior in the root agent’s instructions. Be specific: “Be friendly but concise. Never hallucinate weather data — always use the tool.”</li><li><strong>Model Selection</strong> — In <strong>Agent Settings</strong> (right dock or title bar), choose the underlying Gemini model. You can often set a primary model at the agent or project level. Newer Gemini models generally offer better reasoning and tool use.</li><li><strong>Features</strong> — Enable multimodal capabilities, guardrails, variables for state, and callbacks as needed.</li><li><strong>Variables</strong> — Create runtime memory (e.g., username, last_city_asked).</li><li><strong>Tools</strong> — Add Python code tools or external integrations. Reference them in instructions with {@TOOL: tool_name}.</li></ul><p><strong>Pro Tip:</strong> Use the <strong>Restructure</strong> and <strong>Refine</strong> buttons on instructions. They dramatically improve how reliably the model follows your intent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccU5hrE-1DxbvXb2p0g6lw.png" /></figure><h3>Implications: Why This Matters</h3><p>CX Agent Studio genuinely lowers the barrier. Non-technical team members (conversational designers, CX leads) can contribute meaningfully alongside developers. You get a production-grade mental model early: <strong>root agent as orchestrator + specialized sub-agents + tools + state via variables</strong>.</p><p>This sets you up perfectly for scalable, maintainable multi-agent systems — the exact architecture we’ll explore deeply in upcoming articles.</p><h3>Conclusion &amp; Next Steps</h3><p>You now have a working agent in CX Agent Studio. You’ve seen how fast you can go from console access to a testable multimodal experience using both manual configuration and AI bootstrapping.</p><p><strong>In the next article</strong>, we’ll dive deep into the architecture powering these agents — root vs. sub-agents, delegation patterns, tool design, state management, guardrails, and evaluation strategies that separate hobby projects from production systems.</p><p><strong>Ready to build?</strong> Head to <a href="https://ces.cloud.google.com/">ces.cloud.google.com</a>, create your first agent, and drop your experience (or questions) in the comments. I read every one.</p><p>What kind of agent are you planning to build first — support, weather, internal productivity, or something else? Let’s discuss below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=849d2a0aa5c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/getting-started-with-cx-agent-studio-setting-up-and-building-your-first-agent-step-by-step-849d2a0aa5c5">Getting Started with CX Agent Studio: Setting Up and Building Your First Agent (Step-by-Step)</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Google CX Agent Studio?]]></title>
            <link>https://medium.com/google-cloud/what-is-google-cx-agent-studio-2a689c99c650?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a689c99c650</guid>
            <category><![CDATA[gecx]]></category>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[conversational-agents]]></category>
            <category><![CDATA[dialogflow-cx]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Tue, 19 May 2026 02:32:42 GMT</pubDate>
            <atom:updated>2026-05-19T02:32:42.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Google CX Agent Studio? Understanding the Next Evolution of Conversational AI for Customer Experience</h3><p><em>Customer experience leaders have long faced a painful tradeoff: simple chatbots that disappoint customers or months-long engineering projects for sophisticated agents. Google’s CX Agent Studio changes the equation.</em></p><p>In 2026, customer expectations have never been higher. People want instant, personalized, multimodal support — across chat, voice, and even images — that feels human and proactive. Yet most organizations still wrestle with the same old problems: rigid chatbots that frustrate users or custom agent projects that drag on for quarters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yFJ8n_IYK_2xyCfM9KtXEw.png" /></figure><p>Enter <strong>Customer Experience Agent Studio</strong> (CX Agent Studio), Google’s next-generation platform for building production-grade conversational AI agents. Powered by Gemini and built on the open-source <strong>Agent Development Kit (ADK)</strong>, it lets teams go from idea to deployed, evaluated, multimodal agent in days instead of weeks.</p><p>This is more than an incremental update. It marks a genuine paradigm shift from intent- and flow-based systems to truly <strong>agentic</strong> architectures.</p><h3>What is CX Agent Studio?</h3><p><strong>CX Agent Studio</strong> is a low-code, visual platform within <strong>Gemini Enterprise for Customer Experience</strong>. It combines an intuitive drag-and-drop builder, AI-powered assistance throughout the lifecycle, and enterprise-grade infrastructure so teams can rapidly create, test, optimize, and deploy sophisticated conversational agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8jN9oRyGIr-j4HEQUGnIA.png" /></figure><p><strong>Core value proposition</strong>:</p><ul><li><strong>Visual + AI-augmented development</strong> — AI helps generate agents, refine instructions, restructure prompts, and even improve test cases.</li><li><strong>Built on ADK foundations</strong> — The same production-grade framework that powers advanced multi-agent systems, now wrapped in a managed, collaborative UI.</li><li><strong>Multimodal by design</strong> — Native support for text, voice (human-like, ultra-low latency), and images.</li><li><strong>35+ pre-built templates</strong> and strong omnichannel capabilities out of the box.</li><li><strong>Integrated everything</strong> — Simulator, evaluations, tracing, versioning, and deployment in one place.</li></ul><p>It delivers always-on, personalized self-service in over <strong>40 languages</strong> with natural voice interactions and direct backend integrations.</p><h3>The Evolution Story: From Intents to Agents</h3><p>Understanding CX Agent Studio requires seeing the full lineage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJSUtSOXNtjeMleqq17DiA.png" /></figure><ol><li><strong>Dialogflow (original)</strong> — Intent-based, highly deterministic. Great predictability, but limited reasoning.</li><li><strong>Dialogflow CX</strong> — Introduced flows and pages for better structure at scale. Still fundamentally flow-driven.</li><li><strong>Conversational Agents</strong> — Added more generative capabilities and a unified console, but the core mental model remained flow/page oriented.</li><li><strong>CX Agent Studio (2026)</strong> — The agentic leap. Built on <strong>ADK</strong>, it centers on <strong>agents, sub-agents, tools, and orchestration</strong> rather than rigid intent trees or page transitions.</li></ol><p><strong>Why the shift?</strong> Complex customer journeys at scale expose the limits of purely deterministic flows. Real conversations require reasoning, dynamic tool use, context retention across the customer lifecycle, and graceful handling of ambiguity. CX Agent Studio embraces this reality while still allowing you to bring existing flow-based agents along for the ride (import support exists).</p><h3>Key Differentiators &amp; Benefits</h3><p>What makes CX Agent Studio stand out in practice?</p><ul><li><strong>AI-Augmented Everything</strong> — Gemini helps you generate initial agent definitions, refine system instructions, and even run “hill-climbing” on your evaluation test cases. This dramatically accelerates iteration.</li><li><strong>Visual Sub-Agent Orchestration</strong> — One of the most powerful UX improvements. Design parent agents that intelligently delegate to specialized sub-agents (e.g., Returns Agent, Order Tracking Agent, Escalation Agent). The visual canvas makes complex multi-agent systems understandable and maintainable.</li><li><strong>Production-Ready Evaluation &amp; Observability</strong> — Built-in simulator with rich tracing. AI-powered scenario testing (describe a goal and it generates conversations) plus “golden tests” you can save directly from successful simulator runs. This is a massive leap for quality and regression confidence.</li><li><strong>Natural Conversations at Scale</strong> — Truly asynchronous tool calling means the agent can work in the background without awkward silences. Ultra-low-latency voice streaming and multimodal support (including direct audio-to-audio in core languages) deliver human-like experiences.</li><li><strong>Enterprise Readiness Out of the Box</strong> — Security, compliance, integrations with 100+ systems, omnichannel gateway, collaboration features, granular changelogs, and one-click rollbacks. You focus on the experience, not the plumbing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYWV07lGD1c-f5-U49QIYQ.png" /></figure><p><strong>Result</strong>: Teams ship faster, maintain higher quality, and deliver more intelligent, personalized customer experiences.</p><h3>Who Should Use It?</h3><p><strong>Ideal users</strong>:</p><ul><li>CX teams and conversational designers who want speed without sacrificing sophistication.</li><li>Developers and solution architects who need production-grade agents without building everything from scratch.</li><li>Organizations already in the Google Cloud ecosystem or looking for strong multimodal + voice capabilities.</li></ul><p><strong>Strong use cases</strong>:</p><ul><li>Customer support &amp; self-service</li><li>Order management, returns, and proactive notifications</li><li>Sales assistance and guided discovery</li><li>Retail and e-commerce experiences</li><li>Internal tools and employee assistance</li></ul><h3>Important Nuances &amp; Considerations</h3><p>CX Agent Studio is not a “rip and replace tomorrow” solution — and that’s actually healthy.</p><ul><li><strong>Legacy support exists</strong> — You can import existing flow-based agents. Migration is evolutionary, not revolutionary.</li><li><strong>Mindset shift required</strong> — Moving from flow design to agentic thinking (clear instructions, tool design, sub-agent orchestration, evaluation strategy) takes some adjustment. Teams strong in prompt engineering and agent design will thrive fastest.</li><li><strong>Pricing model</strong> — Billed per <strong>session</strong> (a full conversation, whether chat, voice, or mixed) at approximately <strong>$0.50 per session</strong> (limits apply). Evaluations and AI augmentation features are included.</li><li><strong>Ecosystem dependency</strong> — Deeply tied to Gemini models and Google Cloud. This is a feature for many (seamless scaling, security, integrations) but worth noting if you need maximum model flexibility.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSs9i8T-yxxtxbU7TUU_WQ.png" /></figure><h3>Edge Cases &amp; Strategic Implications</h3><p>For highly regulated or strictly scripted flows (compliance disclosures, precise troubleshooting scripts), some teams may still prefer deterministic components. CX Agent Studio’s agentic nature excels at flexibility and reasoning, but you can hybridize by importing legacy flows or carefully designing tool + instruction boundaries.</p><p>On the people side, this platform <strong>democratizes</strong> advanced AI agent development. Non-coders can now build sophisticated experiences, while experts gain powerful orchestration and evaluation tools. The winning teams will blend strong domain expertise with modern agent design skills.</p><h3>The Bottom Line</h3><p>CX Agent Studio represents Google’s clearest statement yet that the future of conversational AI is <strong>agentic, multimodal, and collaborative</strong>. By layering a powerful visual + AI-assisted experience on top of the production-grade ADK, Google has removed massive friction while preserving the capabilities enterprises actually need.</p><p>It won’t solve every problem overnight, and success still depends on thoughtful design and evaluation. But for most organizations looking to move beyond basic chatbots into truly intelligent customer experiences, it is currently one of the strongest platforms available.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a689c99c650" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/what-is-google-cx-agent-studio-2a689c99c650">What is Google CX Agent Studio?</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a CLI That Covers Every CX Agent Studio Evaluation API Endpoint — Here’s How It Works]]></title>
            <link>https://medium.com/google-cloud/i-built-a-cli-that-covers-every-cx-agent-studio-evaluation-api-endpoint-heres-how-it-works-5208ab9c0560?source=rss-7648c222eaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5208ab9c0560</guid>
            <category><![CDATA[cx-agent-studio]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[gecx]]></category>
            <dc:creator><![CDATA[Yash Kavaiya]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 04:55:07 GMT</pubDate>
            <atom:updated>2026-04-13T04:55:07.906Z</atom:updated>
            <content:encoded><![CDATA[<p>A single Bash script. 31 menu items. Zero dependencies beyond gcloud and curl.</p><p>If you’ve been building agents in Google’s CX Agent Studio, you already know the evaluation workflow: create test cases, run evaluations, check results, repeat. The UI works fine for a handful of tests, but the moment you need to automate evaluation runs, schedule them on a cron, or export results to CSV for your stakeholders — you’re reaching for the REST API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n40XSEF3SUM1WSGTqHqW-A.png" /></figure><p>The problem? The CX Agent Studio Evaluations API (`ces.googleapis.com/v1beta`) has 28 REST operationsacross 6 resource types.</p><p>No official CLI exists. The documentation is reference-only — no examples, no workflow guidance. So I built one.</p><p>What the CLI Does</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAgpUm5PbzvN_yGEb9Xa6A.png" /></figure><p>`cx_eval.sh` is an interactive Bash script that wraps every evaluation endpoint in a numbered menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9Z05yXGn84Cta-JyO2ZDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxdVdnkbyUSQhA9A8yxieA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mReAEdIuklRH8Z92gTEn4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*1hsj7pbNrBzLSFqIHZY04Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fa9Pce2iH9M9xrjgR-ZaUQ.png" /></figure><p>Why Not Just Use the UI?</p><p>The CX Agent Studio UI handles evaluation well for manual testing. But here’s where it falls short:</p><p>1. No bulk export. You can view results in the console, but there’s no “download CSV” button for evaluation runs with all the metrics. The CLI’s options 29–31 generate timestamped CSV files with columns for pass/fail counts, overall scores, task completion, hallucination checks, semantic similarity, and tool invocation outcomes.</p><p>2. No scheduling from terminal.*The API supports `scheduledEvaluationRuns` with cron expressions. The CLI lets you create one in seconds:</p><p>3. Faster iteration loops. When you’re debugging a failing evaluation, toggling between the CLI and your agent code is faster than clicking through the console. List runs → check the failing result → patch the expectation → re-run. All in the same terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iI3qwa1ukVUmaycxPaLM-Q.png" /></figure><p>The runs CSV includes 12 columns (state, progress, pass/fail counts, overall score). The results CSV includes 12 columns covering every evaluation dimension — task completion, hallucination, tool invocation, semantic similarity, and golden expectation outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g21XlRMA-F0oWStCrxAl5A.png" /></figure><p>Getting Started</p><p>Prerequisites:<br>- `gcloud` CLI ([install](<a href="https://cloud.google.com/sdk/docs/install">https://cloud.google.com/sdk/docs/install</a>))<br>- `curl` (usually pre-installed)<br>- `python3` (only for CSV export)</p><p>Setup:</p><pre>gcloud auth login<br>gcloud config set project YOUR_PROJECT_ID<br>git clone https://github.com/Yash-Kavaiya/cx-agent-studio-evaluations-shell-script.git<br>cd cx-agent-studio-evaluations-shell-script<br>chmod +x cx_eval.sh<br>./cx_eval.sh</pre><p>You’ll be prompted for your Project ID, Location (defaults to `us`), and your CX Agent Studio App.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCHc1SB4rrA-mKUlMktKng.png" /></figure><p>Common Workflows</p><p>Regression testing after an agent update</p><p>1. Option 16 → List evaluation runs (see baseline scores)<br>2. Make your agent changes<br>3. Option 6 → List evaluations → note the evaluation ID<br>4. Run the evaluation from the UI (or trigger via scheduled run)<br>5. Option 31 → Export everything to CSV<br>6. Diff the CSVs</p><p>Setting up nightly evaluation runs</p><p>1. Option 8 → Create an evaluation with your test cases<br>2. Option 3 → Create a scheduled run with a cron expression<br>3. Option 29–30 → Export results each morning</p><p>Debugging a failing test case</p><p>1. Option 16 → List runs → find the failed run<br>2. Option 13 → List results for that evaluation → identify which test case failed<br>3. Option 14 → Get the specific result → see which dimension failed (hallucination? tool invocation? semantic similarity?)<br>4. Option 27 → Patch the expectation if the criteria needs adjustment<br>5. Re-run</p><p>What’s Next</p><p>This CLI covers the full evaluation API surface today. A few things I’m considering:</p><p>- Batch test case creation — uploading golden conversations from CSV<br>- Diff mode— compare two evaluation runs side-by-side in the terminal<br>- CI/CD integration— non-interactive mode for pipeline scripts<br>- Result filtering — show only failing results</p><p><a href="https://github.com/Yash-Kavaiya/cx-agent-studio-evaluations-shell-script)**">https://github.com/Yash-Kavaiya/cx-agent-studio-evaluations-shell-script</a></p><p>If you’re working with CX Agent Studio, Dialogflow CX, or building conversational AI agents on Google Cloud — I write about this stuff regularly. Subscribe for more practical tooling and deep dives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5208ab9c0560" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/i-built-a-cli-that-covers-every-cx-agent-studio-evaluation-api-endpoint-heres-how-it-works-5208ab9c0560">I Built a CLI That Covers Every CX Agent Studio Evaluation API Endpoint — Here’s How It Works</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>