/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
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>.
- Rendered
- Raw
__path_tree__. The document body must be a JSON object whose keys are virtual
file paths below the mount prefix.
/knowledge/, this becomes:
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.
Vector Search
Thesearch CLI asks Chroma’s vector query API. Use it
when semantic similarity matters more than exact text matching. Register it on
the workspace:
--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 underexamples/python/vfs/chroma/:
chroma.py— command workflow withls,tree,find,cat,head,tail,grep, andsearch.chroma_vfs.py— in-process VFS workflow withos.listdir(),open(), andos.path.*.