AgentFS in the Browser
AgentFS gives browser-based agents a virtual filesystem stored in a SQLite database, using Turso's WASM build of its Rust rewrite of SQLite. It runs in-memory for ephemeral workspaces or persists to the browser's Origin Private File System (OPFS), and the same API works with Turso Cloud sync, which pushes changes and bootstraps data on demand based on the queries you run. Alongside file operations it offers key-value state and tool-call tracking, and filesystem state can be queried directly with SQL. A short adapter lets isomorphic-git run on AgentFS, so a repository can be cloned and inspected entirely in the browser.
Related posts
- AgentFS with FUSE: SQLite-backed agent state as a POSIX filesystem
Turso mediumAdeptAgentFS adds an `agentfs mount` command that exposes its SQLite-backed agent filesystem as a real POSIX filesystem via Linux FUSE. Agents and shell tools like git, grep and diff can then work on agent state with no SDK integration. The implementation uses the Rust fuser crate and enables kernel writeback caching, so writes and cached reads hit the page cache and run near native speed. Non-cached reads and fsync() pay the kernel-crossing overhead. Each write is coordinated with a database transaction, and the whole filesystem stays in one portable, queryable SQLite file that can be inspected with sqlite3 or snapshotted by copying it.
- The Missing Abstraction for AI Agents: The Agent Filesystem
Turso mediumAdeptAgentFS is an SDK that stores all of an AI agent's state in a single SQLite (Turso) database file: a POSIX-like virtual filesystem, a key-value store, and an append-only tool call audit log. The filesystem side uses separate inode and dentry tables, mirroring kernel design. Key-value entries are JSON-serialized values in a single table, and tool call rows are never mutated, which keeps the history auditable. Keeping everything in one file makes agent runs snapshottable by copying it, debuggable with SQL, and portable across sandboxes. TypeScript and Rust SDKs are available, along with a Mastra-based research assistant example and later FUSE support for mounting the filesystem on Linux.
- Building AI agents with just bash and a filesystem in TypeScript
Turso mediumAdeptjust-bash, a from-scratch TypeScript reimplementation of bash and common commands like grep, sed, awk and jq, gives AI agents a familiar shell tool without a real shell or host filesystem access. Its pluggable filesystem interface connects to AgentFS, which stores every file in an SQLite database via Turso (or Cloudflare's managed SQLite in Durable Objects), so all changes are captured and the agent cannot escape the sandbox. Code examples show wiring it into the Vercel AI SDK. It sits between direct AgentFS SDK calls and mounting AgentFS on the host: deployable anywhere JavaScript runs, but limited to the commands just-bash implements.
- AgentFS with copy-on-write overlay filesystem
Turso mediumAdeptAgentFS 0.4 adds `agentfs run`, which launches a coding agent in a sandbox where the working directory is a copy-on-write overlay. The host filesystem is the read-only base layer and a SQLite database is the writable delta layer, so agent edits and deletions (tracked through a whiteout table) never touch the host checkout, and other shells can join the same session by ID. On Linux the overlay is a FUSE filesystem combined with user and mount namespaces that remount everything read-only except allowed paths. On macOS it is served by a localhost NFS server, avoiding the need for macFUSE, and confined with a generated sandbox-exec profile.
- How We Built the Turso Shell in the Browser
Turso mediumAdeptTurso's SQLite-compatible database can run entirely in the browser via WebAssembly, persisting data to OPFS with no backend. The walkthrough builds a SQL shell with Vite, React and TypeScript. It covers importing from the @tursodatabase/database-wasm/vite export to work around a Vite dev-server WASM issue, and setting COOP/COEP headers so SharedArrayBuffer is available. It then builds a query executor that maps prepared-statement results into a table, and upgrades the textarea to a CodeMirror editor with SQL highlighting, autocomplete and a Mod-Enter keybinding.