GCDLChapter 62 of 101Objective 3.3

Duet AI for Developers and Workspace

This chapter covers Duet AI for Developers and Google Workspace, a generative AI assistant that boosts productivity across code development and office productivity tools. For the GCDL exam, this topic falls under Objective 3.3: Explain Google Cloud's solutions for data analytics and AI, specifically how Duet AI enhances developer and workspace productivity. Expect 2-3 exam questions on Duet AI's capabilities, integration points, and use cases. You must understand what Duet AI can do, where it is available, and how it differs from generic AI coding assistants.

25 min read
Intermediate
Updated May 31, 2026

Duet AI as a Senior Dev and Admin Assistant

Imagine a senior software engineer and an executive assistant combined into one AI. The senior engineer sits beside you, watches your code as you type, and offers real-time suggestions: 'That function could be optimized,' 'Here's the exact syntax for that API call,' or 'You forgot to handle this edge case.' Meanwhile, the executive assistant manages your calendar, schedules meetings, and drafts emails. But both are integrated into your IDE and workspace tools. When you type a comment like '// TODO: implement payment gateway,' the senior engineer immediately generates the boilerplate code for Stripe integration. When you write an email requesting a project update, the assistant drafts a follow-up and suggests a meeting time based on your calendar. The key mechanism is that Duet AI is not a separate tool—it's embedded directly into Cloud Workstations, Cloud Code (VS Code, JetBrains), and Google Workspace (Gmail, Docs, Sheets, Meet, Chat). It uses context from your current project, including open files, recent code changes, and even your chat history, to generate responses. Unlike a generic autocomplete, Duet AI can reason across multiple files: if you refactor a class name, it can suggest updates to all other files that reference it. In Workspace, it can summarize a long email thread, suggest replies based on your writing style, and even generate a Google Doc draft from a meeting transcript. The AI models are fine-tuned on Google's best practices and your organization's codebase if enabled, making suggestions compliant with your internal standards.

How It Actually Works

What is Duet AI?

Duet AI is Google Cloud's generative AI assistant that operates across two primary domains: Google Cloud (for developers and IT operations) and Google Workspace (for office productivity). It is built on Google's foundation models, including PaLM 2 and later Gemini, and is designed to assist users with contextual, real-time suggestions and automations. Unlike standalone AI tools, Duet AI is deeply integrated into the interfaces users already work in, such as IDEs (VS Code, JetBrains), Cloud Workstations, and Workspace apps (Gmail, Docs, Sheets, Meet, Chat).

How Duet AI Works Internally

Duet AI operates via a client-side plugin that communicates with Google Cloud's AI backend. When a user interacts with Duet AI (e.g., types a comment in code or asks a question in a Google Doc), the plugin sends the current context—including open files, recent edits, and user identity—to the backend. The backend processes this context using a fine-tuned large language model (LLM) that has been trained on Google's best practices, public code repositories, and optionally the organization's own codebase (if the admin enables private code repository indexing). The model generates a response, which is then streamed back to the client and displayed as suggestions, completions, or generated content.

Key Components and Capabilities

- Duet AI for Developers: Integrated into Cloud Code IDE extensions (VS Code, JetBrains), Cloud Workstations, and Cloud Shell. Capabilities include: - Code Generation: Generate functions, classes, tests, and configuration files from natural language prompts. - Code Completion: Real-time autocomplete as you type, with context-aware suggestions. - Code Explanation: Highlight code and ask Duet AI to explain what it does. - Code Refactoring: Suggest improvements and perform refactoring tasks. - Code Review: Analyze code for bugs, security issues, and style violations. - Documentation Generation: Generate comments and documentation for code. - Duet AI for Workspace: Integrated into Gmail, Google Docs, Sheets, Slides, Meet, and Chat. Capabilities include: - Gmail: Smart replies, email drafting, summarization of threads. - Google Docs: Write, rewrite, summarize, and generate content; create documents from meeting notes. - Google Sheets: Generate formulas, create charts, and analyze data. - Google Slides: Generate slide content and design suggestions. - Google Meet: Generate meeting summaries, action items, and real-time captions. - Google Chat: Summarize conversations and draft responses.

Configuration and Administration

For developers, Duet AI is enabled by default for users with appropriate licenses (e.g., Duet AI for Developers add-on). Administrators can manage access via the Google Cloud console under IAM & Admin > Duet AI. They can also configure whether Duet AI can access private code repositories (e.g., Cloud Source Repositories, GitHub, GitLab) to improve suggestions. This is done by enabling the Duet AI for Developers API and granting the necessary IAM roles (e.g., duetai.developer role).

For Workspace, administrators enable Duet AI in the Google Admin console under Apps > Google Workspace > Duet AI. They can set organizational units (OUs) to control which users have access. Additionally, they can configure data retention and logging settings.

