> 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/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/gZhgznNINYHCyKS5uKHU" alt=""><figcaption></figcaption></figure>

1. 打开 `搜索MCP`。
2. 添加 `dify-knowledge` 服务器。

### 配置 Dify 知识库

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

> 需要配置参数和环境变量

1. Dify知识库key可以通过以下方式获取

<figure><img src="/files/8M220WHPDdd2zarqdVww" alt=""><figcaption></figcaption></figure>

### 使用Dify知识库mcp

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

***

### 💡 获取帮助与提交反馈

如果您在配置或使用过程中遇到任何疑问、Bug 或有功能改进建议，请参考 [反馈与建议](/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/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.
