Skip to content

Building a Research Agent Tutorial

This tutorial walks you through building a complete KAI-Flow research agent step by step.

Step 1: Create a New Workflow

  1. Open Workflows from the sidebar.
  2. Click Create Workflow.
  3. Enter the workflow name as Research Agent.

Step 2: Add Required Nodes

From the Node Sidebar, drag the following nodes onto the canvas:

  1. Start (Default category)
  2. OpenAI Chat (LLMs category)
  3. Tavily Search (Tools category)
  4. React Agent (Agents category)
  5. End (Default category)

Step 3: Configure Credentials

If credentials are not already configured:

  1. Navigate to the Credentials page.
  2. Add an OpenAI credential using your API key.
  3. Add a Tavily credential using your API key.

Step 4: Configure the OpenAI Chat Node

  1. Double-click the OpenAI Chat node.
  2. Select your OpenAI credential.
  3. Choose the model: gpt-4o.
  4. Set Temperature to 0.7.
  5. Save the configuration.

Step 5: Configure the Tavily Search Node

  1. Double-click the Tavily Search node.
  2. Select your Tavily credential.
  3. Set Max Results to 5.
  4. Enable Include Answer.
  5. Save the configuration.

Step 6: Configure the React Agent Node

  1. Double-click the React Agent node.
  2. Set the following system prompt:

    Text Only
    You are a helpful research assistant. Use the search tool to find accurate, 
    up-to-date information. Always cite your sources and provide 
    comprehensive answers.
    
  3. Save the configuration.

Step 7: Connect the Nodes

Create the following connections between nodes:

  1. Start → React Agent (trigger)
  2. OpenAI Chat → React Agent (llm → llm)
  3. Tavily Search → React Agent (tool → tools)
  4. React Agent → End (response → input)

Step 8: Test the Agent

  1. Click the Chat button in the bottom-right corner.
  2. Enter the prompt:

    Text Only
    What are the latest developments in AI?
    
  3. Observe how the agent searches and generates a response.

  4. Review the execution trace to inspect the agent’s reasoning.

Step 9: Save and Activate

  1. Click Save in the toolbar.
  2. Toggle the workflow status to Active.
  3. Your research agent is now ready to use.