Spring AI Alibaba Graph in Practice: Building a Full-Process HR Recruitment Agent

Build a full HR recruitment Agent using Spring AI Alibaba Graph with workflow orchestration and human-in-the-loop.
This tutorial demonstrates how to build an enterprise-grade HR recruitment Agent using the Spring AI Alibaba Graph framework. It covers the complete recruitment workflow—from résumé parsing and candidate screening to intelligent question generation and offer delivery—while implementing key enterprise patterns like human-in-the-loop mechanisms and time-travel state rollback. The project spans 20 core technical concepts, providing Java developers a practical path to mastering AI Agent development.
Why the Workflow Approach Is the Mainstream Choice for Enterprise-Grade Agents
In the wave of AI applications going into production, many developers still list nothing more than "intelligent chatbots" and "RAG-based Q&A" on their résumés—projects that have become thoroughly commoditized. As shared by Bilibili content creator Xu Shu, what enterprises in vertical domains actually need in large quantities are Workflow-based AI Agent applications.
The Workflow approach means that developers pre-define the overall execution path and let the AI operate within a predetermined framework. The core value of this design is: maintaining controllability of the AI application while preserving the inherent flexibility of AI. Compared to Autonomous Agents that let large models make decisions entirely on their own, the Workflow pattern is better suited to enterprise scenarios that demand strict result stability.
The distinction between these two technical approaches in the AI Agent space is crucial. Autonomous Agents, represented by AutoGPT, revolve around the idea of letting large models autonomously decompose tasks, invoke tools, and perform decision reasoning—with virtually no human intervention throughout the execution process. This pattern excels at open-ended exploratory tasks but faces serious controllability problems in enterprise settings: the model may hallucinate, execution paths are unpredictable, and results are difficult to reproduce. This is unacceptable in domains like financial risk management and medical diagnosis, where determinism is paramount. The Workflow approach borrows ideas from traditional BPM (Business Process Management), decomposing business processes into clearly defined nodes and edges. Each node can be an LLM call, a tool execution, or a human approval step, while the transition logic between nodes is pre-defined by the developer. This pattern of "deterministic skeleton + intelligent filling" has become the standard paradigm in mainstream AI application platforms like Dify and Coze.

Why do enterprises favor this model? Because virtually every industry has a large volume of repetitive work. Previously, these processes required significant manpower to execute. Now they can be orchestrated through Agents for automated processing, dramatically reducing repetitive manual labor. Whether in finance, manufacturing, or other industries, there are abundant workflows that can be automated—and these represent the true direction for enterprise vertical Agent deployment.
HR Recruitment Full-Process Agent: A Reusable Industry Template
This tutorial uses an HR Recruitment Full-Process Agent System as the hands-on project. The choice of the recruitment scenario is no accident—it has extremely strong universality and transferability.

This system can free HR professionals from tedious repetitive work like résumé screening and interview scheduling, allowing human resources to focus on higher-value tasks. More importantly, this Agent system can be applied to any industry—regardless of your sector, you can package similar automated workflows into your own résumé, giving you a competitive edge over job seekers who can only build AI chatbots.
The Complete Recruitment Automation Workflow
The entire Agent's execution flow is designed to be quite comprehensive:
- Résumé Submission & Parsing: After a candidate submits their résumé, the system automatically parses it. This step typically involves text extraction from unstructured documents like PDFs and Word files, followed by structured information extraction via a large model, pulling key fields such as name, work experience, and tech stack into standardized JSON data.
- Initial Screening: Preliminary filtering based on hard criteria like years of experience and age. This step is essentially a rule engine's job—it doesn't need to call an LLM but instead uses preset business rules for deterministic evaluation, ensuring 100% predictable screening results.
- Position Scoring: Combining current job requirements to comprehensively score a candidate's technical capabilities and project experience. This is where the LLM truly adds value—through carefully designed Prompts, the large model acts as a senior technical interviewer, providing quantified scores across multiple dimensions including technical depth, project complexity, and role fit.
- Intelligent Question Generation: Dynamically generating interview questions of corresponding difficulty based on the candidate's level (junior, mid-level, senior developer). This personalized question strategy avoids the "one-size-fits-all" interview approach, ensuring candidates at different levels receive appropriate assessments.
Human-in-the-Loop: A Critical Design for Enterprise-Grade Agents
The most noteworthy technical design in this system is the Human-in-the-Loop mechanism, also known as "checkpoint and resume."

After the system generates interview questions and sends them to the candidate, the entire workflow pauses and waits until the candidate submits their answers before continuing with subsequent steps. This design reveals an important reality about enterprise-grade Agents: not all processes can be fully automated—many steps actually require human intervention.
Human-in-the-loop is not a new concept born in the AI Agent era. It originates from the Active Learning paradigm in machine learning, referring to embedding human decision nodes within automated workflows so that humans can make judgments, perform reviews, or supplement data at critical junctures. In Agent workflows, the technical implementation of this mechanism typically relies on a "checkpoint and resume" architecture: when the workflow reaches a node requiring human intervention, the system persists the complete current state (including context variables, completed node information, intermediate computation results, etc.) to a database or message queue, then suspends the current thread. When the human operation is completed and results are submitted, the system restores state from persistent storage, injects the human input into the context, and continues executing subsequent nodes. This design not only solves the asynchronous waiting problem but also naturally supports processes spanning long durations—for example, a recruitment process might span days or even weeks, and the system needs to reliably maintain state throughout that period.
This design philosophy is crucial in real-world business applications. In the recruitment process, filling in interview question answers and recording the results of in-person first, second, and third-round interviews all require human participation.

