Agent in Dify access Knowledge Base directly

Hi everyone,

I’m experimenting with Dify and noticed that the Agent node is designed to call tools only, but it cannot directly access the Knowledge Base / vector DB.

I want the AI to be able to self-reason (self-ask) in order to:

  1. Break down a user question into smaller sub-questions.

  2. Query the Knowledge Base to retrieve accurate information.

  3. Aggregate the results and provide a final answer to the user.

Does anyone have experience implementing this kind of workflow in Dify when the KB is not a tool?

Thanks!

@nam
Hi, the simplest way I know is:

  1. Create a workflow that performs only knowledge retrieval and returns the result.
  2. Publish it as a “Workflow as Tool”.
  3. Add the published tool to the agent node.

This way, agents can use the knowledge retrieval feature as a tool.

Hope this helps :slight_smile:

2 个赞