Spring AI 2.0.0-M2 Release Notes
🎯 Highlights
This release includes 20 new features, 20 bug fixes, 16 documentation improvements, 38 other improvements.
⏪ Breaking Changes
- The Anthropic Skills API has been unified and helper classes have been renamed, which may require code changes if you're using the Anthropic integration directly #5299
- The SemanticCache interface has been relocated from the Redis-specific package to a more generic package location, which may require import statement updates for applications directly using this interface. #5284
- The Couchbase vector store classes have been relocated to a new dedicated package structure. Applications using Couchbase vector store will need to update their import statements. #5233
⚠️ Upgrading Notes
- If you are using the Anthropic Skills API directly, review your code for the renamed helper classes and update accordingly #5299
- If you are using the Couchbase vector store, update your import statements to reference the new dedicated package location. #5233
⭐ New Features
- Ollama embedding models now support configuring the dimensions parameter, allowing control over the size of generated embeddings 4bd83ba
- JSON schema can now be customized, providing more flexibility for structured output generation 3119086
- Default API endpoint paths are now configured for OpenAI's content moderation API, simplifying integration setup #5300
- Default API endpoint paths are now configured for OpenAI's audio API (speech and transcription), making it easier to use audio capabilities f7eeaf9
- Added support for using Amazon S3 as a vector store backend for storing and retrieving embeddings cd86d38
- Integrated Infinispan as a new vector store option, providing distributed in-memory data grid capabilities for embedding storage 9b105b8
- Added support for Amazon Bedrock Knowledge Base as a vector store, enabling integration with AWS's managed knowledge base service 21c3834
- Enhanced the Redis semantic cache module with improved functionality and performance 7233e8d
- Made the content field name configurable in QdrantVectorStore, allowing customization of the field used to store document content f65756e
- Added a convenience method to the Prompt class for easily retrieving system messages 8a79390
- Added native support for structured outputs using JSON schema validation in the Mistral AI chat model, enabling type-safe responses with automatic schema enforcement. 8757c5b
- OpenAI moderation, audio speech, and audio transcription API paths are now configurable, allowing customization for proxy setups or alternative OpenAI-compatible endpoints. 1d38aec
- Migrated to use Spring Boot 4's native MongoDB Atlas container support for improved testing and development experience. 5b39fbb
- Introduced Mcp*ServerCustomizer interfaces to allow customization of MCP server configurations #5261
- Added new Redis-based semantic cache advisor implementation, enabling intelligent caching of semantically similar queries to improve performance and reduce API calls 391cbbb
- OllamaChatOptions now implements StructuredOutputChatOptions with corresponding methods, unit tests, and integration tests. Enhanced JSON format handling for Ollama chat options 163df2e
- Improved model provider detection logic for Microsoft Foundry integration, providing better model identification and configuration support 5c18a40
- Add support for dynamic tool schema enhancement, allowing runtime modification of tool argument definitions for more flexible function calling 3c4b6dc
- Add conversationHistoryEnabled option to ToolCallAdvisor, providing finer control over whether conversation history is included in tool call contexts 5ad8485
- Add JSpecify annotations to commons module for improved null-safety analysis and compile-time verification #5101
🪲 Bug Fixes
- Resolved an issue where ToolCallAdvisor would not preserve system messages when memory functionality was disabled 1dac9d0
- Fixed incorrect observation provider usage in the Google GenAI embedding model implementation #5227
- Corrected conditional logic in Infinispan AutoConfiguration to ensure proper bean creation #5295
- Resolved issues in the MistralAiChatModelIT.chatClientEntityWithStructuredOutput integration test to ensure proper validation of structured output functionality. cf2212b
- Corrected code style violations in the spring-ai-redis-semantic-cache module to maintain code quality standards. 0108011
- Fixed MCP auto-configuration to work properly in non-web application contexts #5261
- Improved exception handling in the ChromaApi for better error reporting e291712
- Fixed failing Ollama integration tests by modifying tool descriptions to better guide the model in providing geographical coordinates 864487f
- Enhanced JdbcChatMemoryRepositorySchemaInitializer for improved database schema setup d202db1
- Corrected string parsing issues in the grammar implementation 8ecc334
- Corrected invalid Filter.Expression constructor usage in documentation examples #5243
- Resolved checkstyle violations in Redis auto-configuration code to maintain code quality standards 07ccd2c
- Resolved token count inconsistencies in Ollama integration tests that occurred with varying model versions c2dfedb
- Updated Anthropic integration tests to use the currently active model for improved test reliability 5982176
- Added explicit null safety check to prevent potential NullPointerException in Neo4jChatMemory MediaBuilder e4c2fb4
- Fixed missing dependency artifacts for Redis chat memory repository in the Bill of Materials, ensuring proper dependency management for projects using Redis-based chat memory. 81427bb
- Fixed an issue where the Neo4jVectorStore's doAdd method was ignoring the sessionConfig parameter, ensuring proper session configuration handling during document addition. #5200 via #5191
- Fixed an issue where chat memory advisors could not properly handle ToolResponseMessage types, improving compatibility with tool-based conversations #5174
- Resolve build issues with Antora documentation generation 95bf79a
- Corrected exception message validation in ChromaDB HTTP client/server communication 5dcac7b
📓 Documentation
- Updated documentation for Prompt-related functionality 190fe98
- Added documentation for the configurable content_field_name feature in Qdrant vector store 002a208
- Added documentation for the new configuration properties that allow customization of OpenAI speech, transcription, and moderation API endpoints. f8ad209
- Updated documentation to cover the native structured output converter functionality for Mistral AI models. a9f49a0
- Added comprehensive documentation for the new Redis semantic cache feature, including configuration and usage examples 77e115f
- Corrected duplicated step numbering in RetrievalAugmentationAdvisor documentation for improved clarity #5160
- General typo corrections throughout documentation 64de839
- Corrected typographical errors in the Gemini integration documentation. 5e397b5
- Added comprehensive documentation guide for using LLM as a Judge pattern for evaluating AI model outputs #5145
- Added documentation guide explaining how to implement dynamic tool discovery for runtime function calling capabilities #5141
- Add reference documentation for Anthropic Custom Skills integration ba49f4e
- Remove redundant /v1 suffix from OpenAI base-url examples in documentation for clearer configuration guidance d281da4
- Update incorrect comment in chat client code for accuracy #4891
- Corrected code syntax in chat options builder documentation example #4915
- Corrected typo in error message for ChromaDB collection existence validation #5080
- Updated OpenAI embedding model documentation reference in TokenCountBatchingStrategy Javadoc to point to current documentation #5083
🔨 Dependency Upgrades
- Updated the Model Context Protocol (MCP) SDK dependency to version 0.17.2 d81e47d
- Updated Spring Boot dependency to version 4.0.1 5f1e021
- Updated Mistral AI chat model enumeration to reflect latest available models b77202c
- Updated OpenAI Java SDK dependency to version 4.13.0, bringing latest improvements and compatibility updates #5187
🔩 Build Updates
- Updated static analysis tools NullAway and Error Prone to their latest versions for improved code quality checks d232c82
- Migrated S3 Vector Store to use JSpecify nullability annotations for improved null safety 24aeed5
- Made ResponseErrorHandler configurable as an optional bean for more flexible error handling daa08c8
- Added JSpecify nullability annotations to document-readers modules to improve null-safety and IDE support. #5287
- Added JSpecify nullability annotations to the RedisSemanticCache module for better null-safety guarantees. #5284
- Added JSpecify null-safety annotations to Redis, Weaviate, Typesense, Qdrant, Pinecone, pgvector, Oracle, OpenSearch, Neo4j, and MongoDB Atlas vector store modules to improve type safety and IDE support #5268
- Added JSpecify null-safety annotations to Milvus and additional vector store modules for improved type safety #5247, #5268
- Made RetryTemplate an optional bean for more flexible configuration 4f121c6
- Updated static analysis suppressions file to reflect current codebase state 1392dda
- Enhanced type safety with JSpecify annotations for Cassandra, Cosmos DB, Azure, and Spring Cloud Bindings modules #5226, #5212, #5213, #5207
- Introduced checkstyle check to ensure all packages include package-info.java documentation 9c734bf
- Reorganized checkstyle suppressions configuration to enable better progress monitoring 0d1ef71
- Enhanced type safety by adding JSpecify annotations to retry module, MCP annotations module, and MCP common module to improve null-safety guarantees. #5207
- Improved code quality by adding JSpecify annotations to CosmosDB, MongoDB, Neo4j, and Redis chat memory repository implementations for better null-safety handling. #5203
- Corrected test classification by moving integration-level test to proper IT test category, improving test organization and build process accuracy. #5208
- Added test coverage for JSpecify nullable field handling in JSON schema generation to ensure proper null-safety annotation support. 316b420
- Resolved issues with the Spring configuration metadata processor. 27a9da0
- Added comprehensive JSpecify annotations across multiple modules including Cassandra and JDBC chat memory repositories, vector store advisors, RAG module, test module, and core vector store module to improve null-safety and type checking. #5203, #5199, #5183
- General updates and improvements to the Neo4j vector store implementation. f3445d1
- Migrated chat-client and vector-store modules to use JSpecify nullability annotations for improved static analysis #5183
- Switched model module to use JSpecify annotations for better null-safety guarantees #5129
- Added JSpecify nullability annotations to newly created subpackages #5164
- Refactored embedding-related files into the model module for better code organization #5159
- Fixed Checkstyle plugin configuration to ensure proper code style enforcement 647a13f
- Improved cache update mechanism with a new implementation approach b104437
- Update CI workflows to use explicit save/restore cache actions for improved build performance and reliability bd56e0b
- Add workflow_dispatch to CI configuration enabling manual workflow execution for testing and troubleshooting #5102
- Make MongoDB starter optional for Testcontainers and Docker Compose modules, reducing required dependencies for non-MongoDB users 08fadd0
- Reworked multiple GitHub Actions workflows into a unified workflow for improved maintainability and consistency #5036
- Resolved GitHub Actions dispatch authorization issue bf5ebce
- Corrected GitHub Actions workflow to ensure commands run in proper git repository context c0246af
- Cleaned up test suite by removing ambiguous test case from ChatClient tools integration test 8909028
🙏 Contributors
Thanks to all the community contributors who made this release possible:
- Arjen Poutsma (@poutsma)
- chabinhwang (@chabinhwang)
- Daniel Garnier-Moiroux (@Kehrlann)
- Eddú Meléndez (@eddumelendez)
- Eric Bottard (@ericbottard)
- guanxu (@guanxuc)
- han-gyeong (@han-gyeong)
- Harrison (@HarrisonC118)
- HartLi (@Hart-Li)
- jiho lee (@destiny3912)
- Joey Surls (@jsurls)
- Julien Dubois (@jdubois)
- JunSeop (@LoperLee)
- Katia Aresti (@karesti)
- Kyle Kreuter (@KyleKreuter)
- lance (@leehaut)
- Manideepok (@Manideepok)
- matejnedic (@MatejNedic)
- Nicolas Krier (@nicolaskrier)
- Pilhwan Choi (@thisishwan2)
- sebin1213 (@sebin1213)
- Thomas Vitale (@ThomasVitale)
- Viacheslav Dobrynin (@viacheslav-dobrynin)
- Wenli Tian (@jamespud)
- Yanming Zhou (@quaff)
- Yokior (@Yokior)
- Yuriy Bezsonov (@ybezsonov)