Alpha release. Install with pip install adx. APIs may change before v1.0. Roadmap →
Skip to content

Batch Operations

ADX supports uploading and processing entire directories of documents in a single call.

Directory Upload

Python SDK

python
from adx import ADX

dn = ADX()
result = dn.upload_directory("./documents/", recursive=True)

print(f"Processed {result.successful}/{result.total_files} files")
if result.errors:
    for path, error in result.errors.items():
        print(f"  Failed: {path}{error}")

# Access processed file IDs
for file_id in result.graphs:
    profile = dn.profile(file_id)
    print(profile["file_name"], profile["document_type"])

Filter by Extension

python
result = dn.upload_directory(
    "./documents/",
    recursive=True,
    extensions={".pdf", ".xlsx"},
)

BatchResult

FieldTypeDescription
total_filesintTotal files found
successfulintSuccessfully processed
failedintFailed to process
graphslist[str]File IDs of successful uploads
errorsdict[str, str]File path to error message mapping

Async Batch Upload

For concurrent processing of multiple files:

python
import asyncio
from adx import AsyncADX

async def main():
    dn = AsyncADX(max_workers=4)

    # Upload multiple files concurrently
    graphs = await dn.upload_many([
        "invoice_1.pdf",
        "invoice_2.pdf",
        "model.xlsx",
        "contract.docx",
    ])

    for graph in graphs:
        print(graph.document.id, graph.document.filename)

asyncio.run(main())

You can also upload a directory asynchronously:

python
async def main():
    dn = AsyncADX()
    result = await dn.upload_directory("./documents/", recursive=True)
    print(f"Done: {result.successful} files")

REST API

bash
curl -X POST http://localhost:8000/v1/directories \
  -H "Content-Type: application/json" \
  -d '{"path": "./documents/", "recursive": true, "extensions": [".pdf", ".xlsx"]}'

Documents are not text blobs. Give your agents document tools.