Complete guide to Dify

Getting started

You can use Dify in the cloud (dify.ai) or self-host it for free with Docker Compose. From the dashboard, create a new app, go to Settings -> Model Provider to add your API credentials (OpenAI, Anthropic, Gemini, or others), and build your flow with the visual drag-and-drop editor, combining prompts, tools, and knowledge sources.

Use cases

Chatbots and customer support
Build chat systems with the company's own knowledge without writing code, connecting the model to a document database.
RAG applications over your own documents
Upload PDFs, text, or other sources to the built-in RAG engine to create an assistant that answers questions based on that specific information.
AI workflows
Chain processing steps, model calls, and external tools in a visual flow to automate complex tasks.
Agents with tool access
Give an agent the ability to use external tools (search, APIs, calculators) in addition to generating text, for tasks that require action, not just a response.

Advanced setup

  1. Model provider
    Dify supports multiple providers (OpenAI, Anthropic, Google Gemini, Azure OpenAI, Mistral, and local models via Ollama or LM Studio), configurable per app.
  2. RAG engine
    Lets you upload your own documents as a knowledge base; it's worth checking how it chunks the documents so responses cite the right part.
  3. Publishing modes
    A finished app can be published as an embeddable iframe, a JavaScript widget, a shareable URL, or a full REST API, depending on where you want to integrate it.

Tips

  • Start with the official cloud to test the flow before considering self-hosting with Docker, so you avoid dealing with infrastructure issues while you're still designing the agent.
  • If RAG responses don't cite sources well, check the document chunk size first before switching models.
  • Use Chatflow mode for conversations with context memory and Workflow for single-step processes that don't need to maintain dialogue.
  • Test the same flow with two different model providers before settling on one in production - cost and quality vary quite a bit depending on the use case.

FAQ

Is Dify free?
It's open source and can be self-hosted for free; there's also a cloud version with paid plans based on usage.
Do I need to know how to code to use Dify?
Not for building basic flows with the visual editor, but it does help for advanced integrations via API or self-hosted deployment.
Can I use my own documents as a knowledge base?
Yes, the built-in RAG engine lets you upload PDFs, text, or other sources so the agent can answer based on them.
Based on Researched at dify.ai/blog, the official documentation, and github.com/langgenius/dify (August 2026).