Backend that stores files in a LangSmith Hub agent repository.
Mutations are accepted in call order, coalesced for a short window, and pushed by one worker. Only one batch is in flight at a time; mutations that arrive during a push form the next batch. This serializes one backend instance's writes while still reducing the number of Hub commits.
Reads use an optimistic view: the last durable cache overlaid with the in-flight batch and then the pending batch. A read can therefore observe an accepted mutation before it is durable; a failed push invalidates that view and the next operation reloads from Hub.
A 409 parent conflict triggers an authoritative pull and rematerializes
the in-flight batch over the fetched tree before retrying. Edits replay their
original replacement intent; absolute writes, deletes, and uploads replay as
absolute changes. Retries are bounded by MAX_CONFLICT_RETRIES.
class ContextHubBackendDelete a file or directory recursively. Optional - backends that don't support file deletion can omit this.
Download multiple files. Optional - backends that don't support file download can omit this.
Edit a file by replacing string occurrences.
Return linked-entry paths mapped to their repo handles.
Structured glob matching returning FileInfo objects.
Search file contents for a literal text pattern.
Binary files (determined by MIME type) are skipped.
Return true if the hub repo already exists with at least one commit.
Structured listing with file metadata.
Lists files and directories in the specified directory (non-recursive). Directories have a trailing / in their path and is_dir=true.
Read file content.
For text files, content is paginated by line offset/limit. For binary files, the full raw Uint8Array content is returned.
Read file content as raw FileData.
Upload multiple files. Optional - backends that don't support file upload can omit this.
Write content to a file, creating it or overwriting it if it already exists.