What it is

Dify is an open-source platform for building AI applications. In its own words, it lets you create agents, agentic workflows and chatbots that draw on your own data, then publish them as web apps or integrate them into your product through APIs. The name comes from “Do It For You”.

Unlike code-first frameworks such as LangChain, Dify centres on a visual builder called Studio. You drag nodes onto a canvas and wire them together to build a full flow with LLM calls, knowledge retrieval, branching and tool use. Product and operations people can build directly, while developers focus on connecting data and writing plugins.

There are two ways to run it. Dify Cloud is the managed service, with no installation and a free Sandbox plan. The open-source Community Edition can be deployed on your own servers with Docker Compose; the code lives in the langgenius/dify repository on GitHub.

Key features

App types. Dify recommends Workflow or Chatflow, and also offers three basic types (Chatbot, Agent and Text Generator) that run on the same workflow engine.

  • Workflow handles single-turn tasks, and both the web app and API support batch runs. It can start from user input or from a trigger such as a schedule or external event.
  • Chatflow is a workflow triggered on every turn of a conversation, with conversation-level variables and memory, for multi-turn apps.

Nodes. The LLM node calls any configured model and supports structured outputs, multimodal input and context variables. Pair it with a knowledge retrieval node to build RAG. There are also Agent, tool, branching and other nodes.

Knowledge (RAG). Import documents and let Dify handle chunking, embedding and retrieval. Use a Knowledge Pipeline for more complex processing, or connect an external knowledge base through APIs. Retrieval testing, metadata filters and switchable index methods, embedding models and retrieval strategies are all supported.

Models and tools. Connect many LLM providers. Tools can be built-in, custom or MCP-based, and a marketplace offers community integrations and app templates.

Publishing options. Publish as a web app, call it through the REST API or expose it as an MCP server for tools like Claude Desktop and Cursor. The difyctl CLI runs Dify apps from terminals, scripts and CI.

Monitoring. Built-in dashboards, logs and an annotation system help you watch and improve answer quality.

DSL import and export. Any app can be exported as a YAML file in Dify’s own DSL, making it easy to move between instances or share.

How it works

Workflow engine. Every Dify app is a directed graph of nodes. At runtime the engine starts from the start node and executes nodes along the connections, passing data between them as variables. Prompts reference variables with double braces, such as {{user_input}}, which are replaced with real values before the model sees them.

Retrieval-augmented generation. Knowledge is built on RAG. When a user asks something, the system first retrieves the most relevant content from the knowledge base, combines it with the original question as augmented context, and sends that to the LLM to generate the answer. Answers can then rest on your material rather than only on pre-training data, which reduces hallucinations.

Service architecture. A self-hosted Dify runs as several containers: core services including the API, background workers, the web frontend, a plugin daemon and sandboxes, plus dependencies such as PostgreSQL, Redis, the Weaviate vector database and Nginx. Plugins run in a separate process and code execution happens in a sandbox to contain risk.

How to use it

Option 1: Dify Cloud. Sign up on the website and start building. Good for trying it out and for small to medium apps.

Option 2: Self-host with Docker Compose. The minimum is 2 CPU cores and 4 GiB of RAM, with Docker Compose 2.24.0 or later.

git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d

The clone command in the official docs checks out the latest release automatically, so follow the docs. Once the containers are up, check them with docker compose ps, open http://localhost/install to set up the admin account, then log in at http://localhost.

Build a first app:

  1. Configure at least one model under Integrations → Model Provider;
  2. Create a Chatflow app in Studio;
  3. To answer from documents, create a knowledge base, add a knowledge retrieval node and connect it to the LLM node;
  4. When it behaves well, publish it as a web app or get an API key.

Use cases

  • Customer support: answer from product docs, FAQs and troubleshooting guides.
  • Internal knowledge portals: let staff query policies, processes and technical docs in chat.
  • Content generation: produce reports, articles or emails from specified background material.
  • Research and analysis: retrieve and summarise from papers, market reports or legal documents.
  • Capabilities for other AI tools: publish a Dify app as an MCP server for coding agents and desktop assistants.

FAQ

How does Dify relate to LangChain? They target different needs. LangChain is a framework you code against. Dify is a platform with a visual interface that ships orchestration, knowledge, publishing and monitoring out of the box. Build with a framework when you need deep customisation; use Dify when you want to assemble and ship quickly.

Self-host or cloud? Self-host when data must stay on your servers or you need deep customisation. Use Dify Cloud to get started quickly without maintaining infrastructure.

Is publishing as an MCP server safe? The MCP server URL contains authentication credentials, and Dify advises treating it like an API key. If you suspect it has leaked, regenerate it; the old URL stops working immediately.

Can the open-source edition be used commercially? The terms for the Community Edition are in the LICENSE file in the GitHub repository. Read its additional conditions before commercial use or offering it as a service.