Using Spring AI 1.0.0-SNAPSHOT: Part 2 - Important Changes and Updates
This blog post is a continuation of our previous article Using Spring AI 1.0.0-SNAPSHOT: Important Changes and Updates, where we introduced the significant changes to artifact IDs, dependency management, and autoconfiguration in Spring AI 1.0.0-SNAPSHOT. Since publishing that article, the Spring team has released an updates to the snapshots, In this follow-up article, we’ll explore the latest changes and provide additional guidance for developers working with the snapshot versions. For comprehensive details, refer to the Spring AI Upgrade Notes.Module Restructuring
As of April 4, 2025, the main branch has undergone significant changes to the module and artifact structure. Previously,spring-ai-core contained all central interfaces, but this has now been split into specialized domain modules to reduce unnecessary dependencies in your applications.
Package Name Changes
Some classes have moved to new packages:ContentFormatTransformerandKeywordMetadataEnrichermoved fromorg.springframework.ai.transformertoorg.springframework.ai.chat.transformerContent,MediaContent, andMediamoved fromorg.springframework.ai.modeltoorg.springframework.ai.content
New Module Structure
spring-ai-commons
Base module with no dependencies on other Spring AI modules. Contains:- Core domain models (
Document,TextSplitter) - JSON utilities and resource handling
- Structured logging and observability support
spring-ai-model
Provides AI capability abstractions:- Interfaces like
ChatModel,EmbeddingModel, andImageModel - Message types and prompt templates
- Function-calling framework (
ToolDefinition,ToolCallback) - Content filtering and observation support
spring-ai-vector-store
Unified vector database abstraction:VectorStoreinterface for similarity search- Advanced filtering with SQL-like expressions
SimpleVectorStorefor in-memory usage- Batching support for embeddings
spring-ai-client-chat
High-level conversational AI APIs:ChatClientinterface- 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 promptsVectorStoreChatMemoryAdvisor: stores/retrieves conversation history
spring-ai-model-chat-memory-cassandra
Apache Cassandra persistence forChatMemory:
CassandraChatMemoryimplementation- Type-safe CQL with Cassandra’s QueryBuilder
spring-ai-model-chat-memory-neo4j
Neo4j graph database persistence for chat conversations.spring-ai-rag
Comprehensive framework for Retrieval Augmented Generation:- Modular architecture for RAG pipelines
RetrievalAugmentationAdvisoras main entry point- Functional programming principles with composable components
Dependency Hierarchy
The new dependency structure follows this pattern:spring-ai-commons(foundation)spring-ai-model(depends on commons)spring-ai-vector-storeandspring-ai-client-chat(both depend on model)spring-ai-advisors-vector-storeandspring-ai-rag(depend on both client-chat and vector-store)spring-ai-model-chat-memory-*modules (depend on client-chat)
Migration Guide
To migrate your existing Spring AI applications:- If you are using the Spring Boot starters, you don’t need to do anything as you will pick up the new artifacts as necessary.
- Refactor imports for relocated classes (your IDE should assist with this)
- If using
spring-ai-coredirectly, replace with the appropriate new modules