To make a distinction, knowledge bases independent of the Dify platform are collectively referred to as “external knowledge bases” in this article.

Functional Introduction

For developers with advanced content retrieval requirements, the built-in knowledge base functionality and text retrieval mechanisms of the Dify platform may have limitations, particularly in terms of customizing recall results.

Due to the requirement of higher accuracy of text retrieval and recall, as well as the need to manage internal materials, some developer teams choose to independently develop RAG algorithms and independently maintain text retrieval systems, or uniformly host content to cloud vendors’ knowledge base services (such as AWS Bedrock).

As a neutral platform for LLM application development, Dify is committed to providing developers with a wider range of options.

The Connect to External Knowledge Base feature enables integration between the Dify platform and external knowledge bases. Through API services, AI applications can access a broader range of information sources. This capability offers two key advantages:

  • The Dify platform can directly obtain the text content hosted in the cloud service provider’s knowledge base, so that developers do not need to repeatedly move the content to the knowledge base in Dify;
  • The Dify platform can directly obtain the text content processed by algorithms in the self-built knowledge base. Developers only need to focus on the information retrieval mechanism of the self-built knowledge base and continuously optimize and improve the accuracy of information retrieval.

Principle of external knowledge base connection

Connection Example

how-to-connect-aws-bedrock?

FAQ

How to Fix the Errors Occurring When Connecting to External Knowledge API?

Solutions corresponding to each error code in the return information:

Error CodeResultSolutions
1001Invalid Authorization header formatPlease check the Authorization header format of the request
1002Authorization failedPlease check whether the API Key you entered is correct.
2001The knowledge is not existPlease check the external repository