Ask the User Before You Act: Human-in-the-Loop Questions for AI Agents with Spring AI
说明与用途
一个工作流,ByteChef AI 代理在执行任务前向用户提问,避免错误假设和返工。
问题
AI agents often act without user confirmation, leading to incorrect assumptions and rework.
结果
The workflow ensures agents only act after receiving explicit user answers, eliminating guesswork and rework.
工作流
- Receive chat request
- AI Agent calls AskUserQuestionTool with 1‑4 questions
- ByteChef sends questions to chat as ask_user_question event
- User answers via chat
- ByteChef resumes workflow with answers
- AI Agent generates plan and replies
证据
The Ask User Question Tool lets a ByteChef AI Agent stop and ask the user 1 to 4 multiple-choice questions before it acts.
When the agent calls the tool, ByteChef sends the questions to the chat as an ask_user_question event.
In a deployed workflow, the questions come with a resume URL and the workflow suspends. It isn't holding a thread. The run is persisted and can wait up to 30 days.
- 记录日期: 2026-11-02T01:29:07.184Z