File Operations
Agents can read files from the virtual filesystem and produce files for users to download.
read_file
Section titled “read_file”Reads a file from the virtual filesystem. Files are addressed using virtual paths that specify whether they belong to a user or an agent.
read_file(path: "user://uid/report.pdf")read_file(path: "agent://dev/output.csv")Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Virtual file path (e.g., user://uid/report.pdf or agent://dev/output.csv) |
offset | integer | no | Line offset to start reading from (text files only, default: 0) |
limit | integer | no | Maximum number of lines to read (text files only, default: 500) |
For text files, offset and limit let the agent read large files in chunks without loading everything at once.
produce_file
Section titled “produce_file”Registers a file the agent has created so the user can download it. The file must already exist in the agent’s workspace.
produce_file(path: "output.csv")produce_file(path: "subdir/report.pdf")Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path relative to the workspace (e.g., output.csv or subdir/report.pdf) |
The produced file appears as a downloadable attachment in the chat message.
File uploads
Section titled “File uploads”Users can upload files through the chat interface. Uploaded files are stored in the file storage path (FRONA_STORAGE_FILES_PATH, default: data/files) and appear as message attachments.
Agents can see and reference uploaded files in the conversation.
Storage paths
Section titled “Storage paths”| Path | Config variable | Default | Purpose |
|---|---|---|---|
| Workspaces | FRONA_STORAGE_WORKSPACES_PATH | data/workspaces | Persistent agent file storage |
| Files | FRONA_STORAGE_FILES_PATH | data/files | File uploads and attachments |