Kaggle 与 Google 免费智能体 AI 课程笔记

作者:Bala Priya C,KDnuggets 特约编辑兼技术内容专家,2026 年 11 月 19 日,人工智能
我参加了 Kaggle 和 Google 开设的为期 5 天的 AI Agents 强化课程。该课程最初于 2025 年 11 月 10 日至 14 日以直播形式进行,现在已作为免费的自学课程在 Kaggle 上线。你可以按自己的节奏学习白皮书、实操代码实验室、播客和直播录像,探索 AI 智能体如何工作,以及构建它们需要什么。
单条提示词和单次响应很容易理解。而智能体在此基础上加了一个循环:模型选择一个动作、调用工具、读取返回的结果,然后决定下一步做什么。这个循环带来了一次性调用永远不会出现的问题:智能体如何记住上一轮,你怎么知道它选对了工具,以及当它不得不在你的 notebook 之外的地方运行时又会发生什么变化?
课程围绕这些问题展开。每天都会配一份白皮书和两个实操 notebook,基于 Gemini 和 Agent Development Kit(ADK)——Google 用于构建智能体的开源框架。你需要会 Python,并有一些调用大语言模型 API 的经验,但不需要任何智能体方面的前置知识。以下是我对其中亮点内容的笔记。本文涵盖:
如何判断一项任务何时需要智能体,以及把多个智能体连接起来的模式
工具与 Model Context Protocol(MCP)如何将智能体与外部世界连接起来
会话与记忆如何为智能体提供所需的上下文
如何衡量智能体质量,以及要在 notebook 之外运行智能体需要做些什么
构建第一个智能体并将多个智能体连接起来
第一天介绍智能体以及你可以用 ADK 构建的架构。第一个 notebook《从提示到行动》构建第一个智能体,第二个《智能体架构》则转向多个智能体协同工作的系统。
在 ADK 中,智能体是一个小型组合包:名称、模型、其他智能体可以读取的描述、设定其行为的指令,以及一个工具列表。运行器负责执行它。内存运行器适合实验,而任何真实场景都需要持久化运行器。
当一个智能体承担太多任务时,你会把工作拆分给多个智能体。课程涵盖了几种将它们连接起来的方式:一个父智能体选择调用哪个子智能体、一个顺序流水线、同时运行的并行分支,以及一个重复直到满足条件的循环。在顺序流水线中,每个智能体将其输出交给下一个。
我会优先采用流水线。它按固定顺序运行,因此失败会指向某一个阶段;而由模型在子智能体之间做选择时,需要追踪之后才能知道发生了什么。
工具让智能体能够做写文本之外的任何事情。课程涵盖四类。像 Google Search 这样的内置工具随模型提供。函数工具封装你自己的 Python 函数。智能体工具让一个智能体把子任务交给另一个智能体,同时保持对对话的控制。MCP 工具通过该协议连接外部服务,因此你无需为每一个服务编写自定义客户端。
模型仅根据描述来决定如何调用函数工具。这就是为什么最佳实践 notebook 把时间花在 docstring、类型提示和结构化返回值上:描述越清晰,错误调用就越少。
课程还涵盖了长时间运行操作的人工审批,即智能体会暂停并等待人工确认后再继续。我的经验法则是:当智能体选错了工具,先去读工具描述,再动提示词。
跨轮次与会话添加记忆
模型在两次调用之间不保留任何内容。每一轮智能体都必须重新发送对话历史,而这些历史会消耗 Token。ADK 中的记忆分为两部分。短期记忆就是会话,即对话历史,由会话服务管理。长期记忆位于会话之外,通过记忆服务进行检索,因此事实可以留存到下一次对话中。
记忆服务有多种形式。内存版按关键词检索,托管服务则可以按语义检索。随着会话增长,上下文压缩和缓存将成本与上下文大小都控制在可控范围内。这就引出了有效的上下文工程,即选择每一轮要把哪些内容放进模型的上下文中。
从长期记忆中检索有两种模式。在被动检索(reactive retrieval)中,智能体在自己决定时才去搜索记忆。在主动检索(proactive retrieval)中,系统在每一轮之前先进行搜索,并把结果交给智能体。主动检索每轮都要付出一次搜索成本,无需智能体主动请求就能把相关记忆交给它。被动检索则省下这笔成本,但依赖智能体自己知道何时该去查找。
理解智能体的质量与评估
智能体是非确定性的:相同的输入在下一次运行时可能走上不同的路径。事后的抽查无法覆盖这种情况,因此课程从一开始就把质量视为设计的一部分。智能体质量依赖于两项实践。
可观测性通过日志、追踪和指标记录发生了什么。追踪显示智能体采取的每一步,这使得错误答案可以在事后被调试。评估对两件事打分:最终响应,以及其背后的过程,例如智能体调用了哪些工具以及调用顺序。持续运行评估能及早发现回归。
对过程打分很重要,因为正确答案可能掩盖糟糕的路径。一个本只需调用一次正确工具却调用了三次的智能体,会返回相同的答案,但成本是原来的三倍。
让智能体走出 Notebook
最后一天涵盖演示成功之后会发生什么。由不同团队、使用不同框架和语言构建的智能体,需要一种共享的方式相互通信。Agent2Agent 协议提供了这样一种方式:一个智能体作为服务暴露出来,其他智能体通过读取其智能体卡片来了解它能做什么。
在部署方面,课程将智能体放到托管运行时 Vertex AI Agent Engine 上,并介绍 CI/CD 和 AgentOps 实践,以保持智能体在上线后持续运行。它还提到 ADK 除了 Python 之外,也可用于 Go 和 Java。课程以一个可选的顶点项目结束,在该项目中,你将利用上述各部分构建自己的智能体。
该课程涵盖如何构建智能体、如何赋予它工具和记忆、如何衡量它以及如何部署它。Notebook 涵盖使用 Google 的 ADK 进行实现,白皮书是很好的配套读物。实际上,你应该同时衡量智能体所走的路径和它返回的答案。一些进一步学习的资源:
Bala Priya 是一位常驻印度的开发者、教育者和技术作者。她撰写关于编程、数据科学、机器学习和 AI 的内容,专注于让复杂的技术概念变得实用且易于理解。她制作教程、操作指南和深度解析,帮助开发者构建、解决问题并理解复杂的技术概念。她的技术兴趣包括 LLM 应用、智能体式 AI、图算法、计算机视觉、可解释 AI 和机器学习系统。不写作或不编码时,Bala 通常会阅读经典文学、史诗奇幻或推想小说。她也喜欢谈论书籍、学习新事物,并与开发者社区分享所学。
译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(What I Learned From Kaggle + Google’s Free Agentic AI Course)
By Bala Priya C, KDnuggets Contributing Editor & Technical Content Specialist on November 19, 2026 in Artificial Intelligence

