Dify AI Agent Tutorial: Tool Integration & Exa Search in Practice

A complete no-code guide to building AI Agents with tool calling on the Dify platform.
This article provides a detailed walkthrough of building AI Agents on the Dify platform, covering the core differences between Agents and chat assistants (reasoning strategies and tool invocation), the 161-plugin Dify ecosystem, in-depth Exa search tool configuration, and solutions for the Agent time-awareness problem. It emphasizes the 5-tool-per-turn limit and recommends splitting functions into dedicated Agents, paired with stronger models like DeepSeek V3 for smarter tool orchestration.
Introduction
AI Agents are one of the most exciting directions in large language model applications. Unlike ordinary chatbots, Agents can autonomously invoke tools, retrieve real-time information, and complete multi-step tasks. This tutorial is based on the Dify no-code platform and breaks down the complete Agent-building process from scratch — including core configuration, tool invocation, Exa search setup, and solving time-awareness issues — to help you quickly build your own AI Agent.

Key Differences Between Agents and Chat Assistants
Creating an Agent in Dify follows a similar entry point as creating a chat assistant: select a blank application, choose the Agent type, name it, and enter the editing interface. The layout is also similar — prompts on the left, conversation testing on the right.
So what actually makes an Agent different from a chat assistant? The key differences come down to two points:
First, Agents have their own reasoning strategy. The default mode is Function Call, an API standard for tool invocation provided by OpenAI. Most models that support tool calling are compatible with this protocol. For models that don't support Function Call (such as DeepSeek R1 reasoning model), Dify automatically switches to ReAct mode — which uses prompt engineering techniques to simulate tool-calling capabilities through iterative querying, processing, and summarization.
Function Call is a capability introduced by OpenAI in June 2023 alongside the GPT-3.5/4 API update. It allows developers to define available functions using JSON Schema descriptions in API requests, and the model determines whether to call a specific function based on user intent, generating structured parameter output. The advantage of this approach is native model support, precise invocation, and low token consumption. ReAct (Reasoning + Acting) is a framework proposed jointly by Princeton University and Google Brain in 2022. Its core idea is to have the model alternate between "Thought" and "Action" — at each step, it first reasons about the current state, then decides the next action, and finally observes the result (Observation). In Dify, ReAct mode uses carefully designed prompt templates to guide the model to output tool-calling instructions in a fixed format. While it offers greater flexibility and broader compatibility, it consumes more tokens and has slightly lower accuracy compared to Function Call.
Second, Agents can mount and invoke external tools. This is the most powerful capability of an Agent and the fundamental difference from ordinary chat assistants.
Tool Invocation Limits
One important detail to note: in Dify, an Agent can invoke a maximum of 5 tools per conversation turn. This means that even if you've mounted many tools, the Agent can only use 5 of them in a single round of dialogue. Therefore, it's recommended to split different functions into separate Agents: one dedicated to news search and summarization, one for weather queries, one for stock analysis — each doing its own job for better results.
Dify Tool Ecosystem: 161 Plugins to Choose From
Since Dify 1.0, the preset tools have been streamlined to just a few (such as CurrentTime, Audio, etc.), with more tools available for download and installation through the plugin Marketplace.
Dify underwent a major architectural upgrade from version 0.x to 1.0. Earlier versions had tools hard-coded into the platform, limiting extensibility. Version 1.0 introduced a Plugin System that abstracts tools, model providers, and extension features into independently installable and updatable plugins. This design draws inspiration from VS Code's extension marketplace concept — developers can build custom tools following a standardized plugin protocol (including manifest.yaml configuration files and Python/TypeScript implementations) and publish them to the Marketplace for community use. The advantages of this architecture are: the platform core remains lightweight, users install only the features they need, and community contributions create a positive feedback loop. Currently, the 161 plugins cover categories including search, generation, data processing, notifications, and more — and the number is still growing rapidly.

