DeepSeekDSH
Independent community guideNot affiliated with DeepSeek.Download versions and guide references

Build DeepSeek RAG Knowledge Bases and Workflows with Dify

Dify is the leading low-code platform for LLM applications. Learn how to configure DeepSeek API, build production RAG knowledge bases, and design automated agent workflows in Dify.

On this page
Dify DeepSeek parameters
  • Provider type: DeepSeek or OpenAI-API-compatible
  • API Base URL: https://api.deepseek.com or https://api.deepseek.com/v1
  • Model for daily tasks / Agent: deepseek-chat (Supports tool execution)
  • Model for deep reasoning: deepseek-reasoner (R1 chain of thought)
STEP 1

Add DeepSeek model provider in Dify

Whether using Dify Cloud or a self-hosted Docker deployment:

  1. Log in to Dify and navigate to Settings → Model Providers via your profile icon in the top right.
  2. Locate DeepSeek (or select OpenAI-API-compatible).
  3. Click Set / Add Credentials:
    • API Key: Your sk-... key from the DeepSeek Platform.
    • API Base URL: https://api.deepseek.com
  4. Save the settings and verify that deepseek-chat and deepseek-reasoner show active status.
STEP 2

Build an enterprise RAG knowledge base

Leverage DeepSeek's long-context fidelity for document Q&A:

  1. Click Knowledge → Create Knowledge in the top navigation.
  2. Upload your internal documents (PDF, DOCX, Markdown, CSV).
  3. Recommended segmentation: Choose Custom chunking with max segment length around 800 ~ 1000 tokens and overlap of 100 tokens.
  4. Retrieval mode: Select Hybrid Search (combining vector embeddings and keyword search) paired with a Reranking model for optimal precision.
STEP 3

Design automated visual workflows

Create a Workflow application to orchestrate multi-step data pipelines:

Information extraction & JSON transformation

Use a deepseek-chat node to extract structured entities from unstructured customer queries, passing the parsed output to Dify Code nodes for API integration.

Complex synthesis & report generation

Deploy a deepseek-reasoner node after knowledge retrieval steps to synthesize comprehensive, audit-ready technical briefs and business proposals.

STEP 4

Publish as a standalone Web App or API

Once verified, click Publish in the top right corner:

  • Standalone Web App: Share a hosted, mobile-friendly chat URL directly with internal team members.
  • Embedded Widget: Copy the script snippet to embed an AI assistant widget inside your company portal.
  • Backend API: Call the published workflow directly from backend microservices using standard REST endpoints.

Troubleshooting

Embedding model missing or failed

DeepSeek API provides language generation and reasoning endpoints rather than embedding vectors. Configure an embedding provider (such as SiliconFlow, OpenAI text-embedding-3, or local BGE) in Dify for document indexing.

401 Authentication Error

Verify that your API key is pasted accurately without extra spaces, and ensure your DeepSeek Platform account has positive balance.

References