Skip to content

AI Agents

AI Agents are autonomous assistants that can use tools, search databases, call APIs, and make multi-step decisions to accomplish tasks. Unlike simple chatbots that just respond to messages, agents can take actions.

Flow-Like agents can:

CapabilityExample
Use toolsSearch databases, call APIs, run calculations
Make decisionsChoose which tool to use based on the question
Multi-step reasoningBreak down complex tasks into steps
Query dataRun SQL queries on your databases
Call your flowsExecute other Flow-Like flows as tools
Use MCP serversConnect to Model Context Protocol tools

An agent works in a loop:

┌────────────────────────────────────────────────────────┐
│ │
│ User Input │
│ │ │
│ ▼ │
│ Agent Thinks: "What do I need to do?" │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────┐ │
│ │ Tool Use? │ │
│ │ ├── Yes ──▶ Call Tool ──▶ Loop │◀─────┐ │
│ │ └── No ──▶ Final Response │ │ │
│ └───────────────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────┘

Use the Make Agent node:

Make Agent
├── Model: (your AI model)
└── Agent ──▶ (agent object)

Use Set Agent System Prompt to define behavior:

Set Agent System Prompt
├── Agent: (from Make Agent)
├── System Prompt: "You are a helpful assistant..."
└── Agent ──▶ (configured agent)

Example system prompt for an agent:

You are a data analyst assistant. You have access to tools for:
- Searching the company database
- Running SQL queries
- Generating charts
Always explain your reasoning before using a tool.
Summarize your findings after completing the task.

Tools give your agent capabilities. Flow-Like supports several types:

Turn any Flow-Like flow into a tool using Add Flow Tools:

Add Flow Tools
├── Agent: (your agent)
├── Flows: (select flows to expose as tools)
└── Agent ──▶ (agent with tools)

Creating a flow as a tool:

  1. Create a flow that performs a specific task
  2. Use clear, descriptive names for the flow
  3. Document inputs/outputs clearly
  4. Add it to your agent with “Add Flow Tools”

Connect to external tool servers using Add MCP Tools:

Add MCP Tools
├── Agent: (your agent)
├── MCP Server: (server configuration)
├── Mode: Automatic or Manual
└── Agent ──▶ (agent with MCP tools)

MCP Mode:

  • Automatic: Agent uses tools freely
  • Manual: Tools only run with user approval

Let your agent query databases with Add SQL Session:

Add SQL Session
├── Agent: (your agent)
├── Session: (DataFusion SQL session)
└── Agent ──▶ (agent with data access)

Enable step-by-step reasoning with Add Thinking Tool:

Add Thinking Tool
├── Agent: (your agent)
└── Agent ──▶ (agent with reasoning)

Use Invoke Agent or Invoke Agent Streaming:

Invoke Agent
├── Agent: (configured agent)
├── History: (chat history)
├── End ──▶ (execution complete)
└── Response ──▶ (final result)
Invoke Agent Streaming
├── Agent: (configured agent)
├── History: (chat history)
├── On Chunk ──▶ (triggers for each piece)
├── Chunk ──▶ (current text)
├── Done ──▶ (execution complete)
└── Response ──▶ (final result)

For complex tasks, use Agent Loop to let the AI control its own execution:

Agent Loop
├── Agent: (your agent)
├── History: (conversation)
├── Flow References: (available flows)
├── On Iteration ──▶ (fires each step)
├── Done ──▶ (agent decides it's finished)
└── Response ──▶ (final result)

The agent keeps running until it decides it has completed the task or needs human input.

Here’s a full agent flow for a research assistant:

Chat Event
├──▶ history
Make Agent (with Claude 3.5)
Set Agent System Prompt:
"You are a research assistant. Use your tools to find
information and summarize it for the user."
Add Flow Tools:
- search_knowledge_base
- search_web
- create_summary
Add Thinking Tool
Invoke Agent Streaming
├── On Chunk ──▶ Push Chunk
└── Done ──▶ Log completion
DoDon’t
Give tools clear, descriptive namesUse vague names like “tool1”
Document what the tool doesLeave tools undocumented
Make tools do one thing wellCreate mega-tools that do everything
Handle errors gracefullyLet tools crash silently
Return structured dataReturn unformatted text dumps

A tool for searching a knowledge base:

┌────────────────────────────────────────────────┐
│ Flow: search_knowledge_base │
│ │
│ Inputs: │
│ - query (string): What to search for │
│ - limit (number): Max results (default: 5) │
│ │
│ Flow: │
│ Embed Query ──▶ Vector Search ──▶ Format │
│ │
│ Output: │
│ - results (array): Matching documents │
│ │
└────────────────────────────────────────────────┘

Begin with 1-2 tools, then add more as needed. Too many tools can confuse the agent.

Tell the agent:

  • What its role is
  • What tools are available
  • When to use each tool
  • How to handle errors

Enable the thinking tool for tasks that require reasoning:

  • Multi-step research
  • Decision making
  • Problem solving

Your tool flows should return helpful error messages:

If (search fails)
└── Return: {"error": "Search unavailable", "suggestion": "Try a different query"}

For safety, set a maximum number of tool calls:

Agent Loop
├── Max Iterations: 10
└── ...

Track what the agent does for debugging:

Invoke Agent
├── On Chunk ──▶ Log (for debugging)
└── Done ──▶ Log final response

For complex applications, you can create multiple specialized agents:

┌─────────────────────────────────────────────────────┐
│ │
│ Router Agent: "What type of task is this?" │
│ │ │
│ ├── Research ──▶ Research Agent │
│ ├── Code ──▶ Coding Agent │
│ └── Data ──▶ Data Analysis Agent │
│ │
└─────────────────────────────────────────────────────┘

Each agent has specialized tools and system prompts for their domain.

  • Check the model supports tool use (GPT-4, Claude 3.5+, etc.)
  • Verify tools are properly connected
  • Make the system prompt explicitly mention available tools
  • Improve tool names and descriptions
  • Add examples to the system prompt
  • Consider using fewer, more distinct tools
  • Set a maximum iteration limit
  • Check tool error handling
  • Verify the agent has a clear “done” condition
  • Use streaming to show progress
  • Simplify tools where possible
  • Consider using faster models for simple decisions

Recommendations:

  • Limit tool permissions to what’s necessary
  • Use “Manual” mode for sensitive operations
  • Log all agent actions for audit
  • Test with adversarial inputs

Now that you understand agents, explore: