Backend that stores files in agent state (ephemeral).
Uses LangGraph's state management and checkpointing. Files persist within a conversation thread but not across threads. State is automatically checkpointed after each agent step.
Special handling: Since LangGraph state must be updated via Command objects (not direct mutation), operations return Command objects instead of None. This is indicated by the uses_state=True flag.
StateBackend(
self,
runtime: ToolRuntime,
)| Name | Type |
|---|---|
| runtime | ToolRuntime |
List files and directories in the specified directory (non-recursive).
Read file content with line numbers.
Create a new file with content.
Returns WriteResult with files_update to update LangGraph state.
Edit a file by replacing string occurrences.
Returns EditResult with files_update and occurrences.
Search state files for a literal text pattern.
Get FileInfo for files matching glob pattern.
Upload multiple files to state.
Download multiple files from state.
Async version of ls_info.
Async version of read using native store async methods.
Async version of grep_raw.
Async version of glob_info.
Async version of write using native store async methods.
Async version of edit using native store async methods.
Async version of upload_files.
Async version of download_files.