Chatbot, legacy Agent, and Text Generator apps can’t search an agent knowledge base. To answer from one, rebuild the app as a Chatflow or an Agent.
From Workflow and Chatflow Apps
Add an Agent Knowledge Retrieval node and pick the knowledge bases it searches. A knowledge base you don’t have permission to view doesn’t appear in the picker. To limit searches to certain documents, filter by metadata in the node. To stop every workflow from searching the knowledge base, test runs included, turn off Workflow access in the knowledge base’s Settings. Workflows that already use it fail at that node until you turn it back on.From the New Agent
In an Agent’s Configure editor, add the knowledge base under Agent Knowledge Base. The Agent decides on its own when to search the knowledge base by its name and description, always at the Fast retrieval depth. To stop published Agents from searching the knowledge base, turn off API access in the knowledge base’s Settings. Agents that use it keep running but can no longer search it. The same switch cuts off the Service API.From Your Own Code
Through the Service API, your code can ask the knowledge base questions, run longer Research searches in the background, and maintain its documents. To shut API callers out, turn off API access in the knowledge base’s Settings; Agents lose access too.From Your Coding Agent
A coding agent on your own machine, such as Claude Code or Codex, can use the knowledge base as reference while it works. Through the Dify CLI, it browses the documents like files in folders, reads them, and searches them for exact words. It can’t change anything in the knowledge base. To search by meaning, as your apps do, use the Service API. To set it up, follow Get Started in the CLI docs: installdifyctl, sign in with your Dify account, and give your agent the difyctl skill.
Then ask your agent for what you need, and include two things:
difyctl knowledge_fs, the commands to use. Thedifyctlskill doesn’t cover them.- The knowledge base’s ID. With the knowledge base open in Dify, copy it from the browser’s address: it’s the part between
/datasets/new/and the next/.
difyctl to that workspace first.