Integration with Related Technologies

Duet AI integrates with Cloud Code for IDE support, Cloud Workstations for cloud-based development environments, and Cloud Shell for browser-based terminal access. It also integrates with Cloud Source Repositories and third-party Git providers for code indexing. In Workspace, it integrates seamlessly with all core apps, leveraging the existing Google Workspace APIs and infrastructure.

Defaults and Limits

Code Completion: Suggestions appear after a short delay (typically <500ms). The maximum context window is 8,000 tokens (approximately 6,000 words).

Code Generation: Can generate up to 256 lines of code per request.

Workspace: Summarization works on threads up to 100 messages. Document generation from meeting notes requires a Google Meet recording with transcript.

Rate Limits: Vary by plan; typically 1,000 requests per minute per user.

Security and Privacy

Duet AI processes data in accordance with Google's data processing agreements. For Workspace, customer data is not used to train the underlying models by default (unless opted in). For Developers, code context is encrypted in transit and at rest. Organizations can disable private code indexing to prevent code from being sent to the AI backend.

Exam-Relevant Details

Duet AI is built on Gemini models (as of 2024).

It is available as an add-on to existing Google Cloud and Workspace subscriptions.

Key differentiator: It is context-aware across multiple files and applications, unlike generic AI tools that work on a single file.

For the exam, remember that Duet AI can generate code, complete code, explain code, refactor code, and review code for developers. For Workspace, it can draft, summarize, rewrite, and generate content in Gmail, Docs, Sheets, Slides, Meet, and Chat.

Duet AI also supports natural language chat in Cloud Workstations and Cloud Shell, allowing users to ask questions about their infrastructure or codebase.

Common Exam Traps

Trap 1: Thinking Duet AI is a separate product that requires a new subscription. Reality: It is an add-on to existing Google Cloud and Workspace subscriptions.

Trap 2: Believing Duet AI only works in one IDE. Reality: It works in VS Code, JetBrains, Cloud Workstations, and Cloud Shell.

Trap 3: Assuming Duet AI can write entire applications autonomously. Reality: It assists with code generation but still requires developer oversight.

Trap 4: Mixing up Duet AI for Developers with Duet AI for Workspace. The exam may present a scenario and ask which capabilities are relevant.

Verification Commands (for Developers)

To verify Duet AI is enabled in Cloud Code:

In VS Code, look for the Duet AI icon in the activity bar (sparkle icon).

Run gcloud services list --enabled | grep duetai to check if the API is enabled.

Use gcloud duetai chat in Cloud Shell to interact with Duet AI via command line.

For Workspace, there is no CLI; verification is done via the Admin console or by checking for the "Help me write" feature in Gmail/Docs.

Walk-Through

1

Enable Duet AI API

The first step is for a Google Cloud administrator to enable the Duet AI API in the Google Cloud console. Navigate to APIs & Services > Library, search for 'Duet AI for Developers' or 'Duet AI for Workspace', and click Enable. This activates the backend services that process AI requests. Without this, the IDE plugins and Workspace features will not connect to the AI backend. The API must be enabled for the project where users are working.

2

Install IDE Extension

For developers, the next step is to install the Cloud Code extension for VS Code or JetBrains IDE. This extension includes the Duet AI plugin. After installation, the user must authenticate with their Google Cloud account (via `gcloud auth login` or IDE login). The plugin then establishes a WebSocket connection to the Duet AI backend. The connection uses OAuth 2.0 with the `https://www.googleapis.com/auth/cloud-platform` scope.

3

Configure Private Code Indexing

Organizations can optionally allow Duet AI to index private code repositories to improve suggestions. This is done in the Google Cloud console under Duet AI settings. The administrator must connect a source code repository (e.g., Cloud Source Repositories, GitHub, GitLab) and grant read access. The AI then ingests the codebase, creating embeddings that are stored securely. This step is critical for generating contextually relevant suggestions that follow internal coding standards.

4

Interact with Duet AI in IDE

Once configured, the developer can interact with Duet AI by typing code or natural language prompts. For example, typing a comment like `// function to calculate fibonacci` triggers a code generation request. The IDE sends the current file context and the comment to the backend. The backend returns a suggested function, which appears as ghost text. The developer can accept (Tab) or reject (Esc). For chat, the developer can use a dedicated panel to ask questions like 'Explain this class' or 'Find security vulnerabilities in this code.' The response is streamed in real-time.

5

Use Duet AI in Workspace

In Google Workspace, Duet AI is accessed through built-in features. For example, in Gmail, clicking 'Help me write' opens a prompt where the user describes the email. The AI generates a draft, which the user can refine. In Google Docs, the 'Help me write' button allows generating content from prompts like 'Write a project proposal for a cloud migration.' The AI uses the current document context (e.g., previous paragraphs) to maintain consistency. In Google Meet, after a meeting, Duet AI can generate a summary and action items from the transcript. These features require the user to have Duet AI enabled in their Workspace license.

