Repository navigation
en articles dify langbot rag knowledge base
LangBot 4.6.0 External Knowledge Base Tutorial: Integrating Dify with LangBot for RAG-powered Conversations
This article is synchronized from the LangBot Blog. Read the canonical version.
Published 2025-12-02 · Author: LangBot Team

LangBot 4.6.0 introduces external knowledge base functionality, allowing users to integrate external knowledge retrieval services such as Dify and RAGFlow into conversation pipelines. This tutorial demonstrates how to combine Dify knowledge base with LangBot to enable intelligent conversations based on domain-specific knowledge.
The external knowledge base feature enables LangBot to:
- Connect to various external knowledge retrieval services (Dify, RAGFlow, etc.)
- Provide professional answers based on domain-specific knowledge
- Flexibly extend knowledge retrieval capabilities through the plugin system
- Configure conveniently through WebUI without manual configuration file editing
Before starting, you need:
- Deploy LangBot 4.6.0 or higher
- Have a Dify account (register at https://cloud.dify.ai)
- Configure a conversation model (this tutorial uses claude-opus-4-1-20250805)
First, visit the LangBot GitHub repository to understand the project. LangBot is a production-grade instant messaging bot development platform supporting multiple messaging platforms and LLM services.
Visit the official LangBot documentation to view the external knowledge base usage instructions. The documentation provides detailed explanations on how to build built-in knowledge bases and connect to external knowledge bases.
Use the uvx langbot command to quickly start LangBot, then visit http://127.0.0.1:5300 for initialization. Fill in your email and password to complete registration, then log in.
After successfully logging in, you will see the LangBot WebUI dashboard.
Before using the knowledge base, you need to configure a conversation model.
Click "Models" in the left navigation bar to enter the model configuration page.
Click the "+" button to open the model configuration dialog.
Fill in the following information:
- Model Name: claude-opus-4-1-20250805
- Model Provider: New API
- Request URL: Your API endpoint
- API Key: Your API Key
- Abilities: Check Vision Ability and Function Call
Click "Submit" to save the configuration.
Visit https://cloud.dify.ai and log in to your account.
Click "Knowledge" in the top navigation bar to enter the knowledge base management page.
Click "Create Knowledge" to start creating a knowledge base.
You can choose from the following methods to import data:
- Import from file: Upload document files
- Sync from Notion: Sync from Notion
- Sync from website: Crawl website content
This tutorial selects "Import from file" and uploads prepared LangBot documentation.
After uploading the document, the system will display file information. Click "Next" to proceed.
On the document processing page, you can configure chunk settings, index method, and retrieval settings:
- Chunk Settings: General mode, maximum chunk length 1024 characters
- Index Method: High Quality (uses embedding model)
- Retrieval Setting: Vector Search
Click "Save & Process" to start processing the document.
The system starts processing the document and generating vector embeddings.
After processing is complete, the knowledge base is ready to use.
Click the "Service API" button in the bottom right. Record the following information:
- Service API Endpoint: https://api.dify.ai/v1
- Dataset ID: Get from the URL
Click the "API Key" button to view the API key. Record your API Key for use in subsequent configuration.
In the LangBot WebUI, click "Knowledge" in the left navigation bar.
Click the "External" tab.
Click the "+" button to open the add external knowledge base dialog. In this dialog, you need to:
- Knowledge Base Name: Give the knowledge base a name
- Knowledge Base Description: Add a description (optional)
- Retriever: Select a knowledge retriever plugin
Note: Using an external knowledge base requires installing the corresponding knowledge retriever plugin first. You can search for and install the Dify knowledge retriever plugin in the plugin marketplace.
After installing the plugin, select the corresponding plugin from the Retriever dropdown, then fill in the configuration information obtained from Dify (API Endpoint, API Key, Dataset ID).
After configuring the external knowledge base, you need to enable it in the pipeline:
- Navigate to the "Pipelines" page
- Edit or create a new pipeline
- On the "AI Capabilities" page, select "Built-in Agent" as the runner
- In the knowledge base selection, check the external knowledge base you just configured
- Save the pipeline configuration
Test in the pipeline's "Conversation Testing" page, or bind the pipeline to a bot for actual conversation testing. When users ask questions, LangBot will automatically retrieve relevant content from the Dify knowledge base and generate answers combined with the retrieved knowledge.
Visit the LangBot plugin marketplace, search for "Knowledge Retriever" or "Dify", find the corresponding plugin and click install.
LangBot currently supports multiple external knowledge retrieval services through the plugin system, including:
- Dify
- RAGFlow
- Other custom knowledge retrieval services
Specific supported services can be viewed in the plugin marketplace.
- Built-in Knowledge Base: Data is stored locally in LangBot, with LangBot handling vectorization and retrieval
- External Knowledge Base: Data is stored in external services (like Dify), with retrieval performed through API calls
The advantage of external knowledge bases is the ability to leverage the capabilities of professional LLMOps platforms, such as Dify's advanced document processing and multiple retrieval strategies.
Yes. In the pipeline configuration, you can check multiple knowledge bases (built-in or external) simultaneously, and LangBot will comprehensively utilize the content from these knowledge bases to generate answers.
Through this tutorial, you learned how to:
- Create a knowledge base and upload documents on the Dify platform
- Obtain Dify API key and related configuration information
- Configure a conversation model in LangBot
- Add an external knowledge base in LangBot
- Configure pipelines to use external knowledge bases
The external knowledge base feature provides LangBot with more powerful and flexible knowledge management capabilities. Combined with professional LLMOps platforms like Dify, you can build more intelligent and professional conversational bots.
Automatically synchronized from langbot-app/langbot-docs.
简体中文
指南
开发者
- 插件开发
- 插件 SDK API
- 核心开发
文章
- 浏览
- 产品动态
- 在线体验
- 技术解析
- 教程与集成
- 公告
API 参考
- Service API
English
Guides
- Quick Start
- Installation
-
Configure Bots
- Bots
- Discord
- Telegram
- Slack
- Mattermost
- LINE
- Web Page Bot
- HTTP Bot
- KOOK
- Feishu
- DingTalk
- WeChat Official Account
- QQ (OneBot v11)
- Satori (QQ & Multi-Platform)
- QQ Official Bot
- WeCom (Enterprise WeChat)
- AI Configuration
- Advanced Operations
- Using Plugins
- Enterprise support
Developers
-
Plugin Development
- Plugin Development Tutorial
- Completing Plugin Configuration Information
- Plugin Directory Structure
- Component Development
- Code Style Guide
- Certified plugins and shared runtime
- Publish Plugin
- Migration Guide
- Plugin SDK API
- Core Development
Articles
- Browse
- Product Updates
- Engineering
-
Tutorials & Integrations
- LangTARS: Open-Source AI Agent for Remote PC Control — Works with Dify, n8n & 10+ Messaging Platforms
- How to Connect DeepSeek R1 to WeChat, Discord & Telegram in 5 Minutes (FREE)
- Deploy Your Own AI Bot to Discord, Telegram & WeChat in 5 Minutes
- Finally Got My Dify Agent Working in Discord, Telegram and Slack
- How I Built a Multi-Platform AI Bot with Langflow's Drag-and-Drop Workflows
- How I Built a Multi-Platform AI Chatbot with n8n and LangBot
- LangBot 4.6.0 External Knowledge Base Tutorial: Integrating Dify with LangBot for RAG-powered Conversations
- Announcements
API Reference
- Service API
Other pages
日本語
ガイド
開発者
- プラグイン開発
- プラグイン SDK API
- コア開発
記事
- 一覧
- 製品アップデート
- エンジニアリング
-
チュートリアルと連携
- LangTARS:Dify・n8n と連携するオープンソース PC 操作 Agent
- DeepSeek R1 を WeChat・Discord・Telegram に5分で接続する方法
- AI Bot を Discord・Telegram・WeChat に5分でデプロイ
- Dify Agent を Discord・Telegram・Slack で動かす
- Langflow のドラッグ&ドロップでマルチプラットフォーム AI Bot を構築
- n8n と LangBot でマルチプラットフォーム AI Chatbot を構築
- LangBot 4.6.0 外部ナレッジベース入門:Dify と連携した RAG 会話
- お知らせ
API リファレンス
- Service API