> For the complete documentation index, see [llms.txt](https://docs.cherry-ai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherry-ai.com/docs/zhong-wen-fan-ti/advanced-basic/mcp/dify.md).

# 配置 Dify 知識庫

[Dify](https://dify.ai/) 係一個企業級 AI 應用平台，入面亦內置咗知識庫功能。如果你已經喺 Dify 上建好咗知識庫（公司用 Dify 維護內部資料、或者個人用 Dify 試做 RAG 應用），本頁教你**令 Cherry Studio 入面嘅 AI 直接查詢 Dify 知識庫**。

簡單講：**你唔使將資料由 Dify 搬到 Cherry Studio，Cherry Studio 入面嘅對話就可以查到 Dify 嗰邊嘅內容**。

要求：Cherry Studio v1.2.9 或更高版本；已喺 Dify 入面建立好至少一個知識庫，並攞到該知識庫嘅 API Key。

### 新增 Dify 知識庫 MCP 伺服器

<figure><img src="/files/525f48b528f21c52b8ca3f82cddd1329bfa8e976" alt=""><figcaption></figcaption></figure>

1. 打開 `搜尋 MCP`。
2. 添加 `dify-knowledge` 伺服器。

### 設定 Dify 知識庫

<figure><img src="/files/7d87b32cb2f7a119ced5b9ac03d870c2ccc0a82c" alt=""><figcaption></figcaption></figure>

> 需要設定參數同環境變數

1. Dify 知識庫 key 可以透過以下方式獲取

<figure><img src="/files/9ad67bd22a108375616a2a69daaf187777bc6584" alt=""><figcaption></figcaption></figure>

### 使用 Dify 知識庫 mcp

<figure><img src="/files/f8f47c92d5177b615723674038cd848f0750d7eb" alt=""><figcaption></figcaption></figure>

***

### 💡 獲取幫助同提交反饋

如果您喺配置或使用過程中遇到任何疑問、Bug 或有功能改進建議，請參考 [反饋同建議](/docs/zhong-wen-fan-ti/question-contact/suggestions.md) 入面提供嘅官方渠道。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherry-ai.com/docs/zhong-wen-fan-ti/advanced-basic/mcp/dify.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
