5.3 Platform Two: Dify
5.3.1 Introduction to Dify and Its Ecosystem
Dify is an open-source large language model (LLM) application development platform that integrates the concepts of Backend as a Service (BaaS) and LLMOps, providing full-process support from prototype design to production deployment, as shown in Figure 5.15. It adopts a layered modular architecture, divided into data layer, development layer, orchestration layer, and foundation layer, with each layer decoupled for easy expansion.
Dify is highly model-neutral and compatible: whether open-source or commercial models, users can integrate them through simple configuration and call their inference capabilities through a unified interface. It has built-in support for integration with hundreds of open-source or proprietary LLMs, covering models such as GPT, Deepseek, Llama, as well as any model compatible with the OpenAI API.
At the same time, Dify supports local deployment (official Docker Compose one-click startup) and cloud deployment. Users can choose to self-deploy Dify in local/private environments (ensuring data privacy) or use the official SaaS cloud service (detailed in the business model section below). This deployment flexibility makes it suitable for enterprise intranet environments with security requirements or developer groups with operational convenience requirements.

Figure 5.15 Dify Official Website
Marketplace Plugin Ecosystem: Dify Marketplace provides one-stop plugin management and one-click deployment functionality, enabling developers to discover, extend, or submit plugins, bringing more possibilities to the community, as shown in Figure 5.16.

Figure 5.16 Dify Marketplace Plugin Ecosystem
Marketplace includes:- Models
- Tools
- Agent Strategies
- Extensions
- Bundles
Currently, Dify Marketplace has over 8,677 plugins covering various functions and application scenarios. Among them, officially recommended plugins include:
- Google Search: langgenius/google
- Azure OpenAI: langgenius/azure_openai
- Notion: langgenius/notion
- DuckDuckGo: langgenius/duckduckgo
Dify provides powerful development support for plugin developers, including remote debugging functionality that seamlessly collaborates with popular IDEs, requiring minimal environment setup. Developers can connect to Dify's SaaS service while forwarding all plugin operations to the local environment for testing. This developer-friendly approach aims to empower plugin creators and accelerate innovation in the Dify ecosystem. This is also why Dify can become one of the most successful agent platforms currently, because models can all be integrated, prompts and orchestration can be copied, but the presence and richness of tool plugins directly determine whether your agent can achieve better results or unexpectedly powerful functions.
5.3.2 Building a Super Agent Personal Assistant
✨✨ Detailed Operation Guide: Please refer to Dify Agent Creation Step-by-Step Tutorial
In the previous Coze case, we built a daily AI brief agent. Although its function is clear, its single brief generation capability is somewhat limited. This section will use Dify to build a fully functional super agent personal assistant, covering multiple scenarios such as daily Q&A, copywriting optimization, multimodal generation, and data analysis. Before starting, let's briefly understand Dify's main interface and functional modules.

Figure 5.17 Dify Agent Building Homepage

Figure 5.18 Dify Official Template Library

Figure 5.19 Dify Knowledge Base

Figure 5.20 Dify Plugin Market

Figure 5.21 Dify Large Model Configuration
(1) Creating Plugins and Configuring MCP
Before building the agent, necessary plugin installation and MCP configuration must be completed first. As shown in Figure 5.22, these are the core plugins required for this case.

Figure 5.22 Dify Plugin Installation Configuration
The plugins marked with red boxes in the figure need to be searched for and installed from the Dify plugin market. Users can click to view details to understand the specific functions of each plugin.
Next, configure MCP (Model Context Protocol). We won't expand on the detailed principles of MCP here; we'll focus on demonstrating how to use cloud-deployed MCP services. This case uses the domestic ModelScope community MCP market for demonstration, as shown in Figure 5.23.

Figure 5.23 ModelScope Community MCP Market
Open the ModelScope community MCP market and select the hosted type. Taking Amap MCP as an example, after entering its homepage, select SSE mode on the right side and click connection configuration to generate a dedicated MCP configuration JSON, as shown in Figure 5.24. MCP supports multiple communication modes, but using SSE mode communication in Dify is smoother and more stable, so SSE mode is recommended.

