聊聊Spring AI 1.0.0-SNAPSHOT的变更

本文主要研究一下Spring AI 1.0.0-SNAPSHOT的变更

Artifact ID变更

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

示例

复制代码
<!-- BEFORE -->
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>

<!-- AFTER -->
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-starter-model-openai</artifactId>
</dependency>

Spring AI Autoconfiguration从单体模块变更为每个model、vector-store等独立的autoconfiguration,拆开的目的就是避免引入没必要的依赖,减少冲突风险:

复制代码
<!-- NO LONGER AVAILABLE -->
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
    <version>${project.version}</version>
</dependency>

取而代之的是:

  • Model autoconfiguration: spring-ai-autoconfigure-model-{model}

    org.springframework.ai spring-ai-autoconfigure-model-openai org.springframework.ai spring-ai-autoconfigure-model-anthropic org.springframework.ai spring-ai-autoconfigure-model-vertex-ai
  • Vector Store autoconfiguration: spring-ai-autoconfigure-vector-store-{store}

    org.springframework.ai spring-ai-autoconfigure-vector-store-redis org.springframework.ai spring-ai-autoconfigure-vector-store-pgvector org.springframework.ai spring-ai-autoconfigure-vector-store-chroma
  • MCP autoconfiguration: spring-ai-autoconfigure-mcp-{type}

    org.springframework.ai spring-ai-autoconfigure-mcp-client org.springframework.ai spring-ai-autoconfigure-mcp-server

Package Name变更

  • KeywordMetadataEnricher以及SummaryMetadataEnricher从org.springframework.ai.transformer变更到org.springframework.ai.chat.transformer
  • Content, MediaContent以及Media从org.springframework.ai.model变更到org.springframework.ai.content

Module变更

之前是所有的都在spring-ai-core,现在拆分到具体的领域模块来减少不必要的依赖,如下:

  • spring-ai-commons包含了核心的model比如DocumentTextSplitter
  • spring-ai-model包含了AI能力的相关抽象,比如ChatModelEmbeddingModelImageModelToolDefinitionToolCallback
  • spring-ai-vector-store统一了向量数据库的抽象VectorStore,提供了SimpleVectorStore便于内存使用
  • spring-ai-client-chat提供了high-level的AI会话API,比如ChatClientChatMemoryOutputConverter
  • spring-ai-advisors-vector-store为RAG衔接了chat和向量数据库,比如QuestionAnswerAdvisorVectorStoreChatMemoryAdvisor
  • spring-ai-model-chat-memory-cassandra提供了CassandraChatMemory
  • spring-ai-rag提供了RAG的pipelines,比如RetrievalAugmentationAdvisor

Dependency Structure变更如下:

  • spring-ai-commons (foundation)
  • spring-ai-model (depends on commons)
  • spring-ai-vector-store and spring-ai-client-chat (both depend on model)
  • spring-ai-advisors-vector-store and spring-ai-rag (depend on both client-chat and vector-store)
  • spring-ai-model-chat-memory-* modules (depend on client-chat)

小结

Spring AI 1.0.0-SNAPSHOT主要是涉及了Artifact ID, Package, Module的变更;Spring AI Autoconfiguration从单体模块变更为每个model、vector-store等独立的autoconfiguration,拆开的目的就是避免引入没必要的依赖,减少冲突风险;KeywordMetadataEnricher、SummaryMetadataEnricher、Content、MediaContent以及Media涉及了包名的变更;模块的变更将spring-ai-core拆分到具体的领域模块来减少不必要的依赖。

doc

相关推荐
深度研习笔记11 分钟前
OpenCV工业视觉实战11|多线程解耦+视频流稳流+推理加速,彻底解决卡顿阻塞,实现毫秒级工业实时检测
人工智能·opencv·计算机视觉
delishcomcn14 分钟前
AI视觉识别+分切算法:电化铝缺陷检测与裁切一体化解锁
人工智能·算法
触底反弹26 分钟前
深入理解大模型采样:Temperature、Top-K、Top-P 的原理与实战
人工智能·算法·面试
cd_9492172129 分钟前
2026 AI Agent 落地指南:除了搭建工具,你还需要配套的搜索基础设施
人工智能
武子康32 分钟前
Search Console Platform Properties 扩大 SEO 资产边界:从 Page Ranking 到 Topic Coverage(5 类误读边界 + 3 表数据层设计)
前端·人工智能·后端
大模型码小白33 分钟前
【Python零基础教程】继承、多态与魔法函数:面向对象编程三大核心特性详解
java·大数据·开发语言·人工智能·python·ai编程
麻雀飞吧1 小时前
最新量化学习路径,交易认知和技术实现要并行
人工智能·python
北辰alk1 小时前
我用Seed Evolving做了个“代码遗产抢救者”和“旅行规划师”——一个开发者的双面实战日记
人工智能
腾渊信息科技公司1 小时前
Spring Boot对接MES实战:视觉检测数据自动同步方案
java·人工智能·spring boot·后端·计算机视觉·ai·软件需求