[KongchangAI]
· 3 min read· 1,601 words

Spring AI 2.0 in Practice: A Java Developer's Guide to Agent Development

Spring AI 2.0 in Practice: A Java Developer's Guide to Agent Development

Spring AI 2.0 builds the Agent ecosystem foundation, enabling Java developers to systematically get started with AI application development.

Turing Classroom instructor Xu Shu demonstrates the Spring AI 2.0 Agent development path through an airline intelligent customer service project. The core point is that the biggest update in 2.0 is the Agent ecosystem foundation, so Java developers no longer need to cobble frameworks together. The course clarifies the boundaries among Tools, MCP, and Skill and demonstrates ticket refunds, route planning, and a travel butler. Xu Shu believes what determines an AI application's quality is not model benchmark scores but outer-layer AI engineering such as prompt, tool, and skill design; the Java ecosystem can already support lightweight Agents, multi-Agent systems, ReAct, and Graph orchestration.

Title

Spring AI 2.0 in Practice: A Java Developer's Guide to Agent Development

Meta Description

Based on Turing Classroom's Spring AI 2.0 hands-on course, this article maps out the complete path for Java developers to build AI Agents with Tools, MCP, and Skill, including an airline intelligent customer service demo and framework selection advice.

Article Content

The release of Spring AI 2.0 finally lets Java developers escape the "patchwork" experience of Agent development. In a public class, Turing Classroom instructor Xu Shu stated plainly that the biggest update in 2.0 is the construction of the Agent ecosystem—previously, building Agents on Spring AI often required stacking Alibaba's Agent framework on top with extensive modifications, but now the foundation and ecosystem have their most basic implementations.

This class runs through an "airline intelligent customer service" project, threading together Tools, MCP, memory, Skill, and Agent development. For Java programmers who have never touched AI application development, it offers a relatively complete entry path.

From Traditional Systems to Conversational Interaction

The starting point of the course demo is a traditional airline service system: refunds require clicking buttons, rebooking requires finding menus and pages. Xu Shu's approach to the transformation is to introduce a conversational layer, letting users directly say "Hi, please help me cancel my ticket," and having the AI indirectly invoke the cancel_booking business method within the system.

This method requires two parameters: booking number and name. The AI proactively asks the user for them, and once the user supplies them, the call is completed, changing the status from "Booked" to "Cancelled."

Overall AI application demo

This example highlights a key shortcoming of large models: they cannot call your system's APIs on their own. To make a large model "perceive the outside world," Tools are essential. Xu Shu defines Tools as the way large models communicate with their own systems, and this is precisely a common need across many industry scenarios—in healthcare, education, and government systems, novice users frequently can't find feature entry points, and intelligent customer service can both guide them and perform operations on their behalf.

Tools, MCP, Skill: Three Boundaries to Keep Clear

The most easily confused part of the course is the division of labor between Tools and MCP. Xu Shu gives a clear distinction: Tools are for your own system's API methods, while MCP is for external methods.

In the demo, after cancelling a ticket, the user wants to plan a road trip from Chongqing to Qingdao. The system calls the route planning capability in a preconfigured Baidu Maps MCP Server and returns the complete route. This step demonstrates precisely MCP's ability to connect to external services.

Refund status change demo

Skill is another layer of concept. The "personal travel butler" in the course can plan destination travel itineraries for the user's trip. Xu Shu describes it as a "skill"—one that can be freely cultivated and also used to maintain prompts in a more standardized way. Together, the three form the foundational tech stack of an AI application.

Itinerary planning demo

MCP (Model Context Protocol) is an open protocol proposed by Anthropic at the end of 2024, aimed at standardizing how large models connect to external data sources and tools. It defines a client-server architecture: MCP Server exposes resources (such as files, databases, API capabilities), and MCP Client (usually built into AI applications or IDEs) invokes them according to the protocol. Compared with writing separate adapter code for each external service, MCP allows the same Server to be reused by any model or Agent that supports the protocol, much like a "USB interface for the AI world." The Baidu Maps MCP Server in this article is a typical example: it encapsulates route planning capability as a standard MCP tool, and a Spring AI application only needs configuration to call it, without knowing the details of the Baidu Maps API.

Should Java Programmers Switch to AI?

Midway through the course, Xu Shu addresses a question many listeners care about: if Java programmers want to enter the AI industry, must they switch careers?

His answer points in two directions. First, "vibe coding," i.e., using tools like Codex and Claude Code to let AI boost your own development efficiency—describe requirements clearly in Markdown and hand them to AI for generation. Second, becoming an AI application development engineer.

He emphasizes in particular that the benchmark score gaps among today's mainstream large models are no longer large. What determines whether an AI application is good or not is not the large model itself, but the layer of "AI engineering" around it—how well prompt engineering, Tools, MCP, and Skill are provided, and the AI application's self-evolution capability, whether it gets smarter with use.

Discussion comparing mainstream models

On technology selection, Xu Shu names several practical frameworks: Spring AI suits lightweight Agents and chatbots; LangChain4j and Spring AI Alibaba can support multi-Agent systems, ReAct autonomous planning and reasoning, and Graph-based Workflow orchestration, and also facilitate implementing Harness Engineering. His judgment is that the Java ecosystem was a blank slate two or three years ago, but now it is fully capable of AI application development.

ReAct (Reasoning + Acting) is an Agent paradigm that lets large models alternate between "reasoning" and "acting." The model first outputs a thought process (Thought), decides which tool to call (Action), observes the tool's returned result (Observation), then continues reasoning based on the result, looping until it gives a final answer. It enables Agents to autonomously decompose multi-step tasks rather than generating an answer in one shot. Graph workflow orchestration models an Agent's execution process as a directed graph: nodes represent processing steps (such as calling a model, executing a tool, or making a conditional judgment), and edges represent flow direction. Compared with ReAct's implicit loop, Graph orchestration makes processes more controllable, observable, and debuggable, suitable for complex enterprise-level business. LangChain4j and Spring AI Alibaba both provide support for these two types of capabilities; the Harness Engineering mentioned in this article is engineering governance of the Agent runtime framework built on this foundation.

Pragmatic Advice on InBainbone and Fine-Tuning

At the beginning of the course, Xu Shu gives a somewhat conservative assessment of InBainbone: it uses Kotlin, which domestic developers are not yet comfortable with; for Agent development, choices like Spring AI and Spring AI Alibaba are more convenient, and there's no need to simply follow the hype. He mentions that he introduced InBainbone when version 0.1 was released, but actual domestic usage remains very low.

On fine-tuning, his positioning is: large models only possess general information from network training, not enterprise vertical business knowledge, and fine-tuning can "store" enterprise data on the base model side. But he also admits that fine-tuning is not used very much right now.

Fine-tuning refers to continuing training a pretrained large model with the enterprise's own domain data, updating the model parameters so it acquires vertical business knowledge. Common approaches include full-parameter fine-tuning and parameter-efficient fine-tuning (such as LoRA). Its advantage is that inference doesn't require attaching large amounts of context, resulting in more stable responses; its limitations are higher cost, complex data preparation, and less flexible knowledge updates than RAG. RAG (Retrieval-Augmented Generation) does not change model parameters; instead, when a question is asked, it first retrieves relevant documents from a knowledge base, splices them into the prompt, and then hands them to the model for generation. The two have different roles: fine-tuning leans toward "internalizing capabilities and style," while RAG leans toward "attaching real-time knowledge." This article mentions that fine-tuning can "store" enterprise data on the model side, but due to cost and maintenance issues it is not widely used in practice, which is why RAG is also included in the knowledge scope to be covered.

A Reusable Learning Path

Breaking down the content of this class, the path for Java developers to get started with AI applications is roughly: first understand how Tools let models call internal APIs, then understand how MCP connects to external services, then use Skill to standardize prompt and skill management, and finally integrate everything on the Agent foundation of Spring AI 2.0. RAG was not covered in class due to time constraints, but it is included in the knowledge scope to be covered.

For Java programmers still watching from the sidelines, the core message of this class is straightforward: don't feel you have no place just because large models are powerful. The real differentiation lies at the engineering layer—the design of prompts, context, tools, and skills—and these are precisely the capabilities Java engineers can accumulate.

One-line Summary

Spring AI 2.0 builds the Agent ecosystem foundation, enabling Java developers to systematically get started with AI application development.

Paragraph Summary

Turing Classroom instructor Xu Shu demonstrates the Spring AI 2.0 Agent development path through an "airline intelligent customer service" project. The core point is that the biggest update in 2.0 is the construction of the Agent ecosystem foundation, so Java developers no longer need to cobble frameworks together. The course clarifies the boundaries among Tools (calling your own system APIs), MCP (connecting to external services), and Skill (standardizing prompts and skill management), and demonstrates scenarios such as ticket refunds, route planning, and a travel butler. Xu Shu believes that what determines whether an AI application is good is not large model benchmark scores, but outer-layer AI engineering capabilities such as prompt engineering and tool and skill design; the Java ecosystem can already support lightweight Agents, multi-Agent systems, ReAct, and Graph orchestration. He also offers pragmatic advice on InBainbone and fine-tuning, and outlines a learning path from Tools to Agent integration.

#Spring AI 2.0#Java AI Agent development#MCP#Tools#Skill#AI application development
Share:

Related articles