Using Spring AI 1.0.0 M7 Released

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

We are excited to announce the release of Spring AI 1.0.0 Milestone 7. This will be the last milestone release. Next month will be the RC1 release followed quickly by a GA release in time for the Spring IO conference in Barcelona.

To celebrate this release, we have added a new song to our AI-generated music playlist featuring lyrics by Josh Long and Claude! Check out the latest track to enhance your blog reading and coding experience.

Here are the key changes in this release. Note, there are breaking changes!

Breaking Changes

Spring AI 1.0.0-M7 introduces several important changes that align with the structural improvements previously introduced in the SNAPSHOT versions. These changes create a more modular and maintainable codebase while reducing unnecessary dependencies in your applications.

Artifact ID Changes

The most significant change is the naming pattern for Spring AI starter artifacts:

  • Model starters: spring-ai-{model}-spring-boot-starterspring-ai-starter-model-{model}
  • Vector Store starters: spring-ai-{store}-store-spring-boot-starterspring-ai-starter-vector-store-{store}
  • MCP starters: spring-ai-mcp-{type}-spring-boot-starterspring-ai-starter-mcp-{type}

Package Changes

Some classes have moved to new packages to better reflect their domain responsibilities:

  • KeywordMetadataEnricher and SummaryMetadataEnricher moved from org.springframework.ai.transformer to org.springframework.ai.chat.transformer
  • Content, MediaContent, and Media moved from org.springframework.ai.model to org.springframework.ai.content

Your IDE should easily be able to handle these refactorings.

New Module Structure

As detailed in the Core Architecture Improvements section above, the project has been restructured from a monolithic core into specialized domain modules.

This modular approach allows you to include only the functionality you need, resulting in smaller deployments and clearer boundaries between components.

Importantly, this change should not be a breaking change if you use the Spring AI starters since they now import the new modular dependencies automatically. Only applications that directly referenced the previous monolithic artifacts will need to update their dependencies.

ToolContext Changes

The ToolContext class has been enhanced to support both explicit and implicit tool resolution, with tools only included in model calls when explicitly requested.

Additional Resources

For more details on these changes, refer to:

There are two ways to update your projects to Spring AI 1.0.0-M7:

  1. Use the Claude Code CLI tool tool with this prompt. You can use other AI assistant tools as well, but we have only tested using Claude Code. Note that this automated approach handles artifact ID changes, package relocations, and module structure changes, but does not yet include automatic changes for upgrading to MCP 0.9.0.

  2. Refer to the Upgrade Notes for detailed instructions, including guidance on manually updating MCP-related code.

Core Architecture Improvements

  1. Comprehensive Modular Architecture

    • Completely restructured the project from a monolithic core into specialized domain modules, providing:
      • Reduced Dependency Footprint: Applications only need to include the modules they actually use
      • Minimized Transitive Dependencies: Fewer conflicts with third-party libraries
      • Cleaner Separation of Concerns: Each module has a well-defined responsibility

    Spring AI Dependencies

    • spring-ai-commons: Foundation module with no dependencies on other Spring AI modules
      • Core domain models (Document, TextSplitter, etc.)
      • JSON utilities and resource handling
      • Structured logging and observability support
    • spring-ai-model: Builds on commons to provide AI capability abstractions
      • Interfaces like ChatModel, EmbeddingModel, and ImageModel
      • Message types and prompt templates
      • Function-calling framework (ToolDefinition, ToolCallback)
      • Content filtering and observation support
    • spring-ai-vector-store: Unified vector database abstraction
      • VectorStore interface for similarity search
      • Advanced filtering with SQL-like expressions
      • SimpleVectorStore for in-memory usage
      • Batching support for embeddings
    • spring-ai-client-chat: High-level conversational AI APIs
      • ChatClient interface
      • Conversation persistence via ChatMemory
      • Response conversion with OutputConverter
      • Advisor-based interception
      • Synchronous and reactive streaming support
    • spring-ai-advisors-vector-store: Bridges chat with vector stores for RAG
      • QuestionAnswerAdvisor: injects context into prompts
      • VectorStoreChatMemoryAdvisor: stores/retrieves conversation history
    • spring-ai-model-chat-memory-*: Specialized persistence implementations
      • Cassandra, Neo4j, and JDBC implementations
    • spring-ai-rag: Comprehensive framework for Retrieval Augmented Generation
      • Modular architecture for RAG pipelines
      • RetrievalAugmentationAdvisor as main entry point
      • Functional programming principles with composable components
  2. Modular Autoconfiguration

    • Replaced the single monolithic autoconfiguration artifact with individual autoconfiguration artifacts per component:
      • Model autoconfiguration: spring-ai-autoconfigure-model-{model}
      • Vector Store autoconfiguration: spring-ai-autoconfigure-vector-store-{store}
      • MCP autoconfiguration: spring-ai-autoconfigure-mcp-{type}
    • This change minimizes dependency conflicts with libraries like Google Protocol Buffers and gRPC
    • Applications now only include the autoconfiguration for components they actually use
    • These autoconfiguration artifacts are included transitively when using the corresponding starter dependencies
  3. Package Reorganization

    • Strategic relocation of classes to better reflect their domain responsibilities:
      • KeywordMetadataEnricher and SummaryMetadataEnricher moved from org.springframework.ai.transformer to org.springframework.ai.chat.transformer
      • Content, MediaContent, and Media moved from org.springframework.ai.model to org.springframework.ai.content
    • Improved package naming conventions for better discoverability and organization
  4. Framework Enhancements

    • Added AOP proxy support to MethodToolCallbackProvider for more flexible integration
    • Enhanced runtime hints configuration for JSON serialization to improve native image support
    • Improved Spring Boot integration with standardized configurations
    • Enhanced observability and metrics collection across all modules

