Phase 6: Dify & Visual AI App Builders · 50 min · Dify · OpenAI API · Anthropic API
Dify Agent Configuration — Tools, Strategies, and Autonomy
Dify agents: visual configuration, production deployment.
Hiring signal: Dify's agent app type is the fastest way to deploy a production AI agent. Being able to configure agent strategies (Function Calling vs ReAct), select tools, set iteration limits, and connect knowledge bases demonstrates the full-stack AI building skill that Dify-specific roles require.
What you will learn
- Configure Dify agents: select agent strategy (Function Calling or ReAct), choose LLM model, set iteration limits
- Add tools to Dify agents: built-in tools (search, calculator, DALL-E), custom tools (HTTP API, workflow), and knowledge bases
- Design agent system prompts for specific business use cases
- Test and debug Dify agents using the agent preview and trace view
The Problem
You've built Dify chatbots and workflows. Now you need an AI agent — an autonomous assistant that can use tools to complete tasks. In LangChain, this requires 100+ lines of Python defining tools, agent executor, and error handling. In Dify, it's a visual configuration: select agent strategy, choose tools, write a system prompt, set iteration limits.
Dify's agent app type is the fastest way to deploy a production AI agent. But configuring it correctly — choosing the right strategy, selecting the right tools, writing an effective system prompt, and setting safety limits — determines whether the agent works or fails.
Dify agents trade code for configuration
Instead of writing Python tool definitions and agent executors, you configure tools visually in Dify's UI. The trade-off: less flexibility than LangChain, but dramatically faster deployment. For most business use cases, Dify's agent configuration is sufficient and 10x faster to production.
The Concept
Dify Agent Strategies
| Strategy | How It Works | Best For | Cost |
|---|
| Function Calling | LLM selects a function and provides arguments — one step | Known tool selection, structured tasks | Low (1 LLM call) |
| ReAct | LLM iterates: think → call tool → observe → repeat | Dynamic tasks, multiple tool calls needed | Higher (multiple LLM calls) |
FUNCTION CALLING AGENT:
User: "Create an order for Chicago to Dallas, $2125, J.B. Hunt"
LLM: selects create_order(origin="Chicago", dest="Dallas", rate=2125, carrier="J.B. Hunt")
→ Done. One LLM call, one tool call.
REACT AGENT:
User: "Create an order for Chicago to Dallas, J.B. Hunt"
LLM: "I need the rate. Let me look it up."
→ calls lookup_rate(Chicago, Dallas) → $2125
LLM: "I need to verify the carrier. Let me search."
→ calls search_carrier("J.B. Hunt") → MC# 242962
LLM: "I have all info. Creating order."
→ calls create_order(...) → ORD-123456
→ Done. Three LLM calls, three tool calls.
A user asks "What's the weather in Chicago and should I delay my shipment?" The agent needs to: check weather, assess if it affects shipping, and potentially recommend delay. Which strategy is best?
ReAct is best because the task requires multiple steps with reasoning: (1) call weather API, (2) observe the result and reason about whether it affects shipping, (3) potentially call a shipment API to check status, (4) decide on recommendation. Function Calling only does one step — it can't iterate based on observations. The ReAct agent adapts: if weather is fine, it says "no delay needed"; if weather is severe, it recommends delay and checks alternatives.
Dify Agent Tools
| Tool Type | Examples | Configuration |
|---|
| Built-in | Google Search, Calculator, DALL-E, Wikipedia | Toggle on/off |
| Custom HTTP | Any REST API | Define URL, method, parameters, auth |
| Workflow | Another Dify workflow as a tool | Select published workflow |
| Knowledge Base | RAG retrieval | Select connected knowledge base |
Agent Configuration Options
| Setting | What It Controls | Recommended |
|---|
| Strategy | Function Calling or ReAct | FC for simple, ReAct for complex |
| Model | Which LLM powers the agent | GPT-4o-mini (cost) or GPT-4o (quality) |
| Tools | Which tools the agent can use | 3–5 tools max |
| Iteration limit | Max ReAct cycles | 5–10 |
| System prompt | Agent's role and constraints | Specific to use case |
| Memory | Conversation history | Window (last 5–10 messages) |
| Knowledge base | RAG context | Optional, for knowledge-based agents |
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Build It, Use It, Ship It, Exercises, Key Terms, Common Pitfalls — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy