StateBackend: Store files in LangGraph agent state (ephemeral).
Create a FileData object with timestamps.
Convert FileData to plain string content.
Format file data for read response with line numbers.
Return structured grep matches from an in-memory files mapping.
Performs literal text search (not regex).
Returns a list of GrepMatch on success, or a string for invalid inputs. We deliberately do not raise here to keep backends non-throwing in tool contexts and preserve user-facing error messages.
Perform string replacement with occurrence validation.
Update FileData with new content, preserving creation timestamp.
Protocol for pluggable memory backends (single, unified).
Backends can store files in different locations (state, filesystem, database, etc.) and provide a uniform interface for file operations.
All file data is represented as dicts with the following structure: { "content": list[str], # Lines of text content "created_at": str, # ISO format timestamp "modified_at": str, # ISO format timestamp }
Result from backend edit operations.
Result of a single file download operation.
The response is designed to allow partial success in batch operations. The errors are standardized using FileOperationError literals for certain recoverable conditions for use cases that involve LLMs performing file operations.
Structured file listing info.
Minimal contract used across backends. Only "path" is required. Other fields are best-effort and may be absent depending on backend.
Result of a single file upload operation.
The response is designed to allow partial success in batch operations. The errors are standardized using FileOperationError literals for certain recoverable conditions for use cases that involve LLMs performing file operations.
Structured grep match entry.
Result from backend write operations.
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.