Figure 5.24 Amap MCP Configuration Example
(2) Agent Design and Effect Display
This case will create a comprehensive personal assistant covering the following functional modules:
- Daily life Q&A
- Copywriting polishing and optimization
- Multimodal content generation (images, videos)
- Data query and visualization analysis
- MCP tool integration (Amap, dietary recommendations, news information)
The overall agent orchestration architecture is shown in Figure 5.25.

Figure 5.25 Agent Orchestration
For the multi-agent architecture, we use a question classifier for intelligent routing. In the classifier, define the core functions and task scope for each agent to ensure user requests can be accurately distributed to the corresponding processing modules.
Daily Assistant Module
This is a basic dialogue module configured with a large language model and time tools, serving as a fallback general Q&A service.
Prompt configuration:
# Role: Daily Question Consultation Expert
## Profile
- language: Chinese
- description: Specializes in answering general questions in users' daily lives, providing practical, accurate, and easy-to-understand advice and answers
- background: Possesses rich life experience and extensive knowledge reserves, skilled at simplifying complex problems
- personality: Kind and friendly, patient and meticulous, pragmatic and reliable
- expertise: Daily life, health and wellness, family management, interpersonal relationships, practical tips
## Skills
1. Problem Analysis Ability
- Quick Understanding: Rapidly grasp the core points of user questions
- Classification Recognition: Accurately judge the life domain to which the question belongs
- Demand Mining: Deeply understand users' potential needs
- Priority Sorting: Reasonably assess the importance and urgency of problems
2. Answer Providing Ability
- Knowledge Integration: Comprehensively apply multi-domain knowledge to provide answers
- Solution Formulation: Provide specific and feasible solutions
- Step Decomposition: Break down complex problems into simple steps
- Alternative Solutions: Prepare multiple backup solutions for users to choose from
3. Communication and Expression Ability
- Popular Language: Use simple and easy-to-understand everyday language
- Clear Logic: Organize answer content in a well-organized manner
- Illustrative Examples: Help understanding through specific cases
- Highlight Key Points: Emphasize key information and precautions
## Rules
1. Answer Principles:
- Practicality First: Ensure the advice provided is actionable
- Accuracy Guarantee: Give answers based on reliable information and common sense
- Neutral and Objective: Avoid personal bias and subjective assumptions
- Moderate Advice: Provide appropriate depth of answers based on problem complexity
2. Code of Conduct:
- Timely Response: Quickly respond to users' questions
- Patient and Meticulous: Maintain patience with repetitive or simple questions
- Active Guidance: Encourage users to provide more background information
- Continuous Improvement: Optimize answer quality based on feedback
## Workflows
- Goal: Provide users with practical and reliable daily problem solutions
- Step 1: Carefully read and understand the daily questions raised by users
- Step 2: Analyze the problem type and users' potential needs
- Step 3: Provide specific and feasible suggestions based on common sense and experience
- Step 4: Organize answer content in easy-to-understand language
- Step 5: Check the practicality and safety of the answer
## Initialization
As a daily question consultation expert, you must abide by the above Rules and execute tasks according to Workflows.The effect demonstration is shown in Figure 5.26:

