Spring AI 1.0.0 M8 Released

Releases | Mark Pollack | April 30, 2025 | ...

After reviewing our API design and deprecations post M7, we determined that several significant changes would become breaking changes in an RC1 release. Therefore, we've introduced this additional milestone to provide developers with a transitional release where deprecated APIs coexist alongside their replacements, enabling a smoother upgrade experience before RC1.

Here are the key changes in this release.

  • Upgrade Notes
  • You can automate the upgrade process to 1.0.0-M8 using an OpenRewrite recipe. This recipe helps apply many of the necessary code changes for this version. Find the recipe and usage instructions at Arconia Spring AI Migrations.

New Features

  1. Chat Memory Enhancements
  • Enhanced Chat Memory Architecture
    • Improved ChatMemory API for more flexible conversation history management
    • New ChatMemoryRepository interface allows different storage strategies
    • Added MessageWindowChatMemory for maintaining a window of messages
    • Improved property naming for consistency across implementations
    • Support for various storage backends:
      • InMemoryChatMemoryRepository (default)
      • JdbcChatMemoryRepository for relational databases
    • Refer to Memory Types and Memory Storage for more details on chat memory configurations.
  1. Template Rendering*
  • Introduce TemplateRenderer for prompt templating
    • A flexible new API for template rendering that provides a consistent interface across different template engines
    • Includes the new StTemplateRenderer with support for built-in functions and custom validation options. See how to use it here.
    • Integrated directly into the ChatClient for streamlined prompt templating
    • Added NoOpTemplateRenderer for cases where templating is not needed
    • Related: "Configure TemplateRenderer in ChatClient", "Update docs to mention NoOpTemplateRenderer"
  1. MCP Improvements
  • Enhanced MCP tool callback configuration
    • Added tool callback configuration to MCP client properties
    • Support for completion specifications in MCP server
    • Added instructions support to MCP server
    • Added SSE endpoint parameter to WebFlux and WebMvc transport providers
  1. Prompt Engineering Patterns
  • Add Prompt Engineering Patterns documentation
    • New comprehensive documentation on advanced prompt engineering techniques
    • Provides developers with best practices for effective prompt design
    • Includes examples and patterns for various use cases
  1. Vector Store Enhancements
  • Cosmos DB Entra ID support and fixes
    • Added Azure Entra ID (formerly Azure AD) authentication for Cosmos DB
    • Improves security and authentication options for Azure deployments
  • Cassandra Vector Store improvements
    • Fixed message order in Cassandra chat memory
    • Added better error messages and fixed various issues

Deprecations

The important deprecations to take note of are:

  1. Chat Client Enhancements:

    • The ChatClient has been updated to ensure user and system prompts are always rendered before advisor execution. This change replaces the AdvisedRequest and AdvisedResponse APIs with ChatClientRequest and ChatClientResponse.
  2. Prompt Templating and Advisors:

    • Classes and methods related to prompt creation and advisor customization are deprecated in favor of the builder pattern and the TemplateRenderer interface.
  3. QuestionAnswerAdvisor Deprecations:

    • Deprecated constructors and builder methods that relied on a simple userTextAdvise string.
  4. Chat Memory Configuration:

    • The spring.ai.chat.memory.jdbc.initialize-schema property is deprecated in favor of spring.ai.chat.memory.repository.jdbc.initialize-schema.
  5. Document Processing:

    • The DocumentPostProcessor API replaces deprecated APIs like DocumentCompressor, DocumentRanker, and DocumentSelector.
  6. Chat Memory Deprecations:

    • @Deprecated List<Message> get(String conversationId, int lastN); is deprecated in ChatMemory.

Contributors

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

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all