Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Build Recoverable Java Workflows with Spring AI and LangGraph4j

AI summary

A Juejin tutorial demonstrates how to combine Spring AI 2.1.0-RC1 with LangGraph4j in a Java project that separates model-driven conversation from reliable business-process execution. The first installment progresses from a minimal chat call to state graphs, conditional branching, persistence, interruption, recovery, and a tool-driven refund workflow that can continue after approval or a service restart. Streaming, subgraphs, HTTP/SSE, the complete refund assistant, and engineering validation are reserved for the next installment.

In-depth insight

The tutorial gives developers a concrete pattern for using checkpoints, state, and tool calls to implement inspectable and resumable Java workflows rather than relying on a model alone to advance business processes.

《Spring Ai 2.1 + LangGraph4j》系列教程(上):从零建项目到可恢复的 Java Graph

你可能已经用 Spring AI 写过一个聊天接口:接收一句话,调用模型,再返回一句话。接下来,用户希望助手查订单、申请退款、等待审批,还希望服务重启以后继续处理。此时需要同时解决两件事:让模型理解对话,让程序可靠地推进业务。

这个系列使用一个 Java 项目,把两件事逐步组合起来。先写最小聊天调用,再写第一张图,接着学习状态、条件分支、持久化和恢复,最后实现“聊天助手通过工具调用退款图”。

本文是上篇;下篇:流式、子图与完整退款助手继续讲解流式输出、子图、人工审批、HTTP/SSE 和工程化验证。

本项目不讲解AI Agent有关相关文章请参考过往文章:《Java + Spring 实现 Hermes Agent:从源码看多模型接入、子代理、人审与沙箱》、《从向量检索到混合搜索优化:Spring AI 2.0.1 + pgvector RAG 实战》

Some source content is omitted. Continue reading on the original site.

#Spring AI 2.1.0-RC1#LangGraph4j#Spring Boot 4.1.0#Java 25#Maven#FileSystemSaver#OfflineChatModel

Original · 30 min readRead the original
Group chat

No comments yet. Start the conversation.