Skip to main content
The Chroma VFS exposes an existing ChromaDB collection as text files mounted at a prefix such as /knowledge/. It is useful when you already have a chunked knowledge base in Chroma and want agents to use normal filesystem commands like ls, cat, grep and find, and to rank chunks by meaning with the search CLI. For collection setup, see Chroma Setup. Install the extra:

Config

The VFS is read-only. A snapshot keeps its config, and a load needs the mount handed back through mounts=; it has no drift detection, so a restored mount reads current content.

VFS.md

The VFS.md an agent reads with Chroma mounted at /<path>.

Virtual Filesystem

/<path> layout

Supported Unix Commands for VFS

Unix commands work on each path as on a local filesystem, as far as the path supports them:

Limitations of Unix Commands for VFS

Where a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.
Chroma paths come from the path tree document stored in the collection with ID __path_tree__. The document body must be a JSON object whose keys are virtual file paths below the mount prefix.
Mounted at /knowledge/, this becomes:
Mirage infers folders from path segments and stores the tree in the index cache. The size, created_at, and updated_at metadata values are used by tree and listing operations when present.

Reading Documents

Each file is assembled from Chroma chunk documents whose metadata slug matches the path. Chunks are sorted by the configured chunk index field and joined with a single newline.

Exact Search with Grep

grep -r and rg read only the pages with a chunk holding the text, which Chroma’s $contains answers, then match each page as grep does. A page is its chunks joined by line breaks, so no match can span two chunks and the answer is exact. $contains matches case, so -i reads every page.
The search CLI asks Chroma’s vector query API. Use it when semantic similarity matters more than exact text matching. Register it on the workspace:
The score is 1 minus Chroma’s distance, and --threshold keeps the hits that reach it. --top-k defaults to 10. --method takes only semantic. Each hit prints its page and score, then the chunk:

Cache

The VFS uses Mirage’s index cache for the virtual tree. The first directory listing or path resolution fetches __path_tree__; later ls, find, tree, and path resolution reuse the cached tree until the index cache expires or the workspace is recreated. File content is still read from Chroma when commands materialize document text.

Integration

What Chroma answers through its own API, so fewer files are read. Integration explains each command.

Examples

Runnable examples live under examples/python/vfs/chroma/:
  • chroma.py — command workflow with ls, tree, find, cat, head, tail, grep, and search.
  • chroma_vfs.py — in-process VFS workflow with os.listdir(), open(), and os.path.*.

Shell Commands