Content-Length: 210913 | pFad | http://reference.langchain.com/python/deepagents/backends/state/StateBackend
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.
Fetched URL: http://reference.langchain.com/python/deepagents/backends/state/StateBackend
Alternative Proxies: