# Spring AI 2.1 Message Parts: Reasoning That Survives the Round Trip

DevFeed: [Spring AI 2.1 Message Parts: Reasoning That Survives the Round Trip](<https://devfeed.tech/articles/spring-ai-2-1-message-parts-reasoning-that-survives-the-round-trip-104419.md>)

Original publisher: [Read original article](<https://spring.io/blog/2026/10/28/spring-ai-message-parts-reasoning-replay>)

Author: dimitarproynov

Published: 2026-10-28T00:00:00Z

Content type: article

Language: en

Sources: [Spring](<https://devfeed.tech/sources/spring.md>)

Topics: [Spring AI](<https://devfeed.tech/topics/spring-ai.md>), [AI Context Management](<https://devfeed.tech/topics/ai-context-management.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [function calling](<https://devfeed.tech/topics/function-calling.md>), [Claude](<https://devfeed.tech/topics/claude.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [AI Chat](<https://devfeed.tech/topics/ai-chat.md>), [Chat completions endpoints](<https://devfeed.tech/topics/chat-completions-endpoints.md>), [Ollama](<https://devfeed.tech/topics/ollama.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [api](<https://devfeed.tech/tags/api.md>), [batch](<https://devfeed.tech/tags/batch.md>), [bedrock](<https://devfeed.tech/tags/bedrock.md>), [boot](<https://devfeed.tech/tags/boot.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [deepseek](<https://devfeed.tech/tags/deepseek.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [genai](<https://devfeed.tech/tags/genai.md>), [google](<https://devfeed.tech/tags/google.md>), [java](<https://devfeed.tech/tags/java.md>), [message](<https://devfeed.tech/tags/message.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [ollama](<https://devfeed.tech/tags/ollama.md>), [openai](<https://devfeed.tech/tags/openai.md>), [order](<https://devfeed.tech/tags/order.md>), [parts](<https://devfeed.tech/tags/parts.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [reasoning-models](<https://devfeed.tech/tags/reasoning-models.md>), [responses](<https://devfeed.tech/tags/responses.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [spring](<https://devfeed.tech/tags/spring.md>), [spring-ai](<https://devfeed.tech/tags/spring-ai.md>), [text](<https://devfeed.tech/tags/text.md>), [thinking](<https://devfeed.tech/tags/thinking.md>), [thought](<https://devfeed.tech/tags/thought.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

## AI overview

Spring AI 2.1 replaces messages' text-plus-side-lists model with ordered message parts, preserving reasoning, tool calls, media and provider payloads across requests and streaming. The key rules are to keep parts in order, replay each provider's payload unchanged, and persist parts rather than text. This matters because providers impose different requirements: Anthropic and Gemini can reject missing or altered thinking signatures; OpenAI Responses requires prior reasoning items and tool exchanges for replay; DeepSeek and Mistral require reasoning in certain tool loops. Cross-provider histories retain text and tool calls but do not forward another provider's signed reasoning. Spring AI Session stores complete parts and tool-loop rounds as JSON, while the older JDBC chat-memory repository stores only text and drops tool calls and results. Earlier histories lack reasoning parts, and custom storage must retain part attributes for Mistral and unsigned Bedrock reasoning replay.

## Source excerpt

Spring AI: Message Parts Doc | Upgrade Notes | OpenAI Responses Doc | Session Doc Reasoning models do more than think before they answer. They hand part of that thinking back to you and expect to get it back on the next request. Claude signs its thinking blocks. Gemini attaches thought signatures to its function calls. OpenAI's Responses API returns encrypted reasoning items. If you drop, reorder or edit them, the result ranges from an HTTP 400 to a model that quietly loses its earlier reasoning and starts over. Until now, a Spring AI message was a piece of text with side lists of tool calls and media. There was no place for that data, let alone its order. Spring AI 2.1 changes the data model itself: every message now holds its content as an ordered list of message parts. A part is one piece of a response, such as a run of text, a block of reasoning or a tool call. Providers call these pieces content blocks (Anthropic, Bedrock), parts (Gemini), items (OpenAI Responses) or chunks (Mistral), and Spring AI maps them all to message parts. With the 2.1.0-RC1 release candidate, the major chat models produce and consume parts: OpenAI Responses, Anthropic, Google GenAI, OpenAI Chat Completions, Ollama, Bedrock Converse, DeepSeek and Mistral AI. The release also adds Session memory, which persists them. This post covers the new abstraction, why the Responses API needed it, and what each chat model gains. It comes down to three rules: keep the order, replay what you were given verbatim, and persist the parts, not the text. Why a String Was Not Enough Here is what Claude, with thinking enabled, returns in a single tool-calling round: thinking "The user wants the weather in Paris. I should call get_weather..." signature: "EqQBCgIYAhIM..." text "Let me check that for you." tool_use get_weather {"location": "Paris"} When you send the tool result, Anthropic wants this turn back exactly as it was: same blocks, same order, signature included. Before 2.1, AssistantMessage could not d