OCT. 7, 2026 (英语).
如果您在Google Cloud上构建了AI agents或开发者工具,则停止依赖brittle web-scraping或与 Stale LLM 训练截取相撞。
利用 Google 开发者知识 API 生态系统,包括我们的gcloud CLI 表面,官方的 agent 技能,API Explorer,以及多语言客户端库,构建更快,更聪明,更自信的构建。 无论是您在命令行终端中运行,提示一个 AI agent,测试请求交互,还是写入制作软件,我们的工具发送 Google 文档。
开发者知识API是Google的官方,程序来源,用于开发者有关Google Cloud,Firebase,Android等文件的真相。 它专门为现代AI agents,IDE扩展和自动化工作流程所设计,它用一个结构化的API取代了Brittle Web-scrap,它服务于新鲜的,Markdown格式的文档。
API通过提供语义和关键词搜索,智能文档块和被禁入的QQA能力,确保了您的agents和开发工具保持准确和标语效率。
开发者知识API经常被索引,以确保可预测的检索,新鲜文档,以及上游更新和agent访问之间的最小滞后。
通过开发者知识API接口,开发者和AI agents可以发现,检索,并合成基于官方Google文档的答案,跨越终端,IDE,和后端代码库。
开发者 Knowledge API gcloud CLI 表面将官方文档搜索、检索和禁用QQA整合到您的命令行环境中。 它来自Cloud Shell的预安装,在Linux,macOS,和Windows上跨越了标准Google Cloud SDK安装,不需要额外的插件或配置。
关键能力和命令:
在你的终端里找到被禁足的答案
- 文档搜索堆:搜索文档片段和块跨越Google文档。
- 文件说明:为特定文件检索元数据和内容。
# 得到被禁闭的答案 #
gcloud 开发者- 知识答案- query -- query=“ 我如何创建大查询数据集 ”
# 搜索文档块
gcloud 开发者- 知识文档搜索- cunks -- query=“ Firestore 交易”
# 为特定文档检索元数据和内容
gcloud开发者-知识文档描述"documents/docs.cloud.google.com/ storage/docs/创建-buckets".
{\fn方正粗倩简体\fs12\an8\1cHFFFF00\b0}找出一个错误的踪迹直接输入到解答命令中
gcloud 开发者- 知识答案- query -- query="$( 猫的错误。 txt)"
贝壳
复制
要从gcloud CLI开始,请参见gcloud CLI快速启动。
开发者知识agent技能在AI编码助理和Google的文献生态系统之间建立了联系,使自主工具能够获取最新的技术规格。
主要惠益
- 定位和减少幻觉:提供AI编码助理和代理工作流程获取最新的Google开发者文档,减少被固态LLM训练截断后产生的幻觉。
- 优化符号和上下文使用:使用多步骤检索工作流程——使用搜索文件检查代码和文件块在以文档.get获取完整的Markdown页面之前,或在使用 answerQuery 发送已找到的解答之前,先先跳过。
- 广义工具相容性:使用标准MCP集成跨越Google抗重力,Claude Code,Cursor,GitHub Copilot,以及自定义代理框架。 该技能指导了您的助手如何使用开发者知识MCP服务器(或通过卷曲返回REST API).
配置 agent 技能
在您的终端中运行以下 CLI 帮助命令来配置技能:
npx 技能添加 google/ 技能 -- -- 技能检索- 开发者知识
此命令将在您的工程中安装开发者知识 agent 技能。 该技能指导了您的助手如何使用开发者知识MCP服务器(或使用卷曲返回到REST API).
要在您的 IDE 中连接到 MCP 服务器,或用应用程序默认身份或 API 密钥配置认证,请查看 Connect to the Developers Knowledge MCP 服务器。
客户端图书馆允许您将文档检索、搜索和基于本地的答案生成嵌入到生产系统、自动CI/CD管道和企业知识库中。
主要好处:
- 程序访问:提供程序访问AnswerQuery、SearchDocumentChunks、GetDocuments和BatchGetDocuments。
- 异想天开的融合:原生类型定义、构建者模式、错误处理,以及针对每种支持语言生态系统的同步执行。
- Batching and effecility:像BatchGetDocuments这样的方法可以在一个API呼叫中检索多达20个文档。
- 企业安全和可靠性:支持Google Cloud应用程序默认证书、自动重试和结构化引用跟踪。
支持的语言:
开始遵循快速启动设置您的环境,安装库,并开始检索开发者文档。
代码示例:
以下例子说明了AI agent如何可以使用Python客户端库获取最新的产品发布指出,确保其响应基于其培训截断后的数据:
从 google. cloud 导入开发者知识 v1
def 获取 My Product Release Notes(我的产品名:str) - > str:
"""将最新发行的"指出"搭建了模型的知识截断".
# 初始化开发者知识 API 客户端
my api 客户端=开发者知识 v1. 开发者知识客户端()
# 为特定产品的发布制定目标查询指出
my search query=f"{我的产品名}最新发布指出"
my request = 开发者知识 v1. 搜索DocumentChunks request(
查询=我的 search query
)
# 检索并归还相关的文档块
my 应答=我的 api 客户端。 search document chunks(request=my request)
解开块状文字
my release 指出 = [My chunk.text for my chunk in my response.chunks] (英语).
返回"\n"。join(我的 release 指出)
# 实例用途:
# my latest 指出 = 取取出我的出厂说明 ("消防")
Python
各种任务的代码示例:
- 回答与被禁足的一代的询问
- 搜索文档块
- 获取文件
- 获取多份文件
Google APIs Explorer for the Developers Knowledge API提供一个互动的零码接口,整合到Google的开发者站点中,可以对API请求和响应结构进行实验和验证。
通过APIs 探索器,您可以测试以下核心终点:
准备好将 Google 开发者文档整合到您的工作流程和AI工具中吗?这里有一些开始的方法:
- 如果您已经拥有了 gcloud CLI:您可以立即开始使用 gcloud CLI 表面查询官方文档。
- 如果你没有gcloud CLI:将agent技能交给你的AI编码助手或agent,以允许被禁取。
本文由 AI宝库自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
OCT. 7, 2026
If you build AI agents or developer tools on Google Cloud, stop relying on brittle web-scraping or wrestling with stale LLM training cutoffs.
Build faster, smarter, and with greater confidence using the Google Developer Knowledge API ecosystem, including our gcloud CLI surface, an official agent skill, API Explorer, and multi-language client libraries. Whether you are operating in a command-line terminal, prompting an AI agent, testing requests interactively, or writing production software, our tools deliver Google documentation.
The Developer Knowledge API is Google's official, programmatic source of truth for developer documentation about Google Cloud, Firebase, Android, and more. Designed specifically for modern AI agents, IDE extensions, and automated workflows, it replaces brittle web-scraping with a structured API that serves fresh, Markdown-formatted documentation.
By offering semantic and keyword search, intelligent document chunking, and grounded Q&A capabilities, the API ensures your agents and developer tools remain accurate and token-efficient.
The Developer Knowledge API is indexed frequently to ensure predictable retrieval, fresh documentation, and minimal lag between upstream updates and agent access.
With the Developer Knowledge API interfaces, developers and AI agents can discover, retrieve, and synthesize answers grounded in official Google documentation across terminals, IDEs, and backend codebases.
The Developer Knowledge API gcloud CLI surface integrates official documentation search, retrieval, and grounded Q&A into your command-line environment. It comes pre-installed in Cloud Shell and works across standard Google Cloud SDK installations on Linux, macOS, and Windows without requiring extra plugins or configuration.
Key capabilities and commands:
- answer-query: Get grounded answers in your terminal.
- documents search-chunks: Search document snippets and chunks across Google documentation.
- documents describe: Retrieve metadata and content for a specific document.
# Get grounded answers
gcloud developer-knowledge answer-query --query="How do I create a BigQuery dataset?"
# Search document chunks
gcloud developer-knowledge documents search-chunks --query="Firestore transactions"
# Retrieve metadata and content for a specific document
gcloud developer-knowledge documents describe "documents/docs.cloud.google.com/storage/docs/creating-buckets"
# Troubleshoot an error trace by piping it directly into the answer-query command
gcloud developer-knowledge answer-query --query="$(cat error.txt)"
Shell
Copied
To get started with the gcloud CLI, see the gcloud CLI Quickstart.
The Developer Knowledge agent skill establishes a link between AI coding assistants and Google's documentation ecosystem, enabling autonomous tools to access up-to-date technical specifications.
Key Benefits
- Grounding & reduced hallucinations: Provides AI coding assistants and agentic workflows access to up-to-date Google developer documentation, reducing hallucinations from stale LLM training cutoffs.
- Optimized token & context usage: Uses a multi-step retrieval workflow—inspecting code and documentation chunks using searchDocumentChunks first before fetching complete Markdown pages with documents.get, or delivering grounded answers using answerQuery.
- Broad tooling compatibility: Uses the standard MCP integration across Google Antigravity, Claude Code, Cursor, GitHub Copilot, and custom agentic frameworks. The skill instructs your assistant how to use the Developer Knowledge MCP server (or fall back to the REST API via curl).
Configure the agent skill
Configure the skill by running the following CLI helper command in your terminal:
npx skills add google/skills --skill retrieving-developer-knowledge
This command installs the Developer Knowledge agent skill in your project. The skill instructs your assistant how to use the Developer Knowledge MCP server (or fall back to the REST API using curl).
To connect to the MCP server in your IDE, or to configure authentication with Application Default Credentials or an API key, see Connect to the Developer Knowledge MCP server.
The client libraries let you embed documentation retrieval, search, and grounded answer generation into production systems, automated CI/CD pipelines, and enterprise knowledge bots.
Key benefits:
- Programmatic access: Provides programmatic access to AnswerQuery, SearchDocumentChunks, GetDocument, and BatchGetDocuments.
- Idiomatic integration: Native type definitions, builder patterns, error handling, and asynchronous execution tailored to each supported language ecosystem.
- Batching and efficiency: Methods like BatchGetDocuments enable retrieving up to 20 documents in a single API call.
- Enterprise security and reliability: Support for Google Cloud Application Default Credentials, automatic retries, and structured citation tracking.
Supported languages:
Get started by following the Quickstart to set up your environment, install a library, and start retrieving developer documentation.
Code examples:
The following example demonstrates how an AI agent can use the Python client library to fetch the latest product release notes, ensuring its responses are grounded in data beyond its training cutoff:
from google.cloud import developer_knowledge_v1
def FetchMyProductReleaseNotes(my_product_name: str) -> str:
"""Fetches the latest release notes to bridge a model's knowledge cutoff."""
# Initialize the Developer Knowledge API client
my_api_client = developer_knowledge_v1.DeveloperKnowledgeClient()
# Formulate a targeted query for the specific product's release notes
my_search_query = f"{my_product_name} latest release notes"
my_request = developer_knowledge_v1.SearchDocumentChunksRequest(
query=my_search_query,
)
# Retrieve and return the relevant documentation chunks
my_response = my_api_client.search_document_chunks(request=my_request)
# Extract the chunk text
my_release_notes = [my_chunk.text for my_chunk in my_response.chunks]
return "\n".join(my_release_notes)
# Example usage:
# my_latest_notes = FetchMyProductReleaseNotes("Firestore")
Python
Code examples across various tasks:
- Answer a query with grounded generation
- Search for document chunks
- Retrieve a document
- Retrieve multiple documents
The Google APIs Explorer for the Developer Knowledge API offers an interactive, zero-code interface integrated into Google's developer site, enabling experimentation and verification of API requests and response structures.
Through the APIs Explorer, you can test the following core endpoints:
Ready to integrate Google developer documentation into your workflows and AI tools? Here are a few ways to get started:
- If you already have the gcloud CLI: You can start querying official documentation right away using the gcloud CLI surface.
- If you don't have the gcloud CLI: Give the agent skill to your AI coding assistant or agent to enable grounded retrieval.
Auto-fetched and translated by AI Gem Box. All rights belong to the original author.