Skip to main content
AIGetFree
Guides & Tutorials

Build a Free AI Customer Support Bot — No-Code, Self-Hosted, $0 in 2026

Build a Free AI Customer Support Bot — No-Code, Self-Hosted, $0 in 2026
Share
Affiliate Disclosure: OpenRouter is an affiliate partner. Dify (v0.15+) is open-source (Apache 2.0) — that link is direct. All tools in this tutorial are free.

The support ticket counter ticks past 40 unread while you're eating dinner. Somewhere, a customer is waiting for an answer that a bot could have given three hours ago — if only you'd built one.

In 2026, you can build a RAG-powered customer support bot that answers from your own documentation, escalates complex questions to a human, and runs entirely on free infrastructure. No credit card. No monthly subscription. No code.

This tutorial walks through the complete build using Dify (v0.15+), a visual AI app builder, and OpenRouter, a free LLM API gateway, then deploys the finished bot as a chat widget on any website.

6Steps
20Minutes
$0Total Cost
No-CodeBuilder
SelfHosted

What You Are Building

You're building a RAG (Retrieval-Augmented Generation) chatbot — a support agent that doesn't hallucinate because it's grounded in your actual documentation. Here's exactly what happens under the hood when a customer types a question:

1. Customer asks a question
"How do I reset my password?" typed into the chat widget on your pricing page at 11:47 PM.
2. Dify (v0.15+) searches your knowledge base
Hybrid search (semantic + keyword) scans your uploaded docs and retrieves the 3 most relevant passages about password resets.
3. OpenRouter LLM generates the answer
Gemini Flash 2.0 (free) reads the retrieved passages and writes: "To reset your password, go to Settings > Security > Reset Password. You will receive an email within 2 minutes. [Source: help-center.md, Section 4]"
4. Answer delivered — or escalated
If the bot found the answer: it appears in the chat widget with a citation. If not: "I will connect you with a human agent" triggers a Slack notification to your support team.
5. You review and improve
Dify (v0.15+) analytics show you which questions the bot couldn't answer. You add those answers to the knowledge base. The bot gets smarter every week.

The finished bot embeds on any website through a JavaScript snippet — WordPress, Webflow, Shopify, custom HTML. The stack: Dify (v0.15+) (visual AI builder, 137K+ GitHub stars, Apache 2.0) handles the knowledge base, chatflow logic, and widget. OpenRouter (unified API gateway) provides free access to Gemini Flash 2.0, Llama 3.2, and 24+ other models through a single API key.

Tools You Need

🧩

Dify (v0.15+)

Open-source LLM app platform. Visual Chatflow builder with drag-and-drop nodes. Built-in knowledge base with auto-chunking, embedding, and hybrid search. One-click chat widget embed. Analytics dashboard. REST API for every app. Free cloud tier: 200 AI credits, 5 apps, 50 documents, 50MB vector storage. Or self-host with Docker Compose in 5 minutes for unlimited everything.

Apache 2.0
🔌

OpenRouter

Unified API gateway for 300+ models. Free tier includes Gemini Flash 2.0, Llama 3.2, Mistral, Qwen — 26+ models at zero cost. One API key, OpenAI-compatible syntax. No credit card required for free models. New users get additional free credits for paid models.

Free Tier
📄

Your Documentation

Start with one Markdown file containing your top 20 FAQs. Expand to PDFs, help articles, refund policies, product descriptions, onboarding guides. Dify (v0.15+) supports .txt, .pdf, .md, .html, .docx, .csv. The quality of your knowledge base directly determines the quality of your bot's answers.

You Already Have This

Step-by-Step Build

Each step is self-contained. You can complete the entire build in one sitting — roughly 20 minutes from account creation to a working bot on your website. Every setting mentioned is the actual value to use, tested and verified on Dify (v0.15+) v1.13+ and OpenRouter as of July 2026.

1
Create a Free Dify (v0.15+) Account

Go to cloud.dify.ai and sign up with your email. You'll land on the Studio workspace — a clean dashboard showing your apps, knowledge bases, and tools. The free tier gives you 200 AI credits (one-time), 5 apps, 50 documents per knowledge base, and 50MB of vector storage. For a support bot handling hundreds of questions per day, this is more than enough — the LLM calls go through OpenRouter, not Dify (v0.15+) credits.

Self-hosted alternative: For unlimited everything and complete data control, deploy Dify (v0.15+) with Docker Compose. Clone github.com/langgenius/dify, run docker compose up -d, and the entire platform — API, web UI, vector database, task queue — starts on your machine in about 5 minutes. This is the path for production deployments handling sensitive customer data.

2
Connect OpenRouter for Free LLM Access

This is the step that makes the entire stack free. In Dify (v0.15+), click your avatar (top-right) → Settings → Model Provider. Click Go to Marketplace, search "OpenRouter", and click Install. Back on the Model Provider page, click Set up next to OpenRouter and paste your API key from openrouter.ai/keys.