Click "Plugins" → "Explore Marketplace" to browse all 161 available tool plugins, with filtering options by popularity, recently updated, and newly released.
Popular Tools at a Glance
- Tavily: Over 20,000 downloads, a web search query tool that crawls web content and returns results
- Google Search: Google search integration
- Jina: A web content query tool similar to Tavily
- DALL-E: A standalone tool wrapper for OpenAI's image generation model
- FireCrawl: A deep web crawling tool that can set crawl depth levels to capture an entire website's content
- Poke: Converts Markdown into PowerPoint presentations
- Email: An email sending tool that can send query results directly to a specified email address

Recommended Search Tool: A Deep Dive into Exa
Among the many search tools available, I particularly recommend Exa. The biggest difference between Exa and Tavily or Jina is that Exa employs a technical architecture similar to RAG (Retrieval-Augmented Generation). It pre-crawls and stores website content in its own vector database, then retrieves information through semantic fuzzy matching during queries rather than traditional keyword search.
RAG (Retrieval-Augmented Generation) is a technical paradigm proposed by Meta AI in 2020. Its core idea is to combine external knowledge retrieval with language model generation. Traditional search engines rely on inverted indexes and keyword matching algorithms like BM25, whereas RAG architecture first converts documents into high-dimensional vectors using Embedding models and stores them in vector databases (such as Pinecone, Milvus, or Weaviate). During queries, the user's question is similarly vectorized, and the most semantically similar document segments are found through cosine similarity or inner product metrics. Exa applies this technology to internet-scale search — it continuously crawls and indexes billions of web pages, pre-vectorizing and storing the content, enabling queries to understand the semantic intent of natural language rather than merely matching literal keywords. This explains why Exa's URL Content feature is faster than real-time crawling — the content has already been preprocessed in its database.
Exa's Four Core Modules
- Exa Search: The core search function, supporting three search modes — neural network semantic search (vector retrieval), keyword exact match, and hybrid mode (Auto, recommended)
- URL Content: Retrieves web content directly from a given URL, similar to FireCrawl but faster (since content is pre-crawled)
- Similar Link: Input a URL and find related websites through semantic similarity — a "find links by link" approach
- Exa Answer: Directly answers questions and provides summaries (better suited for use on the Exa website; for self-built Agents, Search is recommended)
Key Exa Parameter Configuration
| Parameter | Recommended Setting | Description |
|---|---|---|
| Search Mode | Auto (hybrid mode) | Balances semantic search and keyword matching |
| Number of Results | Adjust as needed | 10 results suffice for news queries; hundreds recommended for in-depth research reports |
| Use Auto-Prompt | Enable as needed | Recommended when prompts haven't been optimized |
| Text Content | Must be checked | Otherwise only summaries are returned, lacking complete content |
| Category | Choose by scenario | e.g., News for news, GitHub for code, Twitter for social updates |
Registration & Pricing
After registering for Exa, you'll receive a generous free credit. Upon completing the onboarding tasks, you'll have approximately $230 in usage credits — essentially enough for long-term free use. Generate your API Key on the Exa website, then paste it into Dify's tool authentication page to complete the setup.
Real-World Pitfall: The Agent's Time-Awareness Problem
With the Exa search tool configured, let's run a practical test: "Give me AI-related news."

The Agent did find news through Exa, but the results were all from 2023 or even earlier — and it's already 2025! This exposes a critical issue: large language models have no real-time concept of time.
LLM training data has a definitive cutoff date (knowledge cutoff). For example, GPT-4o's training data cuts off in early 2024, meaning the model knows nothing about events after that date. The deeper issue is that even if the model "knows" the current date (injected through system prompts), it lacks the reasoning ability to proactively apply time information to tool parameters — this requires strong Planning and Tool Use capabilities. Weaker models (like GPT-4o mini), while performing well in text generation, have limited ability in multi-step reasoning and tool orchestration. They often can't independently work out the reasoning chain: "user asks for recent news → need to get current time first → then constrain search range with time parameters." This is precisely why Agent scenarios demand higher model intelligence.
Solution: Add a Time Tool + Choose a Stronger Model
Step one: add the CurrentTime tool so the Agent can get the current time. But this alone isn't enough — when using GPT-4o mini, even with the time tool added, the Agent still won't proactively call it to constrain the search time range.
The key is step two: switch to a stronger model. After changing from GPT-4o mini to DeepSeek V3, the improvement was immediate:

