Skip to main content
The Mem0 VFS exposes the memories of a single scope — a user_id, agent_id, or run_id — as JSON files mounted at a prefix such as /memory/. Each memory is one file named <memory_id>.json. For API key setup, see Mem0 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 restored cache entries are served as saved and other reads reach the live backend. Set exactly one of user_id, agent_id, or run_id (see Setup). Fields marked secret are redacted in snapshots.

VFS.md

The VFS.md an agent reads with Mem0 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.
The tree is flat: the mount root lists one <memory_id>.json file per memory in the configured scope.
cat returns the full memory JSON, including memory, categories, metadata, created_at, updated_at, and structured_attributes:
stat reports updated_at (falling back to created_at) as the modified time and exposes both timestamps.

Reading Memories

grep and rg search the JSON files

grep and rg follow normal filesystem semantics and search the same JSON bytes that cat returns. A match can therefore come from the memory text or from metadata such as categories and timestamps. Because the mount is a directory, plain grep needs -r (or a glob); rg recurses by default:
The search CLI asks Mem0’s semantic search API within the configured scope. Use it when meaning matters more than exact text. Register it on the workspace:
--top-k defaults to default_search_limit (10). --threshold must be between 0 and 1. Results are emitted one hit per block, ranked by score:

Cache

The VFS uses Mirage’s index cache for the virtual tree. The first ls fetches the scope’s memories (following Mem0 pagination) and primes the cache; read commands reuse the cached metadata and rendered bytes until the cache expires or the workspace is recreated. search always calls the Mem0 API directly and is not cached.

Example

Shell Commands