# File Handling

The Operator Agent can work with files throughout a conversation — reading uploads you provide, processing data, and generating new files as output.

### Uploading Files

Upload files by dragging and dropping into the chat, or using the attach button in the composer. You can upload files alongside a message to give the agent immediate context.

#### Supported File Types

| Type             | Formats                               |
| ---------------- | ------------------------------------- |
| **Documents**    | PDF, Word (.docx), PowerPoint (.pptx) |
| **Spreadsheets** | CSV, Excel (.xlsx)                    |
| **Images**       | PNG, JPG, and other common formats    |
| **Email**        | EML                                   |
| **Data**         | JSON, XML                             |
| **Text**         | Plain text (.txt), Markdown (.md)     |

### How the Agent Processes Files

Uploaded files are processed in a **secure cloud sandbox** — an isolated environment where the agent can safely read, transform, and generate files without affecting your local system or other users.

The agent handles different file types intelligently:

* **PDFs** — The agent can read PDFs visually, preserving layout and formatting context. For large PDFs, it works with specific page ranges rather than processing the entire document. OCR is available for scanned documents.
* **Images** — Processed as native visual content, so the agent can describe, analyse, or extract information from images directly.
* **Spreadsheets and CSVs** — Parsed into structured data that the agent can query, filter, transform, and export.
* **Office documents** — Word and PowerPoint files are converted to structured text, with the ability to extract embedded images.

### Generated Files and Artefacts

When the agent creates files as part of its work — reports, transformed spreadsheets, exported data — these appear as **artefacts** in the chat.

Artefacts are displayed in a sidebar panel where you can:

* **Preview** the generated content
* **Download** the file

Common output formats include CSV, Excel, PDF, and plain text, depending on what you asked for.

> 💡 File names are preserved where possible. If the agent generates multiple files, each appears as a separate artefact.

### Sandbox Environment

The cloud sandbox comes pre-loaded with common tools and libraries for file processing:

* Python with data processing libraries
* PDF tools (extraction, rendering, OCR)
* Image processing capabilities
* Document conversion utilities

This means the agent can handle complex file operations — merging spreadsheets, extracting tables from PDFs, converting between formats — without requiring you to install anything.

### Tips for Working with Files

* **Upload files with your first message** so the agent has context from the start.
* **Be specific about what you want** — *"Extract the table on page 3"* works better than *"Look at this PDF."*
* **For large files**, tell the agent which parts matter — specific pages, columns, or sections.
* **Check artefacts in the sidebar** for generated outputs — they may contain more detail than the chat summary.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lleverage.ai/operator-agent/file-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
