Skip to main content
A research agent that searches the web using the Tavily API and asks users follow-up questions to refine its research. Combines createWebSearchTool with createAskUserTool for interactive, source-cited research.

Create the tools

Define the agent

How it works

  1. The agent receives a research question
  2. If the question is ambiguous, it uses ask_user to clarify — the workflow suspends until the user responds
  3. The agent searches the web with web_search (each search suspends for approval when approval: "always" is set)
  4. It may perform multiple searches to gather comprehensive information
  5. The final answer includes source URLs from the search results

Run it

Requires a Tavily API key set as TAVILY_API_KEY in your .env file.
Open http://localhost:5173 to view your agents and workflows, run them from the UI, and see execution traces. Python example on GitHub | TypeScript example on GitHub