File Storage allows you to upload files to a session and download files that agents retrieve during their work. When uploading a file, it becomes available to agents in that session. When agents download files from websites, you can retrieve those files later.
File Storage is session-scoped - all agents within a session share the same S3 bucket. Files persist beyond the session lifecycle so you can retrieve downloads later.
Upload files → Files are stored in the session’s S3 bucket
Run agents → Agents can use uploaded files and download new ones
Download results → Retrieve files that agents downloaded
Agents can only see filenames of uploaded files, not their content. Use descriptive names like resume_john_doe.pdf to make sure they get the right context!
from notte_sdk import NotteClientclient = NotteClient()storage = client.FileStorage()# Upload files before agent executionupload_response = storage.upload("/path/to/document.pdf")print(f"Upload success: {upload_response.success}")# Create session with storage attachedwith client.Session(storage=storage) as session: agent = client.Agent(session=session, max_steps=5) # Agent can now use uploaded files in web interactions response = agent.run( task=""" Upload the PDF document to the website and download the cat picture from site """, url="https://notte.cc/pg/file/io" ) print(f"Agent task completed: {response.success}")# List and download files that the agent downloaded from websitesdownloaded_files = storage.list_downloaded_files()for file_name in downloaded_files: success = storage.download( file_name=file_name, local_dir="./results" # Save to "results" folder ) print(f"Downloaded {file_name}: {success}")
from notte_sdk import NotteClientclient = NotteClient()storage = client.FileStorage()# Upload a filesuccess = storage.upload("/path/to/document.pdf")print(f"Upload successful: {success}")# List all uploaded filesuploaded_files = storage.list_uploaded_files()print(f"Available files for agents: {uploaded_files}")
Best Practices:
Use descriptive filenames (agents only see the filename)
After agents complete their work, download files they retrieved:
Copy
Ask AI
from notte_sdk import NotteClientclient = NotteClient()storage = client.FileStorage()# Assuming you have a session with storage that has completedwith client.Session(storage=storage) as session: # ... agent execution happens here ... pass# After agent execution, download created filesdownloaded_files = storage.list_downloaded_files()print(f"Files downloaded by agent: {downloaded_files}")# Download files to a directory on your computerdownload_dir = "./downloads" # This creates a "downloads" folder in your current directoryfor file_name in downloaded_files: try: success = storage.download( file_name=file_name, local_dir=download_dir, force=False # Don't overwrite existing files ) if success: print(f"Downloaded {file_name} to {download_dir}") except ValueError as e: print(f"Download failed for {file_name}: {e}")