Dify Tutorial
Welcome to the Dify tutorial. Based on the official Dify docs and the open-source langgenius/dify project, this guide shows how to build agents, agentic workflows, and chatbots on your own data with a visual, low-code studio—then publish them as a web app or REST API.
The name Dify comes from Do It For You.
Table of Contents
Basics
- Introduction — Positioning vs LangChain and Coze
- Installation — Cloud vs Docker Compose, hardware, first admin user
- Quick Start — One model, first chatbot, first conversation
Capabilities
- Model Providers — API keys, Ollama, multi-model compare
- Knowledge Base — Upload, chunk, embed, retrieve, citations
- Workflow — Visual graph, nodes, when not to use an agent
- Agent — Tools, ReAct / Function Calling, vs workflow
Publish & integrate
- Publish & API — Web App, API keys,
/v1/chat-messages - Ollama Integration — Local models, Docker networking, embeddings
Practice
- Practical Examples — FAQ bot, classify-then-answer workflow, Python API
- Resources — Official docs and related tutorials on this site
Learning path
Prerequisites
- Basic LLM / Chat API ideas (messages, tokens, prompts)
- At least one model source: a cloud API key, or local Ollama
- Self-hosting also needs Docker / Docker Compose (see the Docker tutorial)
Related tutorials on this site
Two ways to run Dify
Pick a path, then continue at Installation.
What you will have built
After the later chapters (especially Practical Examples) you should be able to demo three things:
- FAQ Chatbot — upload an internal policy, cite passages, refuse when retrieval is empty
- Classify-then-answer flow — bucket “policy / chitchat / other”, retrieve only when needed
- Backend integration — Python calls official
POST /v1/chat-messages; the key never enters the browser
For a fully local stack, point chat and embeddings at Ollama. Inside Docker the base URL must be host.docker.internal:11434, not localhost.
How to read this guide
- Studio labels drift; we follow flows and concepts from official docs, not unverified button names
- Comparisons with LangChain mean “same RAG / agent ideas, different delivery”
- Commands match upstream: clone the latest release tag,
cd dify/docker,cp .env.example .env,docker compose up -d