[FEAT] Add `andChat` workflow step for multi-turn chat with Vercel AI SDK / useChat
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- ai, backend-api-design
Direzione di ricerca
Start with the existing andAgent workflow step, the /agents/:id/chat endpoint, and the Vercel AI SDK useChat integration described in the issue. Compare those entry points with the suspend/resume workflow flow and andThen plus streamText alternatives. Done means a workflow can host a multi-turn chat step, use the chat contract, receive workflow data, and pass typed completion data to the next step.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Workflows solve a lot of problems, but today there is no clean way to have multi-turn chat within a workflow step. Use cases include:
- An interview step that gathers details about a work item (multiple back-and-forth questions and answers).
- A guided process where a step prompts the user, processes that input, then produces a document or outcome—with transitions that are not always black-and-white.
Currently:
andAgentis single-turn: it usesgenerateObjectunder the hood, returns structured output when complete, and does not support streaming or tools (docs). So it cannot drive a real multi-turn conversation inside a workflow.- The Vercel AI SDK integration (docs) and
/agents/:id/chatendpoint work with agents only, not with workflows.useChatis built for agent chat. - The human-in-the-loop (HITL) pattern (suspend → wait for input → resume) can be used as a workaround: each user message could be sent as a workflow resume, run against an agent with a conversation ID, then the workflow decides whether to stay on that step or continue. But that forces the UI to speak two different “protocols”—workflow execute/suspend/resume and
data-*style events—instead of using the same/chat+useChatflow that works for standalone agents. Many UIs are built exclusively arounduseChatand the chat endpoint, so adopting HITL for multi-turn chat requires non-trivial UI changes.
So the problem is: workflows and the chat UX (Vercel AI SDK, useChat, /chat) don’t align for multi-turn conversation within a step. I’m currently using a custom workflow agent with hooks to load rules per step and respond in a chat interface, which works but would be a natural fit for Volt workflows if multi-turn chat were a first-class primitive.
Describe alternatives you've considered
-
Human-in-the-loop (HITL): Suspend the workflow at a step, run the “chat” bit outside (e.g. via an agent with a conversation ID), then resume with a decision to continue or stay. Each chat message would effectively be a workflow resume. This works but:
- The UI must handle workflow lifecycle (execute, suspend, resume) and possibly
data-*-style events, rather than using the same/chat+useChatflow as standalone agents. - More wiring and UI updates than a single “chat with this agent in this step” primitive.
- The UI must handle workflow lifecycle (execute, suspend, resume) and possibly
-
Custom workflow agent with hooks: A single agent that uses hooks to load step-specific rules and responds in a chat UI. This is what I use today; it works well but duplicates orchestration that Volt workflows already provide (steps, state, suspend/resume). An
andChat-style step would let the same workflow model drive both “interview” and “process + document” steps with one chat endpoint and one UI pattern. -
andThen+ manualstreamText/ chat: UseandThento call the agent’sstreamTextor chat API directly. That gives streaming/tools but no built-in notion of “this step is a multi-turn conversation” or of binding that step to the same/chat+ useChat contract that the rest of the app uses.
Additional context
- VoltAgent docs: Workflows overview, andAgent, AI SDK UI Integration, Suspend & Resume (HITL).
- Goal: Use Vercel AI SDK and the
/chatendpoint with workflows beyond HITL—i.e. multi-turn chat with a specific agent as a workflow step, so the same useChat-based UI can drive both standalone agents and workflow-driven conversations without switching to a different protocol (execute/suspend/resume + data-* events).
Describe the thing to improve
Add an andChat (or equivalent) workflow step that:
- Works like
andAgentin spirit (prompt + agent + step in the chain) but allows multi-turn conversation with that agent within the step, instead of a singlegenerateObjectcall. - Supports the same chat contract as standalone agents: Vercel AI SDK
useChat, streaming via the existing/chat-style contract, so the same UI can talk to either an agent or a “workflow step in chat mode” without special handling for workflow execute/suspend/resume. - Integrates with workflow state: The step can receive workflow data (e.g. from previous steps), and when the user (or the agent) signals “done with this step,” the conversation outcome (e.g. summarized answers, or a chosen option) is passed to the next step as typed data.
Concretely, that likely means:
- A new step type (e.g.
.andChat(...)) that registers a “chat phase” for a given workflow execution and step, bound to an agent and optional prompt/context from workflow data. - A way for the same
/chat(or a workflow-scoped variant) to route messages to that step when the request is tied to a workflow execution and step ID (e.g. viaconversationIdor options), so existing useChat + DefaultChatTransport code can target either an agent or a workflow step. - Clear semantics for “step done”: e.g. agent sends a structured tool call or special message, or the client sends a “complete” action, and the workflow then continues with the step output.
This would make workflows a natural fit for interview-style steps, guided forms, and other multi-turn flows while keeping the UI on a single, useChat-friendly chat endpoint.
- Lingua principale
- TypeScript
- Stelle
- 10.6k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VoltAgent/voltagent
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
VoltAgent/voltagent#1205 · 3 commenti · 6 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Elysia server provider test suite entirely broken — stale mocks after Node.js HTTP refactorAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
VoltAgent/voltagent#1204 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
VoltAgent/voltagent#1415 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di VoltAgent/voltagent
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
opengovsg/FormSG#10118 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ai-driven-qa bug claude
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
linagora/twake-calendar-frontend#1434 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add: MBC kr [Geo-blocked]Apertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
iptv-org/iptv#52824 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
jaegertracing/jaeger-ui#4512 ·
I maintainer di solito rispondono entro 1 giorno
-
area:ide documentation enhancement platform:macos platform:vscode
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
anthropics/claude-code#97389 ·
I maintainer di solito rispondono entro 1 giorno