# Karpathy's Agentic Engineering Finally Has Proper Tooling
**作者**: Akshay
**日期**: 2026-06-27T13:24:33.000Z
**来源**: [https://x.com/akshay_pachaar/status/2070860837448040832](https://x.com/akshay_pachaar/status/2070860837448040832)
---

Build by Google, explained as a step-by-step guide.
Karpathy defined agentic engineering at Sequoia Ascent 2026 as the discipline that separates production-grade agent work from vibe coding.
The core skills he listed were spec design, eval loops, and security oversight.
However, the tooling for this has been missing since practicing actual agentic engineering today still requires working across the editor, a terminal for scaffolding, a browser for testing, a cloud console for deployment, and a separate framework for evals.

The solution to production-grade Agentic Engineering is now actually implemented in Google’s Agents CLI. It covers the entire workflow in one place for scaffolding, evaluating, and deploying ADK agents.

It injects 7 skills into your coding agent that teach it ADK patterns, eval structures, and deployment targets.
After that, the coding agent automatically drives the entire lifecycle from natural language, and you don't need to leave your editor for any phase of the lifecycle.
Let’s walk through this end-to-end by building a RAG agent from scratch and deploying it as an internal knowledge assistant.
# Step 1: Install Agents CLI
```
uvx google-agents-cli setup
```
This injects 7 bundled skills into your coding agent’s context, covering ADK code patterns, project scaffolding, evaluation setup with LLM-as-judge scoring, deployment configuration for Agent Runtime and Cloud Run, and Cloud Trace observability.

So each skill teaches the coding agent how a specific phase of the lifecycle works, so it can execute that phase directly from a natural language prompt.
One setup command installs these skills across every coding agent simultaneously. So Antigravity, Claude Code, Cursor, Codex, etc., all gain the same ADK expertise from a single install:

# Step 2: Build the RAG Agent
Open the coding agent of your choice and describe the agent:
```
1. Build a RAG agent that ingests documents, retrieves relevant
2. context, and answers questions with source citations. Use the
3. ADK agentic_rag template with Gemini 3.5 Flash.
```
The coding agent activates its ADK skills and scaffolds the full project, as depicted below:

- Claude Code scaffolded the project from the ADK agentic_rag template with Vector Search as the datastore.
- It then identified that the template lacked citation support, so it rewrote the agent instruction to require grounded answers with inline citations and modified the retriever to surface source IDs with each document.
- It provisioned the datastore, ingested a synthetic Q&A corpus (12 entries on Python fundamentals), and ran a smoke test. The agent returned cited answers and correctly refused to hallucinate when the retrieval was down.
The injected skills know ADK patterns for retrieval-augmented agents, which is why the scaffold inherently included citation support and Vector Search config.
# Step 3: Test locally
Next, we ask the coding agent to launch the ADK Web UI on localhost:
```
Spin up a local dev server so I can test this.
```
This launches an interactive chat interface where you can test the agent against real queries. Two things to verify here:

- First, does it retrieve and cite correctly? We ask “how to merge two dictionaries?” and the agent pulls the right context from the corpus, walks through both the merge operator and the update() method, and attaches [source: 1003] inline. Citations work.
- Second, does it handle missing context correctly? We ask “who won the FIFA World Cup in 2022?” which is a question the corpus has no answer to. The agent responds that it cannot answer based on the available documents.
# Step 4: Evaluate before deploying
This is the most important step and the one that most agent tutorials skip entirely.
```
1. Generate 20 test scenarios for this RAG agent covering correct
2. retrieval, insufficient context where the agent should say it
3. doesn't know, multi-hop questions, and citation accuracy. Run
4. the full eval suite and show me the results.
```

The coding agent generated 20 test scenarios across four categories:

- 6 for correct retrieval (questions the corpus can answer)
- 5 for insufficient context (questions it should refuse to answer)
- 5 for multi-hop reasoning (questions requiring multiple documents)
- and 4 for citation accuracy.
Karpathy flagged this gap specifically and said 89% of teams running agents have observability set up, but only 52% have evals. Agents CLI lets you generate and run a full eval suite from a single prompt.
Results:

- Citation accuracy was perfect at 1.00 across all 20 cases. The agent never fabricated a source.
- But the hallucination score flagged an edge case, where, on questions outside the corpus, the agent sometimes appended general knowledge instead of saying it didn’t have enough context. The eval traced this to a single line in the instruction ("if you already know the answer to a simple question, you may respond directly without using the tools"), and removing that line from the instruction will solve this.
# Step 5: Deploy to agent runtime
```
Deploy this to Agent Runtime in us-central1.
```

The coding agent first enhanced the project for Agent Runtime by adding the deployment entrypoint and infrastructure config.
It then deployed the agent to Google Cloud, and the whole process took about 2-3 mins.
Cloud Trace is enabled by default, so observability is built in from the first deployed request.
# Step 6: Register to Gemini Enterprise
At this point, the agent is deployed and working, but it's only accessible to the developer who built it.
Anyone else who wants to use it needs the endpoint URL, the right API credentials, and enough context to know the agent exists in the first place.

In most teams, this is where useful agents quietly die. They work, but nobody outside the builder's immediate circle knows about them or can access them.
Asking the agent to do the following registers the app with the Gemini Enterprise platform, making it discoverable inside the Gemini Enterprise app across the entire org:
```
Register this agent to Gemini Enterprise.
```

Any team that has internal docs they want to make searchable can access the same knowledge assistant without setting up their own RAG pipeline. IAM controls who can access it, and the enterprise dashboard provides full observability.
This is what agentic engineering looks like with proper tooling, as Karpathy also described.
With one terminal session and six natural language prompts, and the agent went from an empty folder to a production assistant that the org can use.
You can find the Agents CLI on GitHub here →
Here’s the ADK documentation →
And here’s the Agent Platform →
👉 Over to you: what’s the biggest pain point in your current RAG setup that you wish you could automate away?
Thanks for reading, and to Google Cloud for partnering with us on today’s issue!
## 相关链接
- [Akshay](https://x.com/akshay_pachaar)
- [@akshay_pachaar](https://x.com/akshay_pachaar)
- [52K](https://x.com/akshay_pachaar/status/2070860837448040832/analytics)
- [Google’s Agents CLI](https://github.com/google/agents-cli)
- [You can find the Agents CLI on GitHub here →](https://fandf.co/43Ys2m6)
- [Here’s the ADK documentation →](https://adk.dev/)
- [And here’s the Agent Platform →](https://cloud.google.com/gemini-enterprise/agents)
- [9:24 PM · Jun 27, 2026](https://x.com/akshay_pachaar/status/2070860837448040832)
- [52.2K Views](https://x.com/akshay_pachaar/status/2070860837448040832/analytics)
- [View quotes](https://x.com/akshay_pachaar/status/2070860837448040832/quotes)
---
*导出时间: 2026/6/28 15:08:33*
---
## 中文翻译
# Karpathy 的代理工程终于拥有了趁手的工具
**作者**: Akshay
**日期**: 2026-06-27T13:24:33.000Z
**来源**: [https://x.com/akshay_pachaar/status/2070860837448040832](https://x.com/akshay_pachaar/status/2070860837448040832)
---

由 Google 构建,我们将其拆解为一份分步指南。
Karpathy 在 Sequoia Ascent 2026 上将代理工程定义为一门学科,它将生产级代理工作与“氛围编程”区分开来。
他列举的核心技能包括规格设计、评估循环和安全监督。
然而,相应的工具一直处于缺失状态,因为如今实践真正的代理工程,仍然需要在编辑器、用于脚手架的终端、用于测试的浏览器、用于部署的云控制台以及用于评估的独立框架之间来回切换。

如今,生产级代理工程的解决方案实际上已在 Google 的 Agents CLI 中落地。它在一个地方涵盖了从脚手架搭建、评估到部署 ADK 代理的整个工作流程。

它向你的编码代理注入了 7 项技能,教导它 ADK 模式、评估结构以及部署目标。
在此之后,编码代理会自动从自然语言开始驱动整个生命周期,而在生命周期的任何阶段你都无需离开编辑器。
让我们通过从零开始构建一个 RAG 代理并将其部署为内部知识助手,来完整演示这一过程。
# 第 1 步:安装 Agents CLI
```
uvx google-agents-cli setup
```
这会将 7 项捆绑的技能注入到你的编码代理上下文中,涵盖 ADK 代码模式、项目脚手架、使用 LLM 即判分 评分的评估设置、针对 Agent Runtime 和 Cloud Run 的部署配置,以及 Cloud Trace 可观测性。

因此,每一项技能都会教导编码代理生命周期的特定阶段是如何运作的,使其能够直接根据自然语言提示来执行该阶段。
一条设置命令即可在所有编码代理中同时安装这些技能。因此,Antigravity、Claude Code、Cursor、Codex 等工具都能通过一次安装获得相同的 ADK 专业能力:

# 第 2 步:构建 RAG 代理
打开你选择的编码代理并描述该代理:
```
1. 构建一个 RAG 代理,该代理能摄取文档,检索相关
2. 上下文,并引用来源回答问题。使用带有
3. Gemini 3.5 Flash 的 ADK agentic_rag 模板。
```
编码代理会激活其 ADK 技能并搭建完整的项目,如下图所示:

- Claude Code 使用 ADK agentic_rag 模板搭建了项目,并使用 Vector Search 作为数据存储。
- 随后它识别出模板缺乏引用支持,因此它重写了代理指令以要求带有内联引用的基于事实的答案,并修改了检索器以在每个文档中显示来源 ID。
- 它配置了数据存储,摄取了一个合成问答语料库(12 条关于 Python 基础的条目),并运行了冒烟测试。该代理返回了带引用的答案,并在检索服务关闭时正确拒绝产生幻觉。
注入的技能熟知检索增强代理的 ADK 模式,这也是为什么脚手架本身包含引用支持和 Vector Search 配置的原因。
# 第 3 步:本地测试
接下来,我们要求编码代理在 localhost 上启动 ADK Web UI:
```
启动一个本地开发服务器以便我进行测试。
```
这会启动一个交互式聊天界面,你可以在此使用真实查询测试该代理。这里有两点需要验证:

- 第一,它是否正确检索并引用?我们询问“如何合并两个字典?”,代理从语料库中提取了正确的上下文,逐步讲解了合并运算符和 update() 方法,并在行内附加了 [source: 1003]。引用功能正常。
- 第二,它是否正确处理缺失的上下文?我们询问“谁获得了 2022 年 FIFA 世界杯冠军?”,这是语料库中没有答案的问题。代理回应说它无法根据现有文档作出回答。
# 第 4 步:部署前评估
这是最重要的一步,也是大多数代理教程完全跳过的一步。
```
1. 为此 RAG 代理生成 20 个测试场景,涵盖正确的
2. 检索、代理应回答不知道的上下文不足情况、
3. 多跳问题以及引用准确性。运行
4. 完整的评估套件并向我展示结果。
```

编码代理在四个类别中生成了 20 个测试场景:

- 6 个用于正确检索(语料库可以回答的问题)
- 5 个用于上下文不足(它应拒绝回答的问题)
- 5 个用于多跳推理(需要多个文档的问题)
- 4 个用于引用准确性。
Karpathy 特别指出了这一差距,并表示运行代理的团队中有 89% 设置了可观测性,但只有 52% 拥有评估机制。Agents CLI 允许你通过单个提示生成并运行完整的评估套件。
结果:

- 引用准确性在全部 20 个案例中完美达到 1.00。代理从未伪造来源。
- 但幻觉分数标记了一个边缘情况,即对于语料库之外的问题,代理有时会附加通用知识,而不是说它没有足够的上下文。评估将此追踪到指令中的一行内容(“如果你已经知道简单问题的答案,你可以直接回复而无需使用工具”),从指令中删除该行即可解决此问题。
# 第 5 步:部署到 Agent Runtime
```
将此部署到 us-central1 的 Agent Runtime。
```

编码代理首先通过添加部署入口点和基础设施配置,为 Agent Runtime 增强了项目。
然后它将代理部署到了 Google Cloud,整个过程耗时约 2-3 分钟。
Cloud Trace 默认启用,因此从第一次部署的请求开始就内置了可观测性。
# 第 6 步:注册到 Gemini Enterprise
此时,代理已部署并正常工作,但仅构建它的开发者可以访问。
任何其他想要使用它的人都需要端点 URL、正确的 API 凭证,以及足够的上下文来知道该代理的存在。

在大多数团队中,这就是有用的代理悄无声息消亡的地方。它们能用,但构建者圈子以外的人既不知道它们的存在,也无法访问它们。
要求代理执行以下操作会将应用注册到 Gemini Enterprise 平台,使其在整个组织的 Gemini Enterprise 应用内部可被发现:
```
将此代理注册到 Gemini Enterprise。
```

任何拥有内部文档并希望可搜索的团队,都可以访问同一个知识助手,而无需设置自己的 RAG 管道。IAM 控制着谁可以访问它,企业仪表板则提供完整的可观测性。
正如 Karpathy 所描述的那样,这就是拥有趁手工具后的代理工程的样子。
通过一个终端会话和六个自然语言提示,代理从一个空文件夹变成了整个组织可用的生产级助手。
你可以在这里找到 GitHub 上的 Agents CLI →
这里是 ADK 文档 →
以及代理平台 →
👉 轮到你了:你当前的 RAG 设置中最大的痛点是什么,你希望能将其自动化解决吗?
感谢阅读,也感谢 Google Cloud 与我们合作今天的内容!
## 相关链接
- [Akshay](https://x.com/akshay_pachaar)
- [@akshay_pachaar](https://x.com/akshay_pachaar)
- [52K](https://x.com/akshay_pachaar/status/2070860837448040832/analytics)
- [Google’s Agents CLI](https://github.com/google/agents-cli)
- [You can find the Agents CLI on GitHub here →](https://fandf.co/43Ys2m6)
- [Here’s the ADK documentation →](https://adk.dev/)
- [And here’s the Agent Platform →](https://cloud.google.com/gemini-enterprise/agents)
- [9:24 PM · Jun 27, 2026](https://x.com/akshay_pachaar/status/2070860837448040832)
- [52.2K Views](https://x.com/akshay_pachaar/status/2070860837448040832/analytics)
- [View quotes](https://x.com/akshay_pachaar/status/2070860837448040832/quotes)
---
*导出时间: 2026/6/28 15:08:33*