Spring AI 2.0 in Practice: From Chatbots to Agent Development — A Complete Guide

Spring AI 2.0 adds native Agent capabilities and a Claude Code-inspired Agent Utils toolkit on top of its 1.0 foundation.
Spring AI 2.0 retains roughly 90% of its 1.0 content, with the core upgrade focused on a new native Agent layer: the framework now supports the fundamental Agent loop of autonomous reasoning, tool invocation, and iterative execution — no third-party extensions required. The community's Agent Utils library, inspired by Claude Code's engineering design, provides key modules including Ask User Question, Skills and task planning, and long-term memory, making it easy to build code generation assistants. A companion course covers the full path from basic conversation and streaming to MCP and Agent development, ideal for Java developers looking to get up to speed with Spring AI 2.0.
What's New in Spring AI 2.0
Spring AI 2.0 has been out for a while, and many developers are curious about what's actually changed from version 1.0. Based on a course by Bilibili creator Xu Shulai, there's one key point to clarify upfront: over 90% of the framework's content carries over from 1.0 — including ChatClient, ChatModel, Embedding, RAG, and integrations with major AI models. The underlying logic remains essentially the same.
What's genuinely worth your attention is the new Agent ecosystem layer introduced in 2.0. This represents a positioning upgrade: Spring AI is no longer just a framework for "calling LLMs + Tools to build chatbots" — it now has the foundational capability to build production-grade Agents.

Why Agent Support Is the Critical Upgrade
Before Spring AI 2.0, building a true Agent typically required relying on Spring AI Alibaba Agent Framework, an open-source extension from Alibaba. That framework added significant capabilities on top of Spring AI, including React Agent (autonomous planning and reasoning) and Workflow-based orchestrated Agent applications.
The significance of Spring AI 2.0 is that it now natively covers the most fundamental Agent capabilities: autonomous reasoning, tool invocation, action execution, and iterative looping until a task is complete. This means developers can build Agents directly on the official framework without depending entirely on third-party extensions.

This shift is especially meaningful for Java ecosystem developers. For a long time, AI Agent development was dominated by the Python ecosystem (e.g., LangChain). Spring AI 2.0 gives Java/Spring teams a way to participate using the tools and patterns they already know.
React Agent is one of the most mainstream architectural patterns in AI Agent development today. The name comes from the paper ReAct: Synergizing Reasoning and Acting in Language Models. Its core idea is to have the model go through a "Reason → Act → Observe" cycle at each step, rather than generating a complete answer all at once. Concretely, the model analyzes the current state relative to its goal, decides whether to call a tool (such as search, code execution, or a database query), observes the result, then re-reasons about the next step — repeating until the goal is reached. This architecture gives Agents the ability to handle multi-step, uncertain tasks, and it's the underlying logic behind the "autonomous reasoning, tool calls, iterative looping" description in Spring AI 2.0. The contrasting Workflow Agent pre-defines execution paths and is better suited for fixed, predictable processes — each has its appropriate use case.
Agent Utils: A Tool Library Reverse-Engineered from Claude Code
One of the most interesting angles in the course is the Agent Utils library provided by the Spring AI community. According to Xu Shulai, this toolkit was directly inspired by reverse-engineering Claude Code's implementation approach, which means the cost of building a code generation assistant on top of it is remarkably low.

The toolkit includes several representative capability modules:
Ask User Question
When the model detects that the prompt lacks sufficient information, it can proactively ask the user clarifying questions to fill in missing context. This is a critical step in moving an Agent from "passive responder" to "active collaborator" — instead of guessing, the model knows when to ask for clarification.
Skills and Task Planning
The toolkit supports a Skills mechanism along with task planning capabilities, enabling the Agent to decompose complex tasks into executable steps and work through them systematically.
Long-Term Memory
Beyond in-session short-term memory, the toolkit also supports long-term memory, allowing the Agent to retain and reuse information across sessions. This is essential for building truly production-ready assistants.

Claude Code is an AI programming assistant from Anthropic. Its key design distinction is that it's not a simple code completion tool — it's an autonomous coding Agent capable of reading and writing files, executing commands, and understanding project structure. It can actively explore codebases, break down tasks, invoke terminal commands, and continuously observe feedback and adjust its strategy during execution. "Reverse-engineering Claude Code's implementation approach" means that the Spring AI Agent Utils library drew from the design of the tool set Claude Code exposes externally — such as file read/write, Shell command execution, and requesting supplemental information from users — and ported that engineering abstraction into the Java/Spring ecosystem. Developers can quickly replicate similar code generation assistant capabilities without designing tool interfaces from scratch.
The Course Learning Path
The course is structured to progress from fundamentals to advanced topics, covering the complete chain:
- Basic LLM conversation
- Streaming output
- Memory mechanisms
- Tools and MCP (Model Context Protocol)
- Core capabilities of Spring AI Agent Utils
- A final hands-on project: building a code generation assistant
This "fundamentals + project" combination is well-suited for Java developers who want to systematically master Spring AI 2.0 in a reasonable amount of time. It's worth noting that if you want to dive deep into Spring AI's internals and source code, the creator's 1.0 series course covers those in detail and can serve as a complementary resource.
MCP (Model Context Protocol) is an open protocol proposed and championed by Anthropic to standardize how LLMs interact with external tools and data sources. Previously, different frameworks and models each had their own interfaces for calling external tools, requiring developers to write custom adapter logic for each model separately. MCP acts like a USB standard for hardware connectivity: as long as a tool or data service implements the MCP protocol, any MCP-compatible model client can invoke it directly, dramatically reducing ecosystem fragmentation. Spring AI 2.0's support for MCP means developers can seamlessly integrate third-party tools (such as database connectors or web search services) into their Agent applications without writing custom adapter layers for each one.
Recommendations for Developers
For developers already familiar with Spring AI 1.0, the upgrade to 2.0 has a relatively low learning curve — focus your energy on the newly added Agent ecosystem. For those just getting started, it's recommended to first solidify the fundamentals — ChatClient, RAG, Tools — before moving into Agent Utils. That foundation will give you a much more intuitive grasp of autonomous planning, tool invocation, and related mechanisms.
It's worth emphasizing that Agent development is fundamentally not about stacking API calls — it's about understanding the engineering design behind the "reason → act → observe" loop. Spring AI 2.0 has baked this capability into the framework itself, and that is precisely what makes it a meaningful evolution over version 1.0.
Related articles

Bilibili's Hit Dify Tutorial: A Practical Guide to Building 20+ AI Apps from Scratch
A distilled guide to Bilibili's top-rated Dify tutorial: Windows + Docker deployment, MySQL connection, five app types, model integration strategy, and publishing.

Agent Skills Beginner's Guide: From Concepts to Multi-Agent Collaboration in Practice
A comprehensive guide to Agent Skills: core concepts, components, the importance of Description, standardization, beginner learning paths, and multi-agent collaboration.

One Neuron Detects Both Cats and Cars? We Reproduced It and Found a New Explanation
The cat-car neuron reinterpreted: researcher Cammarata argues it distinguishes pointy from round, not cats from cars. We reproduced the experiment and found the new explanation holds on most inputs—but cars are the exception. The interpretability debate continues on language models.