File Management
Agents manage files in the task workspace during execution — reading, writing, listing, and editing as needed.
Task Workspace
Each task has an isolated workspace:
- Automatic creation — created when the task starts.
- Isolated storage — only the current task can access it.
- Temporary — exists during execution.
- Auto-cleanup — removed after the task completes.
Download before completion
Files are automatically cleaned up after a task ends. Download any generated files you want to keep before the task completes.
File Lifecycle
1. Upload -> file stored in task workspace
2. Access -> agent reads file when needed
3. Process -> agent analyzes and processes content
4. Output -> agent creates new files
5. Download -> you download files before task ends
6. Cleanup -> workspace deleted after taskAgent File Operations
Agents read content with the read_file tool, which handles plain text directly and parses documents such as PDF and DOCX:
read_file(file_path="data.txt")
read_file(file_path="report.pdf")
read_file(file_path="document.docx")Workspace files for a task are also retrievable through the API:
GET /api/chat/workspace/{task_id}/files
GET /api/chat/workspace/{task_id}/output