How to Use Dify for AI App Building: A Complete Guide

Dify is an open-source LLM application platform that sits between visual no-code builders like LangFlow and full-code frameworks like LangChain. It provides a complete environment for building, deploying, and monitoring AI applications: a visual workflow editor, knowledge base management, model provider integrations, prompt orchestration, and production observability — all in one platform. With 90,000+ GitHub stars as of 2026 and a rapidly growing plugin marketplace, Dify has become one of the most adopted self-hosted AI application platforms available.

What Makes Dify Different

Dify targets a different audience than LangFlow or Flowise. Where those tools are primarily visual prototyping environments for developers, Dify is a full production platform. It includes built-in authentication for the applications you build (so you can deploy an AI app to users without building your own auth system), usage analytics that show which prompts users are sending and how the AI is responding, annotation and feedback tools for improving AI output quality over time, and a plugin marketplace for extending capabilities. The combination of no-code prototyping, one-click deployment, and built-in LLMOps tooling makes Dify the most complete self-hosted AI application platform for teams that want to go from idea to production without assembling a custom stack.

App Types in Dify

Dify organises applications into four types. Chatbot: a conversational interface powered by an LLM, optionally connected to a knowledge base for RAG, with persistent conversation history. Text Generator: a single-turn interface that takes structured inputs and returns generated text — useful for content creation tools, summarisers, and document generators where back-and-forth conversation is not needed. Workflow: a visual node-based pipeline similar to LangFlow but with Dify’s broader node library, which includes HTTP request, code execution, knowledge retrieval, iteration, and LLM nodes that can be chained into complex multi-step processes. Agent: an LLM with tool access that decides autonomously what actions to take to complete a user request, with the same tool library as the Workflow type.

Figure 1 — Dify app types and use cases

App type Best for ChatbotCustomer support bots, document Q&A, internal assistants Text GeneratorContent creators, email drafters, structured output tools WorkflowMulti-step pipelines: data enrichment, classification, RAG AgentTool-using autonomous assistants with ReAct reasoning

Getting Started with Dify

Dify is available as dify.ai cloud (free tier with 200 OpenAI credits and 1,000 Claude credits to get started), or self-hosted via Docker. The Docker setup is the most popular for production use: clone the Dify repository, copy the .env.example file to .env, configure your API keys, and run docker compose up. Dify starts on port 80 and includes a PostgreSQL database, Redis, vector store (Weaviate by default), and the web application in a single compose stack. First-time users are prompted to create an admin account and configure their first model provider.

Connecting Model Providers

Dify supports OpenAI, Anthropic, Google Gemini, Cohere, Mistral, and dozens of other cloud providers, plus Ollama for local models. To connect Ollama, go to Settings > Model Providers > Ollama, enter your Ollama host URL (http://localhost:11434 for local, or your server IP), and Dify fetches your available models automatically. You can then use any Ollama model as the LLM for chatbots, text generators, workflows, and agents, or as the embedding model for knowledge bases. This enables a fully local Dify deployment: Dify self-hosted, Ollama for inference, and a self-hosted vector store for knowledge retrieval, with no data leaving your infrastructure.

Building a Knowledge Base RAG App

Dify’s knowledge base is one of its most polished features. Upload documents (PDF, Word, Markdown, TXT, HTML, Excel) through the Knowledge section, configure the chunking strategy and embedding model, and Dify processes and indexes them. In a Chatbot or Workflow app, add the knowledge base as a context source. Dify handles the retrieval step automatically — when a user sends a message, it embeds the query, retrieves the most relevant chunks, and passes them to the LLM as context. The Citation and Attribution toggle in app settings shows users which document chunks were used to generate each response, building transparency and trust in RAG-powered assistants.

Publishing and Sharing Apps

Dify provides three publishing options for each app. Web App: Dify generates a shareable URL for a clean chat or text generation interface — no frontend work required. Embed: Dify generates an iframe embed code and a JavaScript snippet for adding the app as a chat widget to any website. API: Dify exposes each app as a REST API endpoint you can call from your own application, passing messages and receiving responses in a standard format. The API endpoint is the primary integration path for production applications: your own frontend or backend calls the Dify API, which handles the LLM routing, knowledge retrieval, conversation history, and monitoring.

Dify vs LangFlow vs Flowise

Dify is more opinionated and more complete as a production platform. LangFlow and Flowise are better for developers who want maximum flexibility in composing LangChain components visually. Dify is better for teams that want to build and deploy a polished AI application to end users quickly, with built-in analytics, conversation logs, and feedback collection. Dify’s knowledge base management is significantly more polished than either LangFlow or Flowise. For a team shipping an internal AI assistant or a customer-facing chatbot to non-technical users, Dify is typically the faster path. For a developer building a custom LangChain pipeline that needs visual composition tooling, LangFlow is more flexible.

Frequently Asked Questions

Is Dify free?
Yes. Dify is open-source (MIT licence) and free to self-host with no limits. The cloud version at dify.ai has a free tier with trial credits and paid plans for higher usage limits and team features.
Can Dify use Ollama for local inference?
Yes. Dify has native Ollama support — add it as a model provider, point it at your Ollama instance, and any Ollama model is available for inference and embedding across all app types.
What vector databases does Dify support?
Weaviate (default in the Docker stack), Qdrant, Pinecone, Milvus, Chroma, and pgvector (PostgreSQL) are all supported. Configure the vector store in the .env file before starting the Docker stack.

Last updated: October 2026

Dify Plugins and the Marketplace

Dify introduced a plugin marketplace in late 2024 that has grown rapidly. Plugins extend Dify’s node library with additional tool integrations, custom model providers, and workflow capabilities. Available plugins include web search (Tavily, SerpAPI), code execution, image generation (Stable Diffusion, DALL-E), communication tools (Slack, email), data connectors (Google Sheets, Airtable, Notion), and productivity integrations. Install plugins through Settings > Marketplace — they appear as available nodes in the workflow editor immediately after installation. The plugin architecture lets the community extend Dify without waiting for the core team to add integrations, which has dramatically expanded its out-of-the-box capabilities compared to earlier versions.

Dify for Teams and Enterprise

Dify’s team features are more complete than most open-source AI platforms. The workspace system lets multiple team members collaborate on apps with role-based permissions (owner, admin, editor, viewer). The conversation log viewer shows every user interaction with each published app, with annotation tools that let you mark AI responses as good or poor and use those annotations to fine-tune prompts. The monitoring dashboard shows conversation volume, token usage, and error rates per app. The enterprise version (available via cloud or self-hosted enterprise licence) adds SSO, audit logging, and enterprise support. For teams deploying multiple internal AI tools and wanting visibility into how they are being used, Dify’s built-in LLMOps capabilities eliminate the need for a separate monitoring stack.

Dify Workflow: The Most Powerful App Type

While Chatbot is the most common Dify app type, Workflow is the most powerful. A Workflow app is a visual node pipeline that can include: Start nodes (define input variables), LLM nodes (call any configured model with a prompt that references input variables), Code nodes (run Python or JavaScript for custom logic), HTTP Request nodes (call any external API), Knowledge Retrieval nodes (query a knowledge base), Conditional Branch nodes (if/else routing), Iteration nodes (loop over arrays), and End nodes (define what the workflow returns). This node library covers the vast majority of real-world AI pipeline patterns without needing to write a full application. For example, a lead enrichment workflow: Start node takes a company name as input; an HTTP Request node calls a company data API; an LLM node generates a personalised outreach draft based on the company data; a Code node formats the output as JSON; the End node returns the structured result. This runs as an API endpoint you can call from your CRM, your sales tools, or any other system. Compared to building this pipeline in code, the Workflow editor makes it faster to iterate on the LLM prompt and the API integration logic, and the built-in execution logs show each node’s inputs and outputs for every run.

Backups and Upgrades for Self-Hosted Dify

A self-hosted Dify instance stores your apps, knowledge bases, and conversation logs in its database and storage volumes, so back those up before every upgrade. Pin a specific version tag in your Docker Compose file instead of using the latest tag, read the release notes for breaking changes, and test the upgrade on a copy first. Schedule regular database dumps and keep at least one copy off the server. Rotating API keys periodically and restricting access to the admin interface behind HTTPS are further small steps that keep a production deployment safe and recoverable.

Leave a Comment