Spring AI 2.0 in Practice: A Complete Guide to Building Agent Applications in Java

Spring AI 2.0 ships a native Agent foundation, letting Java developers build autonomous AI agents without third-party frameworks.
Spring AI 2.0's headline upgrade is embedding Agent capabilities directly into the framework itself, rather than depending on third-party extensions like Spring AI Alibaba for autonomous decision-making and iterative execution. Over 90% of the API is unchanged from 1.0, keeping the learning curve low. The new Agent ecosystem layer — demonstrated through a code generation assistant that reverse-engineers Claude Code's design via the Agent Utils library — covers proactive questioning, skill definition, task planning, long-term memory, and MCP protocol support, giving Java engineers a complete path from basic LLM calls to enterprise-grade Agent applications.
Spring AI 2.0: The Critical Upgrade from Chatbot to Agent Foundation
As large model application development enters deeper territory, AI development frameworks in the Java ecosystem are iterating rapidly. Bilibili creator Xu Shulai noted in his Spring AI 2.0 tutorial series that the most important update in Spring AI 2.0 isn't a refactoring of underlying APIs — it's the completion of a foundational Agent (intelligent agent) layer.
This is a shift worth paying attention to. In the 1.0 era, Spring AI was essentially just a "chatbot" framework capable of calling large models, combining Tools (function calling) and memory mechanisms to generate conversations. True Agent capabilities — autonomous reasoning, tool invocation, action execution, and iterative looping until task completion — previously required the open-source Spring AI Alibaba Agent Framework from Alibaba to achieve.
According to the tutorial's analysis, the Alibaba framework built extensive extensions on top of Spring AI, supporting ReAct Agents (autonomous planning and reasoning) as well as Workflow-based Agent applications capable of self-orchestrating execution paths. With the release of Spring AI 2.0, the framework itself now possesses the fundamental Agent capabilities without relying entirely on third-party extensions.

90% Carries Over from 1.0 — What's Truly New Is the Agent Ecosystem Layer
For developers already familiar with Spring AI 1.0, a key takeaway is this: over 90% of Spring AI 2.0's content is not fundamentally different from 1.0.
Whether it's ChatClient, ChatModel, formatted output, or how various large models are integrated — all of it remains consistent with 1.0. This means developers can migrate their existing knowledge seamlessly, dramatically reducing the learning curve.
What's genuinely new is the Agent ecosystem layer built on top of the existing foundation. This layer enables Java developers to build intelligent agent applications with autonomous decision-making capabilities using familiar Spring conventions. For those who want a deeper understanding of framework internals — including the underlying source code — revisiting the 1.0 course series is recommended, since that core logic remains unchanged.
This "incremental evolution" strategy is quite enterprise-friendly — teams can adopt new features without tearing down what already works.

Reverse-Engineering Claude Code with Agent Utils: Build a Code Assistant on a Budget
The most hands-on section of the tutorial is building a code generation assistant using Spring AI 2.0 + Spring AI Agent Utils.
Here's an interesting detail: this Agent utilities library directly reverse-engineered the design philosophy of Claude Code (Anthropic's AI programming tool). With this ready-made toolkit, developers can rapidly build a similar code generation assistant at minimal cost.
This "standing on the shoulders of giants" approach is representative of smart engineering: rather than designing Agent interaction logic from scratch, leverage the architecture of an already-validated, mature product. For Java engineers looking to quickly internalize Agent development patterns, this is a highly efficient learning path — one that teaches both Spring AI 2.0's new capabilities and practical usage of the Agent Utils library.

Core Capabilities of Agent Utils
Within this Agent utilities library, several key mechanisms deserve close attention:
- Ask User Question (proactive questioning): The large model proactively asks the user questions to fill in gaps where prompt information is insufficient. This is a key expression of Agent autonomy — when context is incomplete, the Agent solicits information rather than executing blindly.
- Skills (skill definition): Defines the capability units an Agent can invoke, with each Skill corresponding to a specific functional module.
- Task Planning: Enables the Agent to decompose complex tasks into executable steps, supporting multi-step automated workflows.
- Long-term Memory: Allows the Agent to retain key information across sessions, enabling more complex, persistent task scenarios.
Spring AI 2.0 Learning Path: A Complete Journey from Basics to Advanced
The full tutorial series follows a "progressive depth" pedagogical structure, covering the complete path from fundamentals to enterprise-grade deployment:
- Basic LLM Conversation: The most fundamental Q&A interaction — mastering ChatClient and ChatModel usage.
- Streaming Output: A key capability for improving user experience, enabling real-time typewriter-style responses.
- Memory Mechanisms: Giving conversations contextual continuity to support multi-turn dialogue scenarios.
- Tools Function Calling: Enabling large models to invoke external functions, extending AI's practical operational capabilities.
- MCP Protocol (Model Context Protocol): A standardized context and tool integration protocol that unifies how multiple models and tools connect.
- Spring AI Agent Utils in Practice: Entering true Agent development, including Ask User Question, Skills, task planning, long-term memory, and other advanced capabilities.
This path is thoughtfully structured — first solidifying the fundamentals of LLM invocation, then gradually transitioning to advanced Agent capabilities, and ultimately culminating in a complete hands-on code generation assistant project.

The AI Agent Opportunity for Java Developers
For a long time, the Python ecosystem dominated AI application development. But as Spring AI matures, Java developers are gaining an increasingly comprehensive native toolchain, enabling them to build complex AI Agent applications entirely within the familiar Spring ecosystem.
Spring AI 2.0's addition of an Agent foundation is most significant because it lowers the barrier for Java engineers entering the intelligent agent development space. Combined with extensions from frameworks like Spring AI Alibaba and tools like Agent Utils — which reverse-engineer proven products — the Java AI development ecosystem is forming a complete and cohesive methodology.
For Java engineers looking to build out their AI development capabilities, Spring AI 2.0 paired with hands-on Agent development is undoubtedly a worthwhile investment. Mastering the full stack from basic ChatClient calls to advanced Agent Utils applications will lay a solid foundation for building the next generation of intelligent agent systems.
Related articles

Insufficient Source Material to Generate a Valid Article
The provided source material is a single unrelated tweet with no AI or tech relevance — insufficient to support a complete, valid technical article.

Insufficient Source Material to Generate a Valid AI/Tech Article
This source material is a tweet about the ages of Underworld members — unrelated to AI or tech, and insufficient to support a full article.

Insufficient Material: Unable to Generate a Valid AI/Tech Article
The provided material is a condolence tweet about a San Diego mosque attack — unrelated to AI/tech and too limited to generate a valid technical article.