All articles
4 min read
#FUSE#RAG#Rust#Linux

Why I Gave Agents a Filesystem Instead of Another API

A concrete RAGFS workflow shows why I put file operations, results, and undo on a Linux FUSE mount.

On this page

Why this matters

An agent working in a directory can already list, read, and write paths. Giving it a separate API for file management creates a second interface for the same material. I wanted an operation's result, including the undo_id returned by RAGFS, to be available through the filesystem too.

RAGFS is my Linux FUSE implementation. It mounts an indexed directory and exposes a virtual .ragfs control directory. The underlying files remain in the source directory. The ragfs card lists the repository and the documentation.

One operation, from request to undo

Suppose an agent decides that docs/old.md should be removed. The README quick start keeps the mount in the foreground:

mkdir ~/ragfs-mount
ragfs mount ~/Documents ~/ragfs-mount --foreground

The delete-operation examples then run against that mount. They write a relative path to the delete control file and read the JSON result:

echo "docs/old.md" > ~/ragfs-mount/.ragfs/.ops/.delete
cat ~/ragfs-mount/.ragfs/.ops/.result

The delete implementation moves the file to trash. The result contains an undo_id. I can retain that identifier and write it to the safety control file to undo the operation:

echo "<undo_id>" > ~/ragfs-mount/.ragfs/.safety/.undo

The important part is the sequence: request, inspect the result, retain the undo identifier, and undo the operation if needed. This is an interface contract, not evidence that an agent will always make the right deletion decision. I still need to review what an agent intends to remove.

Why search belongs on the same mount

The same mount can search the directory. RAGFS extracts text, splits it into chunks, runs thenlper/gte-small locally through Candle, and stores vectors in LanceDB. The model is downloaded on first use. The implementation uses that local model for later embedding queries. The LanceDB index is stored outside the source tree. The search control path sits on the mount, next to the files.

This is a practical index, with limits. Code chunking detects function and class signatures through pattern matching. The implementation describes that split as regex on signatures, not a tree-sitter AST. Cosine search remains an exact scan until an IVF-PQ index is built. The IVF-PQ threshold is 256 chunks. L2 and dot-product search remain exact. I have not published a retrieval-quality or scale benchmark for this setup, so I do not treat these implementation choices as proof of better answers.

What I would not delegate yet

The README feature-status section marks the CLI, the FUSE mount, agent operations under .ops/, and the safety layer under .safety/ as stable. Organize, dedupe, and cleanup are beta: they propose a plan that needs approval before execution. Python bindings and the MCP server are beta too. A file interface does not remove the need for that approval boundary.

FUSE currently runs on Linux. The repository README records the status of each surface, installation requirements, and supported extractors. I would check it before adopting RAGFS for a new corpus. This article describes the interface decision, not a production-readiness guarantee.

Where retrieval fits

The diagnostic order I use when a RAG pipeline performs poorly lives in RAG in Production: measure, then inspect chunking and ranking before changing the embedding model. RAGFS gives an agent a way to work with the corpus. It does not establish that the retrieval results are good without an evaluation.

FAQ

Why use a filesystem interface for agent file operations?

I use the filesystem because an agent can already list, read, and write paths there. A separate file-management API would create a second interface for the same material, whereas the filesystem can expose both an operation result and its undo.

How does RAGFS delete and undo a file operation?

I write a relative path to the delete control file and read the JSON result. The delete implementation moves the file to trash and returns an undo_id. I can retain that identifier and write it to the safety control file to undo the operation.

Does RAGFS search call an external embedding API?

I run thenlper/gte-small locally through Candle, and the model is downloaded on first use. The implementation uses that local model for later embedding queries; LanceDB stores vectors outside the source tree.

What are the current retrieval limits in RAGFS?

I use pattern matching for code function and class signatures rather than a tree-sitter AST. Cosine search is an exact scan until an IVF-PQ index is built, with the threshold set to 256 chunks. I have not published retrieval-quality or scale benchmarks.

Which RAGFS features should still require approval?

I treat organize, dedupe, and cleanup as beta because they propose a plan that needs approval before execution. The README feature-status section also lists Python bindings and the MCP server as beta. A file interface does not remove the need for an approval boundary.

Share this article

Related articles

  • I Keep Query JSON as a Retrieval Receipt

    I keep the public RAGFS query JSON as a retrieval receipt: query, file, score, content, and line range. I do not invent a quality benchmark.

    Oct 4, 20265 min read
    #RAG#FUSE#Linux#Retrieval
  • How I Diagnose RAG Retrieval: Chunking, Ranking, and Embeddings

    I diagnose RAG retrieval with a fixed query set, inspect document boundaries, and test ranking and embedding changes against quality, latency, and cost.

    Dec 20, 202412 min read
    #RAG#Retrieval#LLM#Production
  • AI Workflow Engines for Durable, Auditable Systems

    I use an illustrative LLM workflow to examine durable state, recovery, audit records, and cost controls.

    Aug 17, 202612 min read
    #AI workflows#Durable State#Retries#Audit Trails#Evals#Orchestration