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¶
- Open Workflows from the sidebar.
- Click Create Workflow.
- Enter the workflow name as Research Agent.
Step 2: Add Required Nodes¶
From the Node Sidebar, drag the following nodes onto the canvas:
- Start (Default category)
- OpenAI Chat (LLMs category)
- Tavily Search (Tools category)
- React Agent (Agents category)
- End (Default category)
Step 3: Configure Credentials¶
If credentials are not already configured:
- Navigate to the Credentials page.
- Add an OpenAI credential using your API key.
- Add a Tavily credential using your API key.
Step 4: Configure the OpenAI Chat Node¶
- Double-click the OpenAI Chat node.
- Select your OpenAI credential.
- Choose the model:
gpt-4o. - Set Temperature to
0.7. - Save the configuration.
Step 5: Configure the Tavily Search Node¶
- Double-click the Tavily Search node.
- Select your Tavily credential.
- Set Max Results to
5. - Enable Include Answer.
- Save the configuration.
Step 6: Configure the React Agent Node¶
- Double-click the React Agent node.
-
Set the following system prompt:
Text OnlyYou are a helpful research assistant. Use the search tool to find accurate, up-to-date information. Always cite your sources and provide comprehensive answers. -
Save the configuration.
Step 7: Connect the Nodes¶
Create the following connections between nodes:
- Start → React Agent (trigger)
- OpenAI Chat → React Agent (llm → llm)
- Tavily Search → React Agent (tool → tools)
- React Agent → End (response → input)
Step 8: Test the Agent¶
- Click the Chat button in the bottom-right corner.
-
Enter the prompt:
Text OnlyWhat are the latest developments in AI? -
Observe how the agent searches and generates a response.
- Review the execution trace to inspect the agent’s reasoning.
Step 9: Save and Activate¶
- Click Save in the toolbar.
- Toggle the workflow status to Active.
- Your research agent is now ready to use.