This project has been archived by its maintainers, and is no longer receiving any updates.
deepagents-azure-blob-backend
Azure Blob Storage filesystem backend for LangChain Deep Agents.
Deep Agents exposes a BackendProtocol — a pluggable interface for file operations (read, write, edit, ls, glob, grep) that the agent uses as its virtual filesystem. This package provides an Azure Blob Storage implementation of that interface.
Migrating to langchain-azure-storage
pip uninstall deepagents-azure-blob-backend
pip install "langchain-azure-storage[deepagents]"
The successor drops the AzureBlobConfig dataclass and takes its arguments directly on the constructor. Credentials are Azure SDK credential objects rather than raw key or token strings:
# Before
from deepagents_azure_blob_backend import AzureBlobBackend, AzureBlobConfig
backend = AzureBlobBackend(
AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="agent-workspace",
prefix="session-001/",
)
)
# After
from langchain_azure_storage.deepagents import AzureBlobBackend
backend = AzureBlobBackend(
"https://<account>.blob.core.windows.net",
"agent-workspace",
prefix="session-001/",
)
AzureBlobConfig field |
Replacement |
|---|---|
account_url, container_name |
Positional arguments to AzureBlobBackend(...) |
prefix |
Keyword argument prefix= |
credential=<azure credential> |
Keyword argument credential= (TokenCredential, AsyncTokenCredential, or AzureSasCredential) |
connection_string="..." |
AzureBlobBackend.from_connection_string(connection_string, container_name, prefix=...) |
sas_token="sv=..." |
credential=AzureSasCredential("sv=...") (from azure.core.credentials) |
account_key="..." |
No direct equivalent — use from_connection_string (a connection string carries AccountKey) or a SAS credential |
| (omit all credentials) | Unchanged — DefaultAzureCredential is still the default |
max_concurrency, encoding, api_version |
Not exposed; the successor manages concurrency and encoding internally |
The successor's AzureBlobBackend is currently marked beta upstream and emits a LangChainBetaWarning on construction.
The successor also requires deepagents>=0.7.1, where write overwrites an existing file instead of erroring and delete/adelete are part of BackendProtocol. Python 3.11+ is required for the deepagents extra.
Further reading: backend integrations · design proposal and behavior notes · upstream PR
Installation
pip install deepagents-azure-blob-backend
Or with uv:
uv add deepagents-azure-blob-backend
This package requires deepagents>=0.6.1,<0.7.0, where BackendProtocol exposes structured ls, glob, and grep result types. It does not support the BackendProtocol changes in deepagents 0.7.0 — see Migrating to langchain-azure-storage.
Quick Start
import asyncio
from deepagents import create_deep_agent
from deepagents_azure_blob_backend import AzureBlobBackend, AzureBlobConfig
async def main():
config = AzureBlobConfig(
account_url="https://<your-account>.blob.core.windows.net",
container_name="agent-workspace",
prefix="session-001/",
)
backend = AzureBlobBackend(config)
agent = create_deep_agent(backend=backend)
result = await agent.ainvoke(
{"messages": [{"role": "user", "content": "Create a hello world script at /hello.py"}]},
)
print(result["messages"][-1].content)
await backend.close()
asyncio.run(main())
Configuration
from deepagents_azure_blob_backend import AzureBlobConfig
config = AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="my-container",
prefix="agent-workspace/", # Namespace isolation for multi-agent setups
max_concurrency=8, # Parallel blob ops for grep/glob
encoding="utf-8",
)
Authentication
AzureBlobConfig supports five mutually exclusive authentication methods. Set at most one credential source — if none is provided, DefaultAzureCredential is used automatically. account_url is required for all methods except connection string:
# 1. Connection string (e.g., Azurite or Azure Portal)
config = AzureBlobConfig(
container_name="test",
connection_string="UseDevelopmentStorage=true",
)
# 2. Account key
config = AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="my-container",
account_key="your-storage-account-key",
)
# 3. SAS token
config = AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="my-container",
sas_token="sv=2021-06-08&ss=b&srt=co&sp=rwdlacitfx&se=...",
)
# 4. Credential object (any Azure credential)
from azure.identity.aio import ClientSecretCredential
config = AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="my-container",
credential=ClientSecretCredential(tenant_id, client_id, client_secret),
)
# 5. Default (AAD) — omit all credential fields
config = AzureBlobConfig(
account_url="https://<account>.blob.core.windows.net",
container_name="my-container",
)
The default path uses DefaultAzureCredential, which supports az login, managed identity, workload identity federation (OIDC), and environment variables.
Supported Operations
All methods from BackendProtocol:
| Method | Async | Description |
|---|---|---|
ls(path) |
als |
List directory with synthesized subdirectories |
read(path, offset, limit) |
aread |
Read file with line numbers |
write(path, content) |
awrite |
Create new file (errors if exists) |
edit(path, old, new) |
aedit |
String replacement editing |
glob(pattern, path) |
aglob |
Glob pattern file matching |
grep(pattern, path, glob) |
agrep |
Literal text search across files |
upload_files(files) |
aupload_files |
Batch binary upload |
download_files(paths) |
adownload_files |
Batch binary download |
Development
# Install dev dependencies
uv sync --group dev
# Run unit tests
uv run pytest tests/unit_tests -v
# Run integration tests (requires Azurite)
docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --skipApiVersionCheck --blobHost 0.0.0.0
uv run pytest tests/integration_tests -v
# Lint and format
uv run ruff check .
uv run ruff format .
# Type check
uv run ty check
See the examples/ folder for runnable scripts with setup instructions.
License
MIT
Metadata
Release files for deepagents-azure-blob-backend 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deepagents_azure_blob_backend-0.5.0.tar.gz | 13.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepagents_azure_blob_backend-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.4 kB
Release files / deepagents_azure_blob_backend-0.5.0.tar.gz
| Download URL | deepagents_azure_blob_backend-0.5.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce22265610c8c09b943655e918a2f07704832fb71c6043d5bee34842a7e696eb
|
|
BLAKE2b-256 checksum How to use checksums |
6eb5b2590dad466d61be309955d137b5d7927e96b0abcee941f6112570af6bdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / deepagents_azure_blob_backend-0.5.0-py3-none-any.whl
| Download URL | deepagents_azure_blob_backend-0.5.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfbc57dfb2a3bd5d7abec2f874ef0e5514aa863c84b9b6abee361aa6af4d8c30
|
|
BLAKE2b-256 checksum How to use checksums |
4515819eda868313429606cff314fc48671655fd45137f38277dea8caed42e56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|