GCP – Smarter Authoring, Better Code: How AI is Reshaping Google Cloud’s Developer Experience
The mission of the Google Cloud Developer Experience team is simple: to help developers get from learning to launching as quickly and effectively as possible. Two of our primary tools for this are the robust hands-on documentation and the ready-to-use code samples embedded directly within it, which developers rely on every day. As Google Cloud’s services expand and evolve at a rapid pace, maintaining the quality, accuracy, and coverage of these tightly integrated resources presents a monumental challenge. Modern developers expect instant, accurate, and idiomatic guidance, and anything less ends up being a barrier to adoption.
To meet this challenge, we are strategically leveraging Generative AI, powered by Gemini, in the core of our content workflows. This isn’t about replacing human expertise. It’s about using technology to enhance our ability to deliver value to developers faster and on a larger scale. Here’s how we are applying AI to create high quality documentation and more comprehensive, integrated code samples (at scale and pace).
AI-Powered Documentation: Increasing Velocity and Ensuring Accuracy
For our technical writing teams, the velocity of Google Cloud’s development presents two core problems: how do we keep pace with documenting new features and capabilities, and how do we ensure the existing documentation remains accurate?
To accelerate the creation process, we have integrated Gemini directly into our writers’ authoring environments. This acts as a productivity multiplier, streamlining common tasks like generating formatted tables from unstructured content, translating between markup languages, and applying complex style guides with a single click. More significantly, the adoption of AI solutions enables writers to focus their time on strategic documentation solutions and ensure high quality content.
Just as important as creation is validation. For years, automated regression testing has been a staple for catching bugs in code. We are now bringing that same discipline to documentation—a goal that was long considered a dream due to the ambiguity of natural language. For our quickstarts, we use Gemini to read the procedural steps and automatically generate web orchestration scripts (using frameworks like Playwright). These scripts then execute the steps in a real Google Cloud environment, automatically verifying that our documentation accurately reflects the product’s behavior. We run over 100 of these tests daily, ensuring our quickstarts are continuously validated and that you can trust the steps you’re following.
Scaling In-Doc Code Samples with an Agentic AI System
The code samples embedded within our documentation present a similar, if not more complex, set of challenges: ensuring broad language coverage, maintaining freshness as APIs and best practices evolve, and optimizing the use of our engineering resources. Manually creating and maintaining tens of thousands of idiomatic samples for use across all our documentation—including for the long tail of specialized APIs—is not scalable.
Our solution is an agentic system that automates the entire lifecycle of a code sample destined for our documentation. This workflow is anchored to the ultimate source of truth for Google APIs: the Protobuf (proto) definitions hosted in the public googleapis repositories. This ensures our samples are always aligned with the API’s actual implementation, preventing factual drift.
The system works in a multi-step process:
-
Prompt Assembly: An agent prepares a highly detailed prompt by analyzing the target API method and combining a “one-shot” code template with the specific method names, parameters, and documentation from its official Protobuf definition. This structured, data-driven approach is key; it constrains the model, preventing hallucination and ensuring the prompt is grounded in factual API details from the start.
-
Generation and Refinement: The prompt is passed to Gemini to generate a first draft. A separate ‘evaluator’ agent then scores the sample against a rigorous rubric. If it falls short, specific feedback is sent back to the generator for an improved version. This automated “dialogue” between agents mimics a software peer review process, but at a speed and scale impossible to implement manually.
-
Automated Testing: Once approved, the sample is deployed to a containerized environment where it undergoes a final battery of tests: build/compile, linting, and execution to confirm it runs correctly. This gives us high confidence to publish at scale across our documentation.
A cornerstone of this strategy is our AI-powered auditing agent. It acts as an exacting code reviewer, validating every API call against official documentation using Gemini grounded with Google Search. This forces it to verify every detail against our public-facing documentation, ensuring a consistent quality bar for every sample, whether human-written or AI-generated.
The Future is Augmented: Quality and Expertise at Scale
As we scale, this level of automation allows our human experts to evolve their roles. They now focus on improving the AI systems themselves—investigating statistical anomalies, performing audit sampling to validate the AI judges, and refining the generation models. This new approach elevates their work and ensures quality at a scale that humans working on their own cannot achieve.
By automating the creation of foundational documentation and the code within it, we are freeing our teams to focus on what developers need most: detailed, solution-oriented content that solves complex, real-world problems. This strategic partnership between human experts and AI agents is the core of our approach. It allows us to build a more comprehensive, accurate, and responsive developer experience, ensuring that no matter what you’re building on Google Cloud, you have the integrated documentation and code you need to succeed.
We would like to thank the expert contributions to this post made by Lisa Johnson, Mark Ryan, and Joe Shirey.
Read More for the details.