Backend that stores files in LangGraph's BaseStore (persistent).
Uses LangGraph's Store for persistent, cross-conversation storage. Files are organized via namespaces and persist across all threads.
The namespace can include an optional assistant_id for multi-agent isolation.
StoreBackend(
self,
runtime: ToolRuntime,
*,
namespace: NamespaceFactory | None = None
)| Name | Type | Description |
|---|---|---|
runtime* | ToolRuntime | The ToolRuntime instance providing store access and configuration. |
namespace | NamespaceFactory | None | Default: NoneOptional callable that takes a BackendContext and returns a namespace tuple. This provides full flexibility for namespace resolution. We forbid * which is a wild card for now. If None, uses legacy assistant_id detection from metadata (deprecated). .. note:: This parameter will be required in version 0.5.0. .. warning:: This API is subject to change in a minor version. |
| Name | Type |
|---|---|
| runtime | ToolRuntime |
| namespace | NamespaceFactory | None |
List files and directories in the specified directory (non-recursive).
Read file content with line numbers.
Async version of read using native store async methods.
This avoids sync calls in async context by using store.aget directly.
Create a new file with content.
Returns WriteResult. External storage sets files_update=None.
Async version of write using native store async methods.
This avoids sync calls in async context by using store.aget/aput directly.
Edit a file by replacing string occurrences.
Returns EditResult. External storage sets files_update=None.
Async version of edit using native store async methods.
This avoids sync calls in async context by using store.aget/aput directly.
Search store files for a literal text pattern.
Find files matching a glob pattern in the store.
Upload multiple files to the store.
Download multiple files from the store.