Upgrade to MCP 0.9.0

Spring AI 1.0.0-M7 integrates the latest MCP reference implementation Java SDK version 0.9.0, bringing significant architectural improvements:

  • Session-Based Architecture: Improved handling of multiple concurrent client connections with better isolation between sessions
  • Exchange-Based Interactions: New exchange objects provide context-aware interactions between clients and servers
  • Enhanced Transport Provider Abstraction: Cleaner separation between connection management and communication handling
  • Improved Tool Management: Better tool name handling and de-duplication to avoid conflicts in complex scenarios
  • Simplified Server Configuration: Streamlined API for configuring and managing MCP servers
  • Comprehensive WebFlux and WebMvc Support: Enhanced transport providers for both reactive and servlet-based applications

These improvements result in a more robust, scalable MCP implementation that better aligns with the MCP specification. For detailed migration guidance, refer to the Upgrade Notes section on MCP Java SDK changes.

All examples in the Spring AI Examples repository have been updated to work with the latest MCP implementation.

New and Enhanced Model Integrations

  1. Anthropic Claude Updates

    • Added support for Claude 3.7 Sonnet model and made it the default
    • Enhanced with "thinking" capability (THINKING and REDACTED_THINKING blocks)
    • Renamed function-related APIs to tool-related APIs for consistency
    • Added support for custom HTTP headers in Anthropic API requests
    • Improved options with equals, hashCode, and deep copy support
  2. Mistral AI Enhancements

    • Added moderation model support for detecting potentially harmful content
    • Implemented custom structured output with JSON schema capabilities
    • Enhanced safety features and content filtering
  3. Ollama Improvements

    • Added min_p parameter for improved sampling control
    • Added support for qwq model
    • Added support for LLAMA3_2_3B model
  4. Azure OpenAI Updates

    • Enhanced AzureOpenAiChatOptions
    • Fixed auto-configuration opt-in behavior
    • Improved integration with Azure services
  5. OpenAI Enhancements

    • Changed voice parameter to string in OpenAI Audio Speech API
    • Added missing audio formats for OpenAI Audio API
    • Enhanced OpenAiChatOptions with equals, hashCode, and deep copy features

Docker Model Runner Support

Spring AI 1.0.0-M7 adds support for Docker Desktop 4.40's Model Runner, providing a seamless integration with locally running AI models:

  • OpenAI-Compatible API: Docker Model Runner provides a local Inference API designed to be compatible with the OpenAI API, enabling easy integration with Spring AI
  • Standard OCI Artifacts: Models are distributed as standard OCI artifacts on Docker Hub under the ai namespace
  • Multiple Configuration Options:
    • Direct TCP connection to the Model Runner
    • Integration via Testcontainers for development and testing
  • Simple Configuration: Just configure the OpenAI client with a custom base URL:
    spring.ai.openai.api-key=ignored
    spring.ai.openai.base-url=http://localhost:12434/engines
    spring.ai.openai.chat.options.model=ai/gemma3
    
  • Full Feature Support: All Spring AI features including function calling, streaming, and more work with Docker Model Runner
  • Local Model Execution: Run models locally on Apple Silicon without sending data to external services

For detailed information, check out the Spring AI Docker Model Runner documentation and our accompanying blog post Spring AI with Docker Model Runner that dives deeper into this integration.

Special thanks to Eddú Meléndez for his significant contributions to this feature.

Tool and Multimodal Capabilities

  1. Tool Execution Framework

    • Introduced ToolExecutionEligibilityPredicate interface
    • Improved tool de-duplication by name in MCP server
    • Enhanced error handling in MCP tool callbacks
    • Standardized MCP tool name formatting
  2. Multimodality Support

    • Support for base64-encoded images in tool call results
    • Handling of base64-encoded images in JSON responses
    • Enhanced image conversion capabilities
    • Support for custom MIME types in tool responses
  3. Document Processing

    • Added JSoup HTML document reader for web content parsing
    • Enhanced document formatting capabilities
    • Added documentFormatter parameter to ContextualQueryAugmenter

Memory and Storage

  1. Chat Memory Implementations

    • Added JDBC implementation of ChatMemory
    • Migrated Cassandra chat memory implementation to its own module
    • Added Neo4j chat memory implementation
  2. Vector Store Enhancements

    • Added Couchbase vector store support
    • Removed assertions on partition key path in CosmosDBVectorStore
    • Enhanced Milvus vector store with native expressions
    • Added configuration options for database collections in Milvus
    • Conditional enablement of individual vector store implementations
    • Enhanced PgVectorStore with PgIdType based schema generation

Query Processing

  1. Retrieval Augmentation
    • Added Context Support to Query in RetrievalAugmentationAdvisor
    • Removed default temperature on all QueryTransformer implementations
    • Enhanced context handling for improved relevance

Developer Experience

  1. Spring Boot Integration

    • Updated supported Spring Boot versions
    • Improved auto-configuration patterns
    • Added boot configuration processor to MCP autoconfiguration
  2. AOT and Native Image Support

    • Improved ahead-of-time compilation support
    • Enhanced runtime hints for native image compatibility
    • Comprehensive scan for JsonInclude annotations
  3. Documentation

    • Added upgrade notes for migrating to M7
    • Improved module documentation with architectural diagrams
    • Enhanced API documentation for new features

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