/projects/agentworkflow
Agent Chain with Structured I/O
A Next.js AI SDK 6 demo where three ToolLoopAgents run in sequence: Research gathers sources, Expanded Research deepens the findings, and Synthesis turns the typed handoff into a final answer.
/projects/agentworkflow
A Next.js AI SDK 6 demo where three ToolLoopAgents run in sequence: Research gathers sources, Expanded Research deepens the findings, and Synthesis turns the typed handoff into a final answer.
Single-agent research demos often lose structure as soon as they scrape real sources. Findings become untyped text blobs, later stages cannot trust inputs, and the final synthesis has weak provenance.
Agent Chain with Structured I/O runs three sequential agents for discovery, expanded research, and synthesis. Each stage passes typed outputs forward through schemas and tool-specific evidence collection.
The core challenge is preserving useful source detail while keeping handoffs compact and valid. Discovery, scraping, expansion, and synthesis each need different prompts, tools, and data contracts.
The project demonstrates a practical pattern for agent pipelines: use models for judgment, tools for retrieval, and Zod schemas for stage boundaries so multi-step work remains inspectable.
This highlights Stefan's skill in AI SDK workflows, structured generation, web research agents, Exa/Cheerio retrieval, schema-governed handoffs, and practical agent product prototyping.
Agent Chain with Structured I/O demonstrates the smallest useful pattern for serious agent workflows: separate stages, typed outputs, retrieval tools, and inspectable handoffs.
Discovery, expanded research, and synthesis are separate because each stage has a different job. This keeps the first agent from over-summarizing and gives later stages reliable structured inputs.
Exa and Cheerio are used for evidence collection rather than letting the model hallucinate source context. Search, scrape, and crawl tools give each stage external grounding.
Zod contracts make handoffs explicit at runtime. That is critical because multi-agent chains fail silently when one stage returns prose where the next stage expects structured evidence.
Typed intermediate outputs make the workflow easier to inspect, replay, and render in a UI. The architecture favors practical product debugging over magical agent autonomy.
Pairs the visual workflow page with route handlers, so each agent stage can run server-side without a separate backend.
Keeps the canvas, stage status, traces, and final answer reactive as each agent finishes.
The workflow depends on typed handoffs, so compile-time structure helps prevent one stage from breaking the next.
Provides ToolLoopAgent, structured output, stop conditions, and streaming primitives in one agent-friendly API.
Used for reliable structured generation across the research, expansion, and synthesis agents.
Gives the research stages a high-signal discovery tool for web, Reddit, Wikipedia, and news sources.
Acts as the dependable scrape/crawl fallback when API-backed discovery is unavailable or too narrow.
Makes every agent output a runtime-validated contract, which is what keeps the chain stable.
Collects sources, topics, and initial findings before any deeper analysis runs.
Receives the first typed packet and adds more detail, sources, analysis, and recommendations.
Combines both prior structured outputs into a final answer with key points and next steps.
Search web, Reddit, Wikipedia, and news so the first two agents can gather external evidence.
Fetch and parse pages directly when search APIs do not provide enough page content.
Zod and Output.object force each stage to return the exact shape the next stage expects.