LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexFilesystemBackend
Class●Since v1.4

FilesystemBackend

Backend that reads and writes files directly from the filesystem.

Files are accessed using their actual filesystem paths. Relative paths are resolved relative to the current working directory. Content is read/written as plain text, and metadata (timestamps) are derived from filesystem stats.

Copy
class FilesystemBackend

Used in Docs

  • Backends

Constructors

constructor
constructor→ FilesystemBackend

Properties

property
cwd: string
property
virtualMode: boolean

Methods

method
delete→ Promise<DeleteResult>

Delete a file or directory from the filesystem.

Files are unlinked. Directories are removed recursively along with all of their contents. Symlinks are removed as links and never followed into their targets.

method
downloadFiles→ Promise<FileDownloadResponse[]>

Download multiple files from the filesystem.

method
edit→ Promise<EditResult>

Edit a file by replacing string occurrences. Returns EditResult. External storage sets filesUpdate=null.

method
glob→ Promise<GlobResult>

Structured glob matching returning FileInfo objects.

method
grep→ Promise<GrepResult>

Search for a literal text pattern in files.

Uses ripgrep if available, falling back to substring search.

method
ls→ Promise<LsResult>

List files and directories in the specified directory (non-recursive).

method
read→ Promise<ReadResult>

Read file content with line numbers.

method
readRaw→ Promise<ReadRawResult>

Read file content as raw FileData.

method
uploadFiles→ Promise<FileUploadResponse[]>

Upload multiple files to the filesystem.

method
write→ Promise<WriteResult>

Write content to a file, creating it or overwriting it if it already exists. Returns WriteResult. External storage sets filesUpdate=null.

View source on GitHub