Spring AI 2.0 GA: The control-plane shift that finally makes Java a first-class AI runtime
For Java teams building agentic AI, Spring AI 2.0 is the difference between gluing SDKs and running a governed pipeline: tool execution, memory, and observability can finally be placed where they can be audited and cost-controlled. The 34-64% token reduction and first-class MCP with load-balanced HTTP make production deployment viable, while the 42 breaking changes mean the upgrade decision is now tactical, not optional.
Spring AI 2.0 GA restructures how Java backends run AI agents. The tool-calling loop, previously buried inside each ChatModel implementation, is now a first-class citizen on the Advisor chain. That single architectural move turns an AI call from a black-box HTTP request into an assembleable pipeline where developers can insert memory, guardrails, retries, and cost controls at precise points. Official tests show token consumption drops 34-64% on OpenAI, Anthropic, and Gemini because tool definitions and loop management are no longer duplicated per model.
The release rides on Spring Boot 4.1, Framework 7, Jackson 3, and JDK 21 as the baseline, and it includes roughly 42 breaking changes. Tool annotations are renamed, options are immutable and replace rather than merge, temperature defaults are removed, and the provider count narrows from 20 to 7. MCP support moves from SSE to Streamable HTTP, making servers horizontally scalable. For teams running Spring AI 1.x, the migration path is explicit: new projects start on 2.0, old Boot 3 systems stay on the 1.x maintenance line, and anyone who must upgrade should isolate AI in a separate service.
The article also details production practices: ToolContext for server-side identity, eligibility checkers to cap tool-call loops, streaming rules that forbid retry after the first chunk, and Advisor ordering that determines whether you measure total user latency or per-call token cost. The message is that 2.0 gives Java the right hooks, but the actual governance — evaluation sets, cost baselines, security cut-points — still has to be built by the team.
The real win of 2.0 is not the token savings but that Java finally has a named place to put guardrails: before this, security and cost controls were either bolted on outside the model or written ad hoc inside services.
Removing the temperature default and changing Anthropic's maxTokens silently alters output behavior after upgrade; teams can't rely on monitoring alone, and A/B comparisons will surface the drift first.
The narrowing of providers from 20 to 7 signals a maturity cut: Spring AI stops pretending to be a universal adapter and focuses on the vendors where it can actually test and guarantee integration.
ToolContext being invisible to the model is a design pattern worth copying: any secret, identity, or non-negotiable parameter belongs in a channel the model cannot influence.
The explicit conversationId requirement is a small breaking change that eliminates a whole class of multi-tenant session bugs, which shows how deliberate the 2.0 team is about production semantics.
The 34-64% token reduction is attributed to removing per-model duplication, which implies that a significant share of token waste in 1.x came from framework overhead, not from model behavior.