Spring AI 1.0 GA版本终于正式发布!第一个正式版本,超多内容,每个Java开发者都必须了解一下!
Spring AI全新Logo
核心功能包括支持20个AI模型的ChatClient
接口、适配20个向量数据库的检索模块、支持滑动窗口和向量搜索的对话记忆功能、基于@Tool
注解的工具调用机制,以及模型评估、可观测性和Model Context Protocol(MCP)支持。此外,新增RAG流水线、ETL框架、工作流驱动和自主代理功能,并提供与微软Azure、AWS、Google Cloud等云服务商的集成案例。
DocumentReader
支持本地文件、网页、GitHub、云存储(AWS S3、Azure Blob等)及数据库输入,内置分块、元数据 enrichment 和嵌入生成。QuestionAnswerAdvisor
和模块化RetrievalAugmentationAdvisor
,参考案例Retrieval Augmented Generation (R.A.G.) with Vector StoresMessageWindowChatMemory
通过滑动窗口存储最近N条消息,支持JDBC、Cassandra、Neo4j等持久化存储。VectorStoreChatMemoryAdvisor
基于向量搜索检索语义相似历史消息,参考案例《Guide to chat memory implementation》。@Tool
注解声明工具方法,支持动态注册Bean或编程式创建,可调用天气查询、数据库操作等外部功能,配套《Guide to local tool calling》。@Component
class DogAdoptionScheduler {
@Tool(description = "schedule an appointment to pickup or adopt a " +
"dog from a Pooch Palace location")
String schedule(int dogId, String dogName) {
System.out.println("Scheduling adoption for dog " + dogName);
return Instant
.now()
.plus(3, ChronoUnit.DAYS)
.toString();
}
}
RelevancyEvaluator
验证响应相关性,FactCheckingEvaluator
基于上下文校验事实准确性,Hugging Face专家指出“LLM作为裁判”的局限性(如模式崩溃、冗长偏见)。spring-ai-starter-mcp-client
快速连接MCP服务器,支持stdio和HTTP-SSE端点,示例连接Brave搜索引擎。spring-ai-starter-mcp-server
和@Tool
注解构建MCP服务器,集成Spring Batch/Cloud Config提供企业级工具,支持OAuth安全认证。这次 Spring AI 的正式发布,对于 Java 开发者来说,是一次重大的升级。它不仅提供了强大的 AI 能力,还提供了丰富的工具和框架,帮助开发者更轻松地构建 AI 应用。DD也一直有在用Spring AI,最近也会第一时间把项目升级到正式版本,如果遇到问题,再继续分享。
最后,做个小调研,你现在用什么框架来构建AI应用呢?
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有