Summary: Dify is an open-source platform for building AI apps, and one of its most practical uses is a support chatbot that answers only from your own help docs. This playbook walks through the whole path on Dify Cloud: load your docs into a knowledge base, test what it finds, wire a Chatflow that refuses off-topic questions, and embed the bot on your site. The free Sandbox plan is enough to build and test a small version, but its 200 message credits and 10 knowledge requests per minute run out quickly once real visitors arrive.
Who this playbook is for
Picture a small software shop, an online course, or a freelancer with a product FAQ. The same twenty questions arrive by email every week, and the answers already exist in a help center or a folder of PDFs. A generic chatbot would make things up; what you want is a bot that looks up the right passage first and then answers from it. That pattern is usually called retrieval-augmented generation, and Dify packages it as a "knowledge base" you can attach to an app without writing code.
If you would rather host a private chat interface for your team than a public support bot, our Open WebUI playbook for small teams is the better fit. This one is about a customer-facing assistant.
Step 1: Create a workspace and pick your models
Sign up at cloud.dify.ai. New workspaces start on the free Sandbox plan. Before you build anything, check two settings, because a missing model is the most common reason a first bot does nothing.
- Model provider. Go to Integrations > Model Provider and install one of the providers that Dify's built-in AI credits support. Dify's docs say each AI response is one model call and counts as one response no matter how many tokens it uses, but larger models cost more credits per response than smaller ones. If you already have an OpenAI, Anthropic or similar key, click Setup on the provider card and add it; your own key bills to your provider account instead of using Dify's credits.
- Default models. Click Default Models at the top right of the model page and make sure an Embedding Model is set. That model turns your documents into searchable vectors. Dify's docs warn that when a default is empty, the features relying on it stop working.
Tip: the provider card has a Usage Priority setting, so you can let Dify's credits run first and have your own key take over when they are gone.
Step 2: Build the knowledge base from your help docs
Choose the kind of knowledge base
Dify now offers two kinds. An Agent Knowledge Base organizes and indexes content on its own, lets you choose a retrieval depth (Fast, Deep or Research), keeps connected sources in sync on a schedule, and includes quality tools such as golden questions. A Classic Knowledge Base lets you set chunking, index method and search method yourself. Dify's docs recommend the agent kind for new projects, with one important exception: the simple Chatbot app type can only use classic knowledge bases. Chatflow apps, which this playbook uses, can use either.
Add content
Go to Knowledge, switch to Agent, and click Create. Give it a name and a description, then add content in one of two ways:
- Upload files for standalone documents such as a PDF manual. Files can be up to 15 MB each on an agent knowledge base. Batch uploads are a Professional and Team feature.
- Connect a source when your docs live on a website or in Notion or Google Drive. Website crawling goes through a data source integration such as Firecrawl, which you set up in Integrations > Data Source with its own API key. You then paste the URL, click Crawl & preview, and pick which pages to import. The sync policy can be a preset, a custom interval from 1 hour to 30 days, or manual.
Start with ten or so of your most-asked help articles, not the whole site. Dify's own docs give the same advice: changing the embedding or reasoning model later re-indexes every document, which is cheaper while the knowledge base is small. On the free plan it also protects your 50-document quota.
Step 3: Test retrieval before any customer sees it
This is the step most tutorials skip, and it is where a support bot is won or lost. A model can only answer well if the right passage comes back first.
- Open the knowledge base's Retrieval Test page and type real customer questions in full sentences, the way people actually write them, such as "I was charged twice this month, how do I get a refund?" rather than "refund".
- Run the same question at each retrieval depth and keep the one that returns the right chunk most reliably as your default.
- When a result is right, click Keep golden question and tick the chunks that must come back. These become a regression test: after any later change, run Quality > Evaluations to confirm they still pass.
- When the right chunk is missing, click Make bad case. Dify's docs suggest first checking how the document was indexed, then widening the search with a higher Top K or a lower score threshold. If the chunk comes back but ranks too low, try a different rerank model.
If you use a classic knowledge base instead, you can pick hybrid search and set a weight between meaning-based and keyword matching; the official docs screenshot shows 0.7 semantic and 0.3 keyword. Product names, error codes and plan names are exactly the kind of words where keyword matching helps.
Step 4: Wire the Chatflow
In Dify, choose Create from Blank > Chatflow. Dify's customer service tutorial builds the bot from four kinds of nodes, and the layout is worth copying:
- Question Classifier. Sort each incoming message into categories such as "question about our product", "asking for a human", and "off-topic". Make the categories specific and clearly different from each other; the docs note that a stronger model classifies more accurately.
- Answer node for off-topic and handoff. These branches do not need a model at all. Reply with fixed text, for example a link to your help center or your support email. That saves credits and stops the bot from chatting about the weather.
- Knowledge Retrieval node on the product-question branch, pointing at the knowledge base you built.
- LLM node after retrieval. Set the retrieval output as its context and write a system prompt along the lines of: "Answer the customer's question using only the context. If the context does not contain the answer, say you are not sure and share the support email." You can insert variables by typing
/or{in the prompt editor.
Turn on memory in the LLM node if you want follow-up questions like "and what about the yearly plan?" to make sense. Before publishing, run the same questions you tested in Step 3 through the finished flow.
Step 5: Publish and embed it on your site
Click Publish. Your app gets a web app URL you can share as-is. To place it on your own site, open the app's Access Point tab and choose Embed Into Site on the Web App card. Dify offers three ways to embed it:
- A chat bubble, a floating button that opens the bot in an overlay. It is configured through a
window.difyChatbotConfigobject that holds your app token, plus optional styling and pre-filled inputs. - An iframe that keeps the chat always visible in the page.
- JavaScript control for custom styling and behavior.
All three use the same published app, so later edits apply everywhere it is embedded. If you want the bot to hand conversations to another tool, such as logging unanswered questions into a spreadsheet, an automation tool like n8n can sit behind it; our n8n AI agent troubleshooting guide covers the usual errors there.
What the free plan really covers
The table below compares the three Dify Cloud plans using the figures on the official pricing page with monthly billing selected. Annual billing lowers the price (the page shows $590 and $1,590 per workspace per year).
| Item | Sandbox | Professional | Team |
|---|---|---|---|
| Price | Free | $59 per workspace / month | $159 per workspace / month |
| Message credits | 200 (no monthly refill) | 5,000 / month | 10,000 / month |
| Team members | 1 | 3 | 50 |
| Apps | 5 | 50 | 200 |
| Knowledge documents | 50 | 500 | 1,000 |
| Knowledge data storage | 50 MB | 5 GB | 20 GB |
| Knowledge requests per minute | 10 | 100 | 1,000 |
| Log history | 30 days | Unlimited | Unlimited |
| Dify API rate limit | 5,000 / month | No limit | No limit |
Prices exclude tax. The self-hosted Community edition is also free under the Dify Open Source License, but then hosting, updates and model keys are on you.
Editor's note
Good fit: small businesses and solo founders with a stable help center or product manual who want a bot that stays on topic, and who are fine adding their own model API key once free credits run out.
Not a fit: anyone expecting the free plan to serve live traffic. With 200 one-time credits, and every model call in your flow costing at least one response, a two-model Chatflow (classifier plus answer) uses credits roughly twice as fast as a single call per message.
Gotchas we found in the docs:
- "Too many requests" while testing. On Sandbox, the 10-per-minute knowledge limit counts each retrieval test, each file upload (twice: when added and when processing starts), and on classic knowledge bases each Knowledge Retrieval node run. Refused requests count too, so wait a full minute instead of clicking again. Over the Service API this shows up as a 403 with the code
forbidden. - Document quota fills up mysteriously. Disabled, archived and failed documents all still count toward the 50-document limit. Delete what you do not need.
- Upload shows "Error". On a classic knowledge base, Dify may refuse a document if indexing it would exceed your storage. Free space or upgrade, then click Retry. Usage numbers can take several minutes to update.
- Bot answers with nothing useful. Check that an embedding model is set under Default Models and that the documents show Ready.
FAQ
Can I keep using Dify after the 200 free credits are gone?
Yes. Dify's docs say that when the credits run out you can configure your own model provider API keys and keep going. The bot then costs whatever your provider charges per call. If you want cheap or free models to start with, see our OpenRouter free models breakdown.
Is there a discount for students or teachers?
Dify for Education lets verified current students, teachers and school staff use the Yearly Professional plan for free, re-verified each year. It needs a school-issued email, applies only to the yearly plan, and keeps AI credits at the Sandbox level of 200 one-time credits, so you will still want your own API key.
If I downgrade, do I lose my knowledge base?
No. According to Dify's docs, if a downgrade leaves your data above the new plan's limits, nothing is deleted and your apps can still search it, but adding content stays blocked until usage fits or you upgrade again. A downgrade takes effect at the start of your next billing cycle.
Build it small, test it with real questions, and only then put it in front of customers.
Image credits: Dify documentation (hybrid search settings), plus our own screenshots of the public Dify pricing page and Dify docs; see the official screenshots at the end of this post.
Last verified: 2026-10-29
Sources:
- Dify pricing
- Dify docs: Customer Service Bot With Knowledge Base
- Dify docs: Knowledge
- Dify docs: Create an Agent Knowledge Base
- Dify docs: Test and Tune Retrieval
- Dify docs: Knowledge Request Rate Limit
- Dify docs: Knowledge Storage and Document Quotas
- Dify docs: Model Providers
- Dify docs: Embed Your Web App
- Dify docs: Billing
댓글
댓글 쓰기