app icon
DifyFS
0.0.2

Navigate and query your Dify knowledge base like a filesystem: ls, cat, grep, find, and search over documents organized by virtual paths.

ki3nd/difyfs441 installs

DifyFS

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

Concept

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.

Setup

Credentials required:

FieldDescription
Service API EndpointYour Dify instance API base URL, e.g.
API KeyA dataset-scoped API key from your Dify workspace

Tools

— Assign a virtual path to a document

Set the (and any other metadata) on a document. This is the first step before using any other tool.

— List directory contents

Output:

— Read a file

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.

— File or directory info

— Search for a pattern

Searches line by line, returns output.

Two modes:

  • Single-file mode — when matches an exact slug. Fetches all chunks and applies regex. 100% accurate.
  • Directory mode — when is a prefix or empty. Uses Dify full-text search as a coarse filter (top_k segments), then applies regex line by line. Best-effort — recall depends on .

— Find files by name pattern

Glob matching on the filename part of each slug. Supports and .

— Semantic / full-text / hybrid search

Returns matching chunks with virtual file path, relevance score, and a 300-character preview.

How slugs work

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.

Limitations

  • No overlap support in — chunk overlap produces duplicate text at boundaries. Use overlap = 0 when configuring your dataset chunking.
  • Directory mode grep is best-effort — Dify's retrieve API returns at most chunks. Segments not in the top-k are not searched.
  • No write operations — difyfs is read-only by design. Document creation and deletion are not supported.

Future Work

  • Group-based filtering — a metadata field on documents could be used to scope , , , and to a named group (e.g. ).
  • Public/private access control — a metadata field (/) could let tools filter out private documents, enabling basic visibility control within a shared dataset.
CATEGORY
Tool
VERSION
0.0.2
ki3nd·04/27/2026 03:47 AM
REQUIREMENTS
Tool invocation
Maximum memory
256MB