The system scores answers after each round of interviews and supports manual submission of interview results. Ultimately, if the candidate meets the requirements, the system automatically generates an offer and sends it to the candidate, completing the entire recruitment loop. This hybrid model of "automated processing + human confirmation at key nodes" represents the current best practice for enterprise-grade Agent deployment.
Time Travel: The State Rollback Capability of Graph Architecture
Beyond the human-in-the-loop mechanism, this system also implements a Time Travel feature—essentially "state rollback."
When a workflow is halfway through execution and you need to "undo" and restart from a specific node, state rollback makes it possible. This is a major advantage of the Graph architecture—since the entire execution process is modeled as a directed graph structure with every node's state recorded, you can flexibly roll back to any historical node and re-execute from there.
Graph architecture models an Agent's execution flow as a DAG (Directed Acyclic Graph) or directed graph structure. This concept was first systematically proposed and implemented in the LangGraph framework. In this architecture, each Node represents an atomic operation—it could be LLM inference, a data query, or a conditional check. Each Edge represents the transition relationship between nodes, which can be unconditional jumps or condition-based branch routing. Compared to traditional Chain-based execution, the core advantage of Graph architecture lies in its support for loops, branching, parallel execution, and state backtracking. State rollback is possible precisely because graph structures inherently possess topological memory—state snapshots before and after each node's execution are recorded in the state graph, allowing developers to specify rollback to any historical node. The system automatically restores that node's input state and re-executes the subsequent path.
For enterprise applications, this capability is tremendously significant. When an automated process deviates or business rules change, there's no need to rerun the entire process from scratch—you simply roll back to the problem node. This dramatically improves system fault tolerance and maintainability. Consider a concrete scenario: if HR discovers incorrect scoring criteria during the position scoring phase and needs to adjust weights before rescoring, a traditional linear process would require rerunning everything from résumé parsing onward. With Graph architecture state rollback, you simply step back to the scoring node, modify the parameters, and re-execute the scoring and subsequent steps—all preceding résumé parsing and initial screening results can be directly reused.
20 Core Technical Concepts: Mastering Spring AI Alibaba Graph Through One Project
The entire project covers 20 technical concepts of Spring AI Alibaba Graph in a connected walkthrough, with the goal of helping developers quickly master Agent application development under the Graph framework through a single complete project.
Spring AI is an AI application development framework officially launched by Spring in late 2023, designed to provide Java developers with AI development capabilities on par with LangChain. It supports unified integration of multiple large models, Prompt template management, vector database integration, and other core features. Spring AI Alibaba is Alibaba's enhanced version built on top of it, deeply integrating the Tongyi Qianwen model family, Alibaba Cloud's Bailian platform, and mainstream domestic vector databases and middleware. Its Graph module draws design inspiration from LangGraph but has been redesigned for the Java ecosystem, fully leveraging Spring's dependency injection, AOP aspect-oriented programming, and event-driven features. For Java engineers—who make up the vast majority of enterprise developers in China—this means there's no need to learn Python or migrate tech stacks. They can build production-grade AI Agent applications within familiar Spring Boot projects. The pragmatism of this technical choice is an easily overlooked yet critically important factor in enterprise-grade AI deployment.
Career Insights for Java Developers
The value of this tutorial lies not only in the technology itself but also in the clear career upgrade path it provides. In an era of severe AI application homogeneity, being able to showcase an enterprise-grade Agent project with controllable workflows, human-in-the-loop mechanisms, and state management capabilities is undoubtedly more convincing than yet another cookie-cutter intelligent chatbot project.
For Java developers who want to demonstrate hands-on AI capabilities on their résumés, mastering Workflow-based Agent development combined with a domestic framework like Spring AI Alibaba Graph represents a direction with both technical depth and practical deployment value. The AI Agent market is currently at a critical turning point from proof of concept to production deployment. While the Python ecosystem holds advantages in AI research and prototype development, the Java ecosystem still possesses irreplaceable maturity in areas like enterprise application deployment, operations, performance optimization, and team collaboration. Building AI capabilities on a tech stack you're already familiar with, rather than blindly chasing technology trends, may be a more pragmatic and sustainable career strategy.
Related articles

AI Beginner's Guide: Three Stages to Building Your Own Personal AI Assistant from Scratch
No tech background? No problem. This beginner's guide maps out a 3-stage path to building a personal AI assistant — from prompt engineering to no-code automation to API calls.

Zero to Vibe Coding in Seven Days: A Complete Beginner's Guide to AI Programming
A beginner's guide to Vibe Coding: learn the 6-step path covering Claude Code, Cursor, Codex, prompt engineering, and project practice to build products with AI.

Tailcat: Tailscale's Official Decentralized Minimalist Networking Solution
Tailcat is Tailscale's official decentralized networking project that strips control plane dependencies, offering self-hosting users a more autonomous, privacy-focused WireGuard mesh experience.