今年の5月に Spring AI が GA になりました。
Springユーザーとして、既存のSpringによる実装を再利用したMCPサーバー化や、JavaでのLLMアプリケーション開発について、気になっている人は多いのではないでしょうか。
このセッションでは
・LLMアプリケーションフレームワーク選定の観点
・Spring AIの各機能について網羅的に解説
・サンプルアプリケーションによるデモ
について解説します。
JSON format. Do not include any explanations, only provide a RFC8259 compliant JSON response following this format without deviation. Do not include markdown code blocks in your response. Remove the ```json markdown from the output. Here is the JSON Schema instance your output must adhere to: ```{ "$schema" : "https://json-schema.org/draft/2020-12/schema", "type" : "object", "properties" : { "content" : { "type" : "string" }, "reason" : { "type" : "string" } }, "additionalProperties" : false }``` BeanOutputConverterに指定した クラスに則ったJSON Schemaを指定 してくれる
持ってないLLMにもある程度有効 ◦ モデルが提供するStructured Outputも使える • 100%のJSON出力を保証するものではない ◦ プロンプトで指定しているだけなので > The StructuredOutputConverter is a best effort to convert the model output into a structured output. https://docs.spring.io/spring-ai/reference/api/structured-output-converter.html
"return current date as String" ) public String getNow() { return LocalDateTime .now() .atZone(LocaleContextHolder.getTimeZone().toZoneId()) .toString(); }
public ToolCallback getCurrentDateTime() { return FunctionToolCallback.builder( "getCurrentDateTime", () -> LocalDateTime .now() .atZone(LocaleContextHolder.getTimeZone().toZoneId()) .toString()) .description("Get the current date and time in the user's timezone") .build(); }
SourceCode ◦ https://github.com/spring-projects/spring-ai • Spring AI Examples ◦ https://github.com/spring-projects/spring-ai-examples • Spring I/O Keynote ◦ https://www.youtube.com/watch?v=oUK1Np4OvnM • IK.AM: Java on Azure Day 2025で"Spring AIで学ぶMCPの活用"について話してきました。 ◦ https://ik.am/entries/858 • Grafana Labs: Auto-instrumenting a Java Spring Boot application for traces and logs using OpenTelemetry and Grafana Tempo ◦ https://grafana.com/blog/2021/02/03/auto-instrumenting-a-java-spring-boot-application-for-traces-and-logs-using-op entelemetry-and-grafana-tempo/ • Google Gemini SourceCode ◦ https://github.com/google-gemini/gemini-cli 57