Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[FEAT] Add `andChat` workflow step for multi-turn chat with Vercel AI SDK / useChat

Aperta
#1,007 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

enhancement
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:

  • andAgent is single-turn: it uses generateObject under 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/chat endpoint work with agents only, not with workflows. useChat is 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 + useChat flow that works for standalone agents. Many UIs are built exclusively around useChat and 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
  1. 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 + useChat flow as standalone agents.
    • More wiring and UI updates than a single “chat with this agent in this step” primitive.
  2. 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.

  3. andThen + manual streamText / chat: Use andThen to call the agent’s streamText or 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 /chat endpoint 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:

  1. Works like andAgent in spirit (prompt + agent + step in the chain) but allows multi-turn conversation with that agent within the step, instead of a single generateObject call.
  2. 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.
  3. 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. via conversationId or 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VoltAgent/voltagent

Tutte le issue di VoltAgent/voltagent

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.