Backends control how deep agents store files and manage state. Choose a backend based on your persistence and isolation requirements.
Learn more: For detailed guidance on choosing and configuring backends, see the Backends documentation.
Backend that stores files in agent state (ephemeral).
Backend that stores files in LangGraph's BaseStore (persistent).
Backend that reads and writes files directly from the filesystem.
Routes file operations to different backends by path prefix.
Base sandbox implementation with execute() as the core abstract method.
Extension of BackendProtocol that adds shell command execution.
Protocol for pluggable memory backends (single, unified).
Sanitize tool_call_id to prevent path traversal and separator issues.
Format file content with line numbers (cat -n style).
Check if content is empty and return warning message.
Convert FileData to plain string content.
Create a FileData object with timestamps.
Update FileData with new content, preserving creation timestamp.
Slice file data to the requested line range without formatting.
Format file data for read response with line numbers.
Perform string replacement with occurrence validation.
Truncate list or string result if it exceeds token limit (rough estimate: 4 chars/token).
Validate and normalize file path for security.
Return structured grep matches from an in-memory files mapping.
Group structured matches into the legacy dict form used by formatters.
Format structured grep matches using existing formatting logic.