Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreWe are happy to announce the 1.0.0 Milestone 5 release of Spring AI
As usual, this release has had several new features and bug fixes, however we have put a focus on reviewing the code base from a design perspective with the aim to go GA in early 2025. While we have tried to make this transition smooth, by deprecating methods and classes for one release cycle, there are some breaking changes we know about and perhaps some that we don’t, so please bear with us. See the section on Breaking Changes below.
MCP is a game-changer for building interactive applications with AI tools and resources. It enables you to create applications that are both fast and flexible, leveraging AI to act on your local data as well as services hosted in the cloud.
While currently incubating outside of Spring AI, we're excited to announce the experimental release of Spring AI MCP version 0.20, a Java SDK for the Model Context Protocol (MCP). This project provides seamless integration between Java/Spring applications and MCP-compliant AI resources and tools.
For more details on the architecture and implementation, visit the Model Context Protocol documentation. Examples of using MCP with Spring can be found in our spring-ai-examples repository.
// Prepare the audio resource
var audioResource = new ClassPathResource("speech1.mp3");
// Create a user message with audio and send it to the chat model
String response = chatClient.prompt()
.user(u -> u.text("What is this recording about?")
.media(MimeTypeUtils.parseMimeType("audio/mp3"), audioResource))
.options(OpenAiChatOptions.builder()
.withModel(OpenAiApi.ChatModel.GPT_4_O_AUDIO_PREVIEW).build())
.call()
.content();
And here's how to generate audio output from text:
// Generate an audio response
ChatResponse response = chatClient
.prompt("Tell me a joke about the Spring Framework")
.options(OpenAiChatOptions.builder()
.withModel(OpenAiApi.ChatModel.GPT_4_O_AUDIO_PREVIEW)
.withOutputModalities(List.of("text", "audio"))
.withOutputAudio(new AudioParameters(Voice.ALLOY, AudioResponseFormat.WAV))
.build())
.call()
.chatResponse();
// Access the audio transcript
String audioTranscript = response.getResult().getOutput().getContent();
// Retrieve the generated audio
byte[] generatedAudio = response.getResult().getOutput().getMedia().get(0).getDataAsByteArray();
For comprehensive information about the new RAG architecture and implementation details, check out our updated documentation. For hands-on experience, explore practical RAG implementations in these example applications.
ChatClient
with typesafe responses (#1729)Check out our Kotlin examples to see these features in action.
ChatClient
APIs for null-safety and predictability (#1651)ChatOptions
/FunctionCallingOptions
(#1994)FunctionCallback.Builder
interface (#1732)BiFunction
class type resolution (#1588)The most blatant breaking change is changing the package name for each vector store implementation. Unfortunately, they were all using the same package name but were in different independent artifacts which is a no-no.
So, MilvusVectorStore
has moved from org.springframework.ai.vectorstore
to org.springframework.ai.vectorstore.milvus
There has been an alignment in the use of the builder pattern across many classes, but focused on the vector stores and chat options.
MilvusVectorStore vectorStore = MilvusVectorStore.builder(milvusServiceClient, embeddingModel)
.initializeSchema(true)
.build();
Other breaking changes include:
Document
now supports only a single instance of text or media content. This makes the flow of the injection pipeline with embedding simpler ot reason about. Similarly, the previously deprecated embedding field of Document
has been removed. (#1883)
Changed TokenCountBatchingStrategy
constructor parameters (#1670)
There were other refactoring, bug fixing, documentation enhancements across the board by a wide range of contributors. If we haven’t gotten to your PR yet, we will, please be patient. Thanks to
We did not get to all the design refactoring we wanted in the M5 release, so are going to create one last M6 release in early January2025 to address those issues, followed by a 1.0.0 RC1 and a 1.0.0 GA release as soon as possiblle.
Design areas of focus are
This has been an amazing year for Spring AI. We are grateful to our community for their support and contributions. Looking forward to an even more exciting year in 2025!