A smarter model automatically executes the following reasoning chain:
- First calls CurrentTime to get the current date
- Calculates the time range for "the past week"
- Passes time parameters into the Exa search tool
- Automatically adds geographic constraints to the query based on the user's mention of "Taiwan"
Even more impressively, the Agent demonstrates conversational memory. In the second round of dialogue, it remembers the time information obtained in the previous round, skips the redundant CurrentTime call, and directly uses the cached time for searching — more efficient.
The Agent's conversational memory relies on the Context Window mechanism. In multi-turn conversations, Dify sends the previous conversation history (including user inputs, model outputs, and tool call results) as context to the LLM. This means the model can "see" previously obtained information, avoiding redundant calls. However, this also creates token consumption issues — as conversation turns increase, the context grows longer and API call costs rise accordingly. Current mainstream models have context windows ranging from 8K to 128K (DeepSeek V3 supports 128K), and earlier conversation content gets truncated when the window limit is exceeded. In production environments, strategies like conversation summarization and key information extraction are typically combined to optimize memory efficiency in long conversation scenarios.
Best Practices for Building Agents
The Principle of Functional Separation
Since the tool invocation limit is 5 per turn, don't try to cram all capabilities into a single Agent. The recommended approach is:
- News Agent: Exa Search + CurrentTime, focused on news queries and summarization
- Knowledge Base Agent: Mount a local knowledge base, focused on internal enterprise Q&A
- Data Analysis Agent: Stock queries + chart generation and other specialized tools
Auxiliary Feature Configuration
In the Agent's management settings, several useful features are worth noting:
- Opening Statement: Provides example questions for users who aren't sure what to ask, lowering the barrier to entry
- Next Step Suggestions: Leverages the LLM's predictive capabilities to automatically recommend possible follow-up questions
- Knowledge Base Citation: A feature that needs to be enabled when working with knowledge bases (covered in later tutorials)
- Annotated Replies: Suitable for customer service scenarios, allowing standardized answer formats for specific questions
Conclusion
The Dify platform makes Agent building remarkably simple, but "simple" doesn't mean "careless." To build a truly effective AI Agent, you need to understand tool invocation mechanisms, configure search parameters properly, choose the right LLM, and follow the principle of functional separation. Once you've mastered these key points, you can quickly build Agents with real-time information retrieval and intelligent analysis capabilities — even without a programming background.
Key Takeaways
- Dify Agents can invoke a maximum of 5 tools per turn; it's recommended to split functions into multiple dedicated Agents
- The Exa search tool uses a RAG-based architecture, supporting semantic search, keyword matching, and hybrid mode, with approximately $230 in free credits upon registration
- Agents lack time awareness; you need to add the CurrentTime tool and pair it with a stronger model (such as DeepSeek V3) to properly handle time-sensitive queries
- Models that don't support Function Call (like DeepSeek R1) automatically switch to ReAct mode, simulating tool invocation through prompt engineering
- Agents have conversational memory, allowing them to reuse previously obtained information across multiple dialogue turns and avoid redundant tool calls
Related articles
TutorialsChatGPT Plus Subscription Guide: Are GPT-5.5, image-2, and Codex Worth the Upgrade?
A detailed look at ChatGPT Plus features — GPT-5.5, image-2, and Codex — with a Plus vs Pro comparison and a complete step-by-step subscription guide for users outside the US.
TutorialsHarness AI Engineering in Practice: Using Claude Code to Master Enterprise-Level E-Commerce Development
Deep dive into Harness AI Engineering: master enterprise e-commerce development with Claude Code using the Rules, Skills, Wiki, and Changes framework.
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.