I took the 5-Day AI Agents Intensive Course from Kaggle and Google. The course originally ran live from November 10 to 14, 2025, and is now available as a free, self-paced course on Kaggle. You can work through the whitepapers, hands-on codelabs, podcasts, and recorded livestreams at your own pace, exploring how AI agents work and what it takes to build them.
A single prompt and a single response are easy to reason about. An agent adds a loop around that: the model picks an action, calls a tool, reads what came back, and decides what to do next. The loop brings questions that a one-shot call never raises. How does the agent remember the last turn, how do you know it picked the right tool, and what changes when it has to run somewhere other than your notebook?
The course works through those questions. Each day pairs a whitepaper with two hands-on notebooks built on Gemini and the Agent Development Kit (ADK), Google's open-source framework for building agents. You need Python and some experience calling a large language model API, but no prior knowledge of agents. These are my notes on what stood out. This article covers:
How to tell when a task needs an agent, and the patterns for wiring several together
How tools and the Model Context Protocol (MCP) connect agents to the outside world
How sessions and memory give an agent the context it needs
How to measure agent quality, and what it takes to run agents beyond a notebook
Building a First Agent and Wiring Several Together
The first day introduces agents and the architectures you can build with ADK. The first notebook, From Prompt to Action, builds a first agent, and the second, Agent Architectures, moves on to systems where several agents work together.
In ADK, an agent is a small bundle: a name, a model, a description that other agents can read, instructions that set its behavior, and a list of tools. A runner executes it. An in-memory runner is fine for experiments, and anything real needs a persistent one.
When one agent carries too many jobs, you split the work across several. The course covers a few ways to wire them together: a parent agent that chooses which sub-agent to call, a sequential pipeline, parallel branches that run at the same time, and a loop that repeats until a condition is met. In a sequential pipeline, each agent hands its output to the next.
I'd reach for the pipeline first. It runs in a fixed order, so a failure points at one stage, and a model choosing between sub-agents needs tracing before you know what happened.
Tools are what let an agent do anything beyond writing text. The course covers four kinds. Built-in tools like Google Search come with the model. Function tools wrap your own Python functions. Agent tools let one agent hand a subtask to another while keeping control of the conversation. MCP tools connect to outside services through the protocol, so you skip writing a custom client for each one.
The model decides how to call a function tool from its description alone. That is why the best-practices notebook spends its time on docstrings, type hints, and structured return values: the clearer the description, the fewer wrong calls.
The course also covers human approval for long-running operations, where the agent pauses and waits for a person to confirm before it continues. My rule of thumb: when an agent picks the wrong tool, read the tool description before you touch the prompt.
Adding Memory Across Turns and Sessions
A model keeps nothing between calls. On every turn the agent has to send the conversation history again, and that history costs tokens. Memory in ADK splits into two parts. Short-term memory is the session, the conversation history, managed by a session service. Long-term memory is outside the session and is searched through a memory service, so facts can survive into the next conversation.
The memory service comes in different forms. The in-memory version searches by keyword, and managed services can search by meaning. As a session grows, context compaction and caching keep both the cost and the context size under control. This brings us to effective context engineering, which means choosing what goes into the model's context on each turn.
Retrieval from long-term memory comes in two modes. In reactive retrieval, the agent searches memory when it decides to. In proactive retrieval, the system searches before every turn and hands the agent the results. Proactive retrieval costs a search per turn and gives the agent relevant memories without asking. Reactive retrieval saves that cost and depends on the agent knowing when to look.
Understanding Agent Quality and Evaluation
Agents are non-deterministic: the same input can take a different path on the next run. A final spot check cannot cover that, so the course treats quality as part of the design from the start. Agent quality rests on two practices.
Observability records what happened through logs, traces, and metrics. A trace shows each step the agent took, which makes a wrong answer debuggable after the fact. Evaluation scores two things: the final response, and the process behind it, such as which tools the agent called and in what order. Running evaluation continuously catches regressions early.
Scoring the process matters because a correct answer can hide a bad path. An agent that calls the right tool three times when once was enough returns the same answer and costs three times as much.
Taking an Agent Beyond the Notebook
The last day covers what happens after the demo works. Agents built by different teams, in different frameworks and languages, need a shared way to talk to each other. The Agent2Agent protocol provides one: an agent is exposed as a service, and other agents find out what it can do by reading its agent card.
On the deployment side, the course puts an agent on a managed runtime, Vertex AI Agent Engine, and introduces CI/CD and AgentOps practices for keeping agents running after launch. It also mentions that ADK is available for Go and Java as well as Python. The course closes with an optional capstone project, where you build an agent of your own from the pieces above.
The course covers how to build an agent, how to give it tools and memory, how to measure it, and how to deploy it. The notebooks cover implementation with Google's ADK, and the whitepapers are good companion reads. In effect, you should be measuring both the path an agent takes and the answer it returns. Some resources for further learning:
Bala Priya is a developer, educator, and technical writer based in India. She writes about programming, data science, machine learning, and AI, with a focus on making complex technical ideas practical and approachable. She creates tutorials, how-to guides, and deep dives that help developers build, solve problems, and understand complex technical concepts. Her technical interests include LLM applications, agentic AI, graph algorithms, computer vision, explainable AI, and ML systems. When she’s not writing or coding, Bala is usually reading classic literature, epic fantasy, or speculative fiction. She also enjoys talking about books, learning new things, and sharing what she learns with the developer community.
原文为英文,正文由自动抓取并保留原文。
原文发布于 KDnuggets(What I Learned From Kaggle + Google’s Free Agentic AI Course),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。