Navigate and query your Dify knowledge base like a filesystem: ls, cat, grep, find, and search over documents organized by virtual paths.
Navigate and query your Dify knowledge base like a filesystem: ls, cat, grep, find, and search over documents organized by virtual paths.
Author: ki3nd
Type: tool
Github Repo: https://github.com/ki3nd/DifyFS
Github Issues: issues
The idea comes from two sources:
Mintlify ChromaFS — treats a vector store as a filesystem, assigning each document a path (e.g. ) and using the vector DB as both a coarse filter and a content store. Grep works in two stages: coarse filter via vector similarity, then fine line-by-line regex.
vkfs — a Go implementation of the same idea, supporting SQLite and Zilliz backends. difyfs adapts the same virtual path model and two-stage grep to work on top of the Dify Knowledge Base API.
Each document in your dataset gets a metadata field — its virtual path in the filesystem. Tools then navigate and read documents by slug.
Credentials required:
Set the (and any other metadata) on a document. This is the first step before using any other tool.
Output:
Returns the full text of a document by its slug path. Content is reconstructed by joining all text chunks in order.
Note: difyfs assumes datasets are chunked without overlap. If your dataset uses chunk overlap, output will contain duplicated text at chunk boundaries.
Searches line by line, returns output.
Two modes:
Glob matching on the filename part of each slug. Supports and .
Returns matching chunks with virtual file path, relevance score, and a 300-character preview.
A slug is a -separated path string stored as document metadata:
Virtual directories are derived automatically — any common prefix becomes a navigable directory. There is no need to create directory entries explicitly.
Use to assign slugs to documents before navigating the filesystem. Documents without a slug fall back to using their document name as the path, placed at root.