What This Looks Like on the Job

Enterprise Scenario 1: Accelerating Microservices Development

A large e-commerce company uses Duet AI for Developers to speed up their microservices migration to Google Cloud. Their developers work in VS Code with Cloud Code extension. The team has enabled private code indexing on their Cloud Source Repositories, which contain over 500 microservices. When a developer types a comment like '// Create a REST endpoint for order creation,' Duet AI generates a complete Spring Boot controller class with proper annotations, error handling, and logging. It also suggests updates to the OpenAPI specification file in a different directory. The team reports a 30% reduction in boilerplate code writing time. However, they initially faced issues with Duet AI generating code that referenced deprecated libraries. They resolved this by updating their private repository to include only approved libraries, which the AI then learned from.

Enterprise Scenario 2: Automating Meeting Follow-ups

A consulting firm with 10,000 employees uses Duet AI for Workspace to automate meeting follow-ups. After every Google Meet, Duet AI automatically generates a summary and action items, which are saved to a shared Google Doc. Consultants then review and edit the doc before sending to clients. This saves an average of 15 minutes per meeting. The firm also uses Duet AI in Gmail to draft client emails based on the meeting summary. One challenge they encountered was that Duet AI sometimes generated overly verbose summaries. They adjusted by providing feedback via the 'Thumbs up/down' buttons, which helped fine-tune the model for their preferences.

Enterprise Scenario 3: Onboarding New Developers

A SaaS startup uses Duet AI to accelerate onboarding of new developers. New hires can ask Duet AI in Cloud Workstations to explain the codebase architecture, generate unit tests, and document existing functions. This reduces the time to first commit from 2 weeks to 3 days. The startup also uses Duet AI's code review feature to catch security issues before code review. They configured Duet AI to automatically scan pull requests for common vulnerabilities (e.g., SQL injection, XSS) and post comments. This integration required setting up a webhook from their GitHub repository to Cloud Build, which triggers a Duet AI review. A common pitfall was that Duet AI sometimes flagged false positives, so they had to tune the sensitivity settings.

How GCDL Actually Tests This

What the GCDL Exam Tests on Duet AI

The GCDL exam (Objective 3.3) focuses on understanding Duet AI's capabilities and integration points, not on deep configuration details. You should be able to:

Identify which Duet AI capabilities are available for Developers vs. Workspace.

Recognize that Duet AI is an add-on, not a standalone product.

Understand that Duet AI can generate, complete, explain, refactor, and review code.

Know that Duet AI for Workspace works in Gmail, Docs, Sheets, Slides, Meet, and Chat.

Differentiate Duet AI from other Google Cloud AI services (e.g., Vertex AI, Natural Language API).

Common Wrong Answers and Why Candidates Choose Them

1.

Wrong Answer: 'Duet AI can fully automate code deployment.' Why: Candidates confuse code generation with CI/CD automation. Duet AI does not deploy code; it only assists with writing it.

2.

Wrong Answer: 'Duet AI is available only in Google Cloud console.' Why: Candidates think of AI as a web portal. In reality, Duet AI is embedded in IDEs and Workspace apps.

3.

Wrong Answer: 'Duet AI requires training on your data.' Why: Candidates assume all AI needs custom training. Duet AI uses pre-trained models and optionally indexes private code, but no formal training is required.

4.

Wrong Answer: 'Duet AI for Workspace can schedule meetings.' Why: While it can suggest times based on calendar, it does not directly schedule meetings; that remains a manual action.

Specific Numbers and Terms on the Exam

Gemini: The model family behind Duet AI (as of 2024).

Add-on: Duet AI is billed as an add-on to existing subscriptions.

Cloud Code: The IDE extension that hosts Duet AI for Developers.

Help me write: The feature name in Gmail and Docs.

Meet summaries: A key Workspace capability.

Edge Cases and Exceptions

Duet AI is not available in all regions; check Google Cloud region availability.

For Workspace, Duet AI requires a Google Workspace account with a specific edition (e.g., Business Plus, Enterprise).

Code indexing only works with supported Git providers; not all are supported.

Duet AI does not support all programming languages; it works best with popular ones (Python, Java, Go, JavaScript, TypeScript, etc.).

How to Eliminate Wrong Answers

If an answer says Duet AI 'trains a model on your data,' it is wrong because Duet AI uses pre-trained models and only indexes for context.

If an answer says Duet AI 'deploys code,' it is wrong because deployment requires separate CI/CD tools.

If an answer mentions 'Vertex AI' as the underlying technology, it is wrong because Duet AI uses Gemini, not Vertex AI (though they share foundation models, Duet AI is a distinct product).

Key Takeaways

Duet AI is an add-on to Google Cloud and Workspace subscriptions, not a standalone product.

Duet AI for Developers provides code generation, completion, explanation, refactoring, and review within IDEs.

Duet AI for Workspace provides drafting, summarizing, and content generation in Gmail, Docs, Sheets, Slides, Meet, and Chat.

Duet AI is built on Gemini models and is context-aware across multiple files and applications.

Administrators can enable private code indexing to improve suggestions, but this is optional.

Duet AI requires the Duet AI API to be enabled in the Google Cloud project.

Common exam trap: confusing Duet AI with Vertex AI or other Google Cloud AI services.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Duet AI for Developers

Integrated into Google Cloud ecosystem (Cloud Code, Cloud Workstations, Cloud Shell).

Can index private code repositories for context-aware suggestions.

Supports natural language chat for code explanation and review.

Built on Google's Gemini models.

Part of Google Cloud's AI portfolio, with enterprise-grade security and compliance.

GitHub Copilot

Integrated into major IDEs (VS Code, JetBrains, Neovim, etc.).

Primarily uses code context from open files; no private repo indexing by default (unless using Copilot Enterprise).

Offers code completion and chat, but code review features are limited.

Built on OpenAI's Codex model (GPT-3.5/GPT-4).

Standalone product from GitHub/Microsoft, with separate licensing.

Watch Out for These

Mistake

Duet AI is a separate product that requires a new subscription independent of Google Cloud or Workspace.

Correct

Duet AI is an add-on to existing Google Cloud and Google Workspace subscriptions. You do not need a separate standalone license; you add it to your current plan.

Mistake

Duet AI can write entire production-ready applications with no human oversight.

Correct

Duet AI generates code snippets and suggestions, but all output must be reviewed, tested, and integrated by a developer. It is an assistant, not an autonomous developer.

Mistake

Duet AI for Developers only works in Google Cloud Shell.

Correct

Duet AI for Developers is integrated into Cloud Code for VS Code and JetBrains IDEs, Cloud Workstations, and Cloud Shell. It is not limited to Cloud Shell.

Mistake

Duet AI for Workspace can automatically send emails and schedule meetings without user confirmation.

Correct

Duet AI generates drafts and suggestions, but all actions (sending emails, creating events) require user approval. It does not perform actions autonomously.

Mistake

Duet AI uses the same underlying model as Google Search's AI.

Correct

Duet AI is built on Gemini models, which are different from the models used in Google Search (e.g., MUM, BERT). While they share some foundational technology, Duet AI is fine-tuned for developer and workspace tasks.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between Duet AI for Developers and Duet AI for Workspace?

Duet AI for Developers assists with coding tasks inside IDEs and Cloud Workstations, offering code generation, completion, explanation, refactoring, and review. Duet AI for Workspace assists with productivity tasks inside Google Workspace apps like Gmail, Docs, Sheets, Slides, Meet, and Chat, offering drafting, summarizing, and content generation. They are separate add-ons but share the same underlying Gemini models.

Does Duet AI require a separate subscription or is it included in Google Cloud/Workspace?

Duet AI is an add-on to existing Google Cloud and Workspace subscriptions. It is not included in base plans; you must purchase a Duet AI add-on license per user. For example, Duet AI for Developers is billed per user per month, and Duet AI for Workspace is billed per user per month as well.

Can Duet AI access my private code repositories?

Yes, if an administrator enables private code indexing. This allows Duet AI to learn from your organization's codebase to provide more relevant suggestions. However, this is optional and can be disabled. The code is only used to generate suggestions and is not used to train the base model.

Is Duet AI available in all Google Cloud regions?

No, Duet AI is available in select regions. As of 2024, it is generally available in the US, Canada, UK, Germany, France, and Japan. Check the Google Cloud documentation for the latest region list. If you are in an unsupported region, you may experience latency or unavailability.

How does Duet AI handle data privacy?

Duet AI processes data in accordance with Google's data processing agreements. For Workspace, customer data is not used to train the underlying models by default. For Developers, code context is encrypted in transit and at rest. Organizations can configure data retention and logging settings.

Can Duet AI generate code in any programming language?

Duet AI works best with popular programming languages such as Python, Java, JavaScript, TypeScript, Go, C++, and SQL. It may have limited support for less common languages. The model is trained on a diverse corpus, but quality varies by language.

What is the 'Help me write' feature in Duet AI for Workspace?

'Help me write' is a feature in Gmail and Google Docs that allows users to describe what they want to write in natural language, and Duet AI generates a draft. For example, in Gmail, you can type 'Write a follow-up email to the client about the project timeline' and Duet AI produces a draft that you can edit and send.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Duet AI for Developers and Workspace — now see how well it sticks with free GCDL practice questions. Full explanations included, no account needed.

Done with this chapter?