Skip to main content
Redis keeps workspace files as keys in a Redis database, under one key prefix. The files last as long as the database keeps its data.

Setup

Start a local server (redis-server listens on redis://localhost:6379/0, the default) or use a managed one. For Redis Cloud, the endpoint is in the database’s Configuration tab and the password of the default user under Security (Pro) or Default user > Configure (Essentials). Use rediss:// when the server needs TLS.
Python needs pip install "mirage-ai[redis]"; Node needs the redis@^5 peer dependency (pnpm add @struktoai/mirage-node redis).

Connect

workspace.yaml

Layout

  • The tree is whatever commands write. Each file is a <prefix>file:<path> key; a different key_prefix keeps a workspace apart from other data.
  • Runs in Python, Node and Cloudflare Workers over the Redis protocol.
  • A browser has no socket, so it mounts Redis through the Upstash REST API; see browser Redis setup.

Sample runs

Every command that writes works on a write mount. Add capacity: 100MB under config to cap the bytes the files hold; see capacity.

SDK guides

Python

Every config field, the VFS.md and write support.

TypeScript

Every config field, the VFS.md and write support.