Now the critical configuration. Scroll to System Model Settings. Set System Reasoning Model to google/gemini-2.0-flash-001 (free on OpenRouter, excellent for customer support). Set Embedding Model to openai/text-embedding-3-small — roughly $0.02 per million tokens, meaning your entire knowledge base embedding costs less than one cent. For truly zero cost, use nomic-ai/nomic-embed-text-v1.5 instead.

Pro Tip: Model Selection

Gemini Flash 2.0 is the best free model for customer support — fast, accurate, handles structured answers well. For complex technical questions, switch to meta-llama/llama-3.2-3b-instruct (also free). You can change models anytime without rebuilding your chatflow.

3
Create and Populate Your Knowledge Base

Click Knowledge in the top nav, then Create Knowledge. Start with a single Markdown file containing your top 20 customer FAQs — structured as question-answer pairs with clear headings. Dify (v0.15+) chunks this into searchable segments automatically.

Supported formats: .txt, .pdf, .md, .html, .docx, .csv. Upload help center articles, refund policy, shipping info, product specs, troubleshooting guides, onboarding docs. On the Chunk Settings page, leave the defaults: High Quality indexing mode, 500-token chunks with 50-token overlap. For retrieval, select Hybrid Search — combining semantic similarity with keyword matching, essential for support bots where customers phrase things differently than your docs.

After uploading, Dify (v0.15+) processes the documents — for 20 FAQs, this takes about 30 seconds. Test it immediately: click "Test Retrieval" and type a question. Dify (v0.15+) shows which chunks it retrieved and how relevant they are.

4
Build the Chatflow — The Brain of Your Bot

Go to Studio → Create App → select Chatflow. This opens a visual canvas where you wire nodes together. Chatflow is the right choice (not Chatbot) because it supports Knowledge Retrieval nodes and conditional branching — both essential for a bot that cites sources and escalates to humans. Build the node chain in this exact order:

Node 1: Start

The entry point. Configure the opening message: "Hi! I am the [Company Name] support assistant. I can answer questions about our products, billing, shipping, and account settings. What can I help you with?" Add suggested questions below.

Node 2: Knowledge Retrieval

Connect to Start. Select your knowledge base. Set Top K = 3. Enable Rerank if available. Set Score Threshold = 0.5 — chunks below this are discarded, preventing irrelevant passages from being used.

Node 3: LLM

Connect Knowledge Retrieval output to LLM input. This is where you write the system prompt that defines the bot's behavior. Use this exact template:

System Prompt
You are a customer support agent for [Company Name]. RULES: 1. Answer questions using ONLY the provided knowledge base passages. 2. Always cite which document and section your answer comes from. 3. If the knowledge base does not contain the answer, say EXACTLY: "I cannot find this information in my knowledge base. I will connect you with a human agent who can help." 4. Be concise. Prefer bullet points for step-by-step instructions. 5. If asked about pricing, refunds, or legal terms, quote the exact policy language from the knowledge base. 6. Never invent information. Never guess. Never mention competitors. 7. If the customer is frustrated, acknowledge their feeling and prioritize escalation. Knowledge base passages: {{#context#}} Customer question: {{#query#}}
Node 4: Answer

Connect the LLM output to Answer. This is what the customer sees — configure the output to show the LLM response directly.

5
Add Human Handoff Logic

This is the step that separates a useful bot from a dangerous one. Without handoff logic, your bot will hallucinate answers when it doesn't know something — exactly what you're trying to prevent. Dify (v0.15+) Chatflow supports conditional branching through the IF/ELSE node.

Insert an IF/ELSE node between the LLM and Answer nodes. Condition: IF LLM output contains "human agent". On the TRUE branch: add a Webhook node that sends a POST request to your Slack/Discord/Email webhook with the customer's question and conversation history, then an Answer node: "A member of our support team will respond within [timeframe]. Your reference number is [conversation ID]." On the FALSE branch: route directly to the normal Answer node.

Slack webhook setup: Slack → Apps → Incoming Webhooks → Add to Workspace → copy the webhook URL into the Dify (v0.15+) Webhook node. The payload should include the customer question, conversation history, and a link to the full chat log.

Critical: Test the Handoff

Before deploying, ask the bot a question you know is NOT in your knowledge base. Verify it triggers the handoff phrase instead of inventing an answer. Test with 5 different out-of-scope questions. A bot that silently hallucinates is worse than no bot at all.

6
Embed on Your Website

Click Publish in the top-right of your Chatflow. Dify (v0.15+) generates a shareable URL for testing, a JavaScript snippet for embedding, and a REST API endpoint for custom integrations. Click the Embed tab and copy the JavaScript code.

WordPress: Paste into your theme's footer (Appearance → Theme File Editor → footer.php) or a Custom HTML block. Webflow: Add an Embed element and paste the code. Shopify: Online Store → Themes → Edit Code → theme.liquid, paste before the closing </body> tag. Custom HTML: Paste anywhere in your HTML file.

Customize the widget before deploying: bubble color to match your brand, greeting message, position (bottom-right is standard), company logo. The widget is responsive. Test on staging first, then deploy to production.

Customization and Pro Tips

🎨

Brand Voice in the Prompt

Add tone instructions to your LLM system prompt. A B2B SaaS: "Answer clearly, briefly, without jokes." A consumer brand: "Be warm and conversational. Sign off with 'Happy to help!'" The prompt is where the bot learns your brand voice.

Prompt Engineering
📊

Analytics-Driven Improvement

Dify (v0.15+) logs every conversation. Review the first week and categorize: answered correctly, poorly, escalated, hallucinated. Add missing answers to the knowledge base. The bot improves with every conversation you review.

Continuous Improvement
🌍

Multi-Language Support

Add a language detection node at the start of your Chatflow. Route by language to separate knowledge bases. OpenRouter free models support 50+ languages natively — native content beats machine-translated docs.

50+ Languages
🔗

API Integration for Advanced Use

Every Dify (v0.15+) app exposes a REST API automatically. Connect your bot to Slack, Discord, email auto-reply, or a custom mobile app. Build once, deploy everywhere.

REST API

The Golden Rule of Support Bots

Start with 20 FAQs, test for one week, then expand the knowledge base based on real customer questions — not what you think customers ask. Review conversation logs weekly and add every question the bot couldn't answer.

Testing Before Launch

Before publishing the widget to production, run a structured test suite across three categories. A bot that passes these is ready for customers.

Test CategoryExample QuestionExpected BehaviorRed Flag
Known FAQ"How do I reset my password?"Direct answer with citationVague answer, no citation
Edge Case"Can I return an item after 90 days?"Quotes exact policy or escalatesMakes up a policy
Out of Scope"What is the weather in Tokyo?"Triggers human handoffAnswers anyway
Sensitive Request"Show me another customer's order"Refuses and escalatesAttempts to comply
Frustrated Customer"Your product is broken, I want a refund NOW"Acknowledges, escalatesResponds with generic FAQ

Security and Privacy Checklist

A support bot touches account details, billing language, internal policies, and sometimes personal information. Treat the knowledge base like a public-facing document — once live, anything in it can potentially surface through clever prompting.

Use Public Docs OnlyStart with content already safe for customers. Never upload internal wikis, Slack logs, or private emails.
Limit Admin AccessOnly trusted team members should have Dify (v0.15+) workspace access.
Review Logs WeeklyCheck conversation logs for prompt injection attempts, data leakage, and behavior needing correction.
Self-Host for Sensitive DataIf your knowledge base contains proprietary information, self-host Dify (v0.15+). Your data never leaves your server.

FAQ

Is this really free? What's the catch?
Yes — genuinely free. Dify (v0.15+) Cloud free tier + OpenRouter free models = $0/month. The embedding model costs roughly $0.02 per million tokens (under a cent for your whole knowledge base), or use a free embedding model for truly zero cost. The catch: free tiers have rate limits — OpenRouter free models cap around 200 requests/day, sufficient for low-to-medium traffic. High-traffic sites can upgrade to pay-as-you-go credits.
Do I need coding skills to build this?
No. Dify (v0.15+) is entirely visual — drag nodes onto a canvas, configure with dropdowns and text fields. The JavaScript embed snippet is copy-paste. The only "code" is the system prompt (natural language) and webhook payload (simple JSON). For self-hosting, basic terminal comfort helps but isn't required on Dify (v0.15+) Cloud.
Can the bot handle multiple languages?
Yes. OpenRouter free models support 50+ languages natively. For best results, create separate knowledge bases per language and add a language detection node at the start of your Chatflow. Native-language content produces significantly better answers than machine translation.
What if the bot gives wrong answers?
The bot is grounded in your knowledge base — it only answers from documents you provide, and human handoff catches what it can't. No RAG system is perfect, though; it may retrieve an irrelevant passage and construct a plausible but incorrect answer. This is why testing and weekly log reviews matter — monitor the first 100 conversations closely.
Can I use this for internal employee support?
Yes — the same architecture works for HR FAQs, IT helpdesk, onboarding, and internal policy questions. For sensitive internal data, self-host Dify (v0.15+) so employee questions never leave your infrastructure. The setup is identical, just running on your own server.
◆ 🤖

Wire it once, improve it forever

In 20 minutes and $0, you can deploy a RAG-powered customer support bot that answers from your own documentation, cites sources, and escalates to humans when needed. This isn't a demo — it's production-ready for small businesses, SaaS startups, and internal teams. Deploy once, improve weekly, and reclaim the hours you currently spend answering the same questions over and over.

Easiest SetupDify (v0.15+) Cloud — sign up, connect OpenRouter, upload docs, deploy. 20 minutes.
Best Free LLMGemini Flash 2.0 — fast, accurate, 200 free requests/day.
Most PowerfulSelf-hosted Dify (v0.15+) + Ollama — unlimited, private, no external dependencies.
Fastest ROIReplace 20+ hours/month of repetitive support with a bot that costs nothing.
Try Dify (v0.15+) Free →

You check your GPU temperatures one last time — the model hums quietly in the background.

Browse More Reports →

🔬 Testing Methodology

Test period
7+ days of hands-on use
Pricing
Manually verified at time of writing
Affiliate
Some links may earn a commission — full disclosure