Figure 5.26 Daily Assistant
Copywriting Optimization Module
According to OpenAI's data report, over 60% of users use ChatGPT for text optimization-related tasks, including polishing, modification, expansion, and abbreviation. Therefore, copywriting optimization is a high-frequency demand scenario, and we make it the second core functional module.
Prompt configuration:
# I. Role Setting (Role)
You are a professional copywriting optimization expert with rich experience in marketing copywriting and optimization, skilled at improving the attractiveness, conversion rate, and readability of copy. Your perspective is from the angle of the target audience and marketing goals, with professional boundaries limited to the copywriting optimization field, not involving technical implementation or product development.
# II. Background
The user has provided a piece of original copy that needs your optimization to improve its overall effectiveness. Background information includes: the copy may be used for marketing, brand promotion, or information communication scenarios, but the specific use is not detailed. The known condition is that the user hopes the copy is more attractive, clear, or persuasive, but has not provided the original copy content, so you need to work based on general optimization principles.
# III. Task Objectives (Task)
- Analyze and optimize the structure, language, and style of the copy to make it more in line with the preferences of the target audience.
- Improve the attractiveness, readability, and conversion potential of the copy, ensuring clear information delivery.
- Make adjustments according to common optimization principles (such as conciseness, emotional resonance, call to action, etc.), without content rewriting unless necessary.
- While maintaining core information, appropriately expand and enrich copy content to provide a more comprehensive optimized version.
# IV. Limitation Prompts (Limit)
- Avoid changing the core information or intent of the original copy unless explicitly requested by the user.
- Do not add fictional or irrelevant content, ensuring optimization is based on logic and best practices.
- Avoid using overly technical or professional terminology unless the target audience is professionals.
- Do not involve optimization of images, layouts, or other non-text elements.
# V. Output Format Requirements (Example)
The output should be optimized copy text with clear structure, fluent language, and substantial content. For example:
- If the original copy is "Our product is very good, come and buy it"
The optimized version can be: "In this era full of choices, what truly touches people's hearts is never exaggerated propaganda, but good products that can withstand the test of time and users. Our product is exactly that. It not only pays attention to details and quality in design but also continuously polishes and innovates in function, just to bring a better user experience to every user. Whether it's the texture of the appearance or the stability of performance, we always adhere to high standards and strict requirements, striving to make every customer who chooses us feel the surprise of value for money.
We deeply understand that purchasing a product is not just a simple consumption but a choice of lifestyle. Therefore, from material selection, craftsmanship to after-sales service, we have poured full sincerity and professionalism into every link, carefully guarding your every experience. Whether you pursue practicality, value quality, or want unique personalization, our products can provide you with ideal solutions.
Now, let us prove everything with action. A truly good product does not need too much embellishment; it itself is the best spokesperson. Act now, choose us, let quality change life, and have a different experience from now on!"
- The output should directly present optimized content without additional explanations or annotations unless requested by the user. Please ensure that the optimized copy content is richer and more complete, and the optimized copy text must exceed 500 words.The effect demonstration is shown in Figure 5.27:

Figure 5.27 Copywriting Assistant
Multimodal Generation Module
Image and video generation is another high-frequency application scenario. With the evolution of models like Jimeng image generation and Google Imagen, as well as breakthroughs in video generation technologies like Keling, Google Veo 3, seedance2.0, and OpenAI Sora 2, the quality of multimodal content generation has reached a practical level.
This case uses the Jimeng plugin to implement image and video generation. Configuration steps are as follows:
- Add Jimeng image/video generation plugin in the workflow
- Configure parameters (such as image ratio 1:1, model selection seedream4.5/5.0 and seedance1.5/2.0)
- Output the generated file
Here we use Jimeng's plugin to call the latest models, namely seedream5.0 and seedance2.0. The quality of both images and videos has been significantly improved. We also use loops for video task retrieval, and supplement the case demonstration with parameter retrieval and conditional judgment. For details, please refer to the complete workflow.
Image generation configuration and effects are shown in Figures 5.28 and 5.29.

Figure 5.28 Image Generation Settings

Figure 5.29 Image Generation Assistant
The video generation effect is shown in Figure 5.30.

Figure 5.30 Video Assistant
Data Query and Analysis Module
Data processing is one of the important capabilities of agents. This module demonstrates how to connect to a database in Dify to implement data query and visualization analysis.
First, install the data query tool plugin; this case uses the rookie-text2data plugin. The key to data query is to provide the large model with clear table structure and field information so it can generate accurate SQL query statements. Common practices include:
- Directly providing the DDL statement of the data table
- Providing a description of the correspondence between table names and field names
Configure database connection information (IP address, database name, port, account, password, etc.), as shown in Figure 5.31. Query results need to be organized through a large model node and converted into easy-to-understand natural language output.

Figure 5.31 Database Configuration
Prompt settings:
# I. Role Setting (Role)
You are a professional data query specialist, skilled at data organization, with clear logical thinking and concise expression ability.
# II. Background
The user has provided raw data queried from the database. This data may have issues such as inconsistent formats, missing fields, and duplicate records, and needs professional organization before effective display.
# III. Task Objectives (Task)
1. Summarize and organize raw data
2. Classify and sort data according to correct logic
3. Data display highlights key information and data insights
4. Provide easy-to-understand data display
# IV. Limitation Prompts (Limit)
1. Must not arbitrarily delete important data
2. Avoid using overly complex or professional statistical terminology
3. Must not tamper with the true values of raw data
4. Avoid displaying too much redundant information, keep it concise and clear
5. Must not leak sensitive data or personal privacy information
# V. Output Format Requirements (Example)
Data Overview: Simply briefly explain the data contentThe effect display is shown in Figure 5.32:

Figure 5.32 Data Query Assistant
Prompt settings:
# I. Role Setting (Role)
You are a professional data analyst with data organization, cleaning, and visualization capabilities, able to extract key information from raw data and transform it into intuitive visual displays.
# II. Background
The user has queried a batch of raw data from the database. This data may contain multiple fields, missing values, or inconsistent formats, and needs to be organized before generating visualization charts.
# III. Task Objectives (Task)
# Workflow
1. Data Analysis
Analyze, organize, and summarize data according to reasonable rules
2. Analysis & Visualization
Generate at least 1 chart (choose one or more from bar / line / pie chart)
Can call tools: "generate_pie_chart" | "generate_column_chart" | "generate_line_chart"
# IV. Limitation Prompts (Limit)
1. Avoid using overly complex chart types, ensure visualization results are easy to understand
2. Do not ignore data quality issues, must perform necessary data cleaning
3. Avoid using too many colors or elements in visualization, keep it concise and clear
4. Do not omit labeling and explanation of key data
5. Must perform summary and chart generation, regardless of data volume
# V. Output Format Requirements (Example)
Please output in the following format:
1. Data overview summary (do not output field names, do not list points, just a short paragraph)
2. Display generated charts
Figure 5.33 Data Analysis Assistant
The only difference in the data analysis assistant is that we added data visualization tools, namely the "generate_pie_chart" | "generate_column_chart" | "generate_line_chart" BI chart generation tool plugins. If you have installed these as required earlier, you can directly add and use them, and add corresponding descriptions like in the prompt above.
MCP Tool Integration
Finally, the integration application of MCP tools. We have already completed the MCP configuration earlier, now we will integrate it into the agent. Configuration steps are as follows:
- Select an agent strategy that supports MCP calls
- Select ReAct mode
- Configure MCP service (note to delete the
mcp-serverprefix, select SSE mode) - Fill in the corresponding prompts
The configuration interface is shown in Figure 5.34.

Figure 5.34 Agent MCP Configuration
The effects of Amap assistant, dietary assistant, and news assistant are shown in Figures 5.35, 5.36, and 5.37 respectively.

Figure 5.35 Amap Assistant

Figure 5.36 Dietary Assistant

Figure 5.37 News Assistant
At this point, we have completed a fully functional super agent personal assistant. This assistant covers multiple aspects of life: when you need new clothes, you can have Doubao generate designs; before going out, you can have the Amap assistant plan routes; when you don't know what to eat, you can get dietary recommendations; when you want to understand learning situations, you can perform data analysis. This agent can handle various work and life tasks, and we look forward to seeing everyone build more creative personal agent assistants.
5.3.3 Analysis of Dify's Advantages and Limitations
As a leading AI application development platform, Dify demonstrates significant advantages in multiple aspects:
- Core Advantages
Full-Stack Development Experience: Dify integrates RAG pipelines, AI workflows, model management, and other functions into one platform, providing a one-stop development experience
Balance Between Low-Code and High Extensibility: Dify achieves a good balance between the convenience of low-code development and the flexibility of professional development
Enterprise-Level Security and Compliance: Dify provides AES-256 encryption, RBAC permission control, and audit logs, meeting strict security and compliance requirements
Rich Tool Integration Capability: Dify supports 9000+ tools and API extensions, providing extensive functional extensibility
Active Open-Source Community: Dify has an active open-source community, providing rich learning resources and support
- Main Limitations
Steep Learning Curve: For users with no technical background at all, there is still a certain learning curve
Performance Bottlenecks: May face performance challenges in high-concurrency scenarios, requiring appropriate optimization. The core server-side components of the Dify system are implemented in Python, which has relatively poor performance compared to languages like C++, Golang, and Rust
Insufficient Multimodal Support: Currently mainly focused on text processing, with limited support for images, videos, HTML, etc.
High Enterprise Edition Cost: Dify's enterprise edition pricing is relatively high, which may exceed the budget of small teams
API Compatibility Issues: Dify's API format is not compatible with OpenAI, which may limit integration with certain third-party systems