TECHNOLOGY

Dify Agent Knowledge Retrieval can succeed with an empty result

In this article
THE QUICK TAKE

A successful retrieval node can return no evidence; connect its result deliberately and decide what the application should do before the LLM answers.

Define success for the whole application

A workflow should answer a policy question only when approved evidence is found. A green retrieval node is insufficient for that requirement. Dify’s beta Agent Knowledge Retrieval reference explicitly permits successful execution with an empty result. Define application success in terms of the needed evidence, rather than borrowing the node’s execution status as proof that the policy was found.

Connect both evidence and question

The node supplies material for later nodes. In a downstream LLM on the same execution path, select result as Context and actually insert the Context variable into the prompt. Pass the original question into the User message and instruct the model to answer from retrieved material. A drawn connection does not itself prove that the text entered the answer prompt. Inspect the configured variables when a plausible response ignores the source.

Route no matches deliberately

If the application must not answer without evidence, branch on an empty result before generation. The empty branch can report that the selected collection did not supply a supporting passage, preserving the user’s question for review. Do not silently replace an internal procedure with general model knowledge. The retrieval settings explain why depth and threshold changes can alter returned material, but relaxing them is a different decision from defining the no-evidence response.

Separate failure from an empty evidence set

The node can search several knowledge bases, but a failure in any selected base returns no partial results and stops the run. The connection guide documents Workflow access as another possible blocking condition. An empty successful result and failed retrieval therefore deserve different diagnostics. Increasing Top K will not restore disabled access, and an unavailable collection should not be described as proof that the underlying policy does not exist.

Test the node contract and answer separately

Research depth in this node returns matching chunks rather than generating the answer shown by a retrieval test. Check a supported question, an unsupported question, and a deliberately unavailable test dependency in a controlled environment. The tool-observation guide distinguishes execution from established evidence; citation coverage checks the later claims. Keep the node outcome and final answer decision visible as separate application states.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles