File Read (FILE_READ)
Reads a file from a folder on the agent server, from AWS S3 or from Azure Blob Storage, and passes its content on. Use it as a step, or connect it to an Agent’s Tools port.
Category: Files · Deployed: yes · Tool-capable: yes
Ports
| Port | Kind | Purpose |
|---|---|---|
Trigger ( |
Input |
Starts the read. What arrives here is not used. It is not the file name |
Content ( |
Output |
The content of the file (see Result) |
Tool ( |
Tool |
Connect it to an Agent’s Tools port to let the agent read the file itself |
Properties
| Field | Required | Meaning |
|---|---|---|
Default Filename ( |
As a step: yes. As a tool: no |
The file to read, with its extension. As a step, the name can only come from here. The previous module cannot send one. As a tool, the file name the agent gives wins. Leave it empty when the agent should always name the file itself |
File Type ( |
No |
For example |
Description (tool use) ( |
No |
Only used when an agent uses the module as a tool. Say what the file means, for example "the current price list". It is not used as a step |
Storage Type |
Yes |
|
If Storage Type is empty, or a required field of the chosen storage is empty, the pipeline cannot be assigned to an agent, and the designer lists the missing field. If a saved pipeline is deployed anyway, the module is left out. A missing Default Filename is not checked when you save. It is an error only when the module runs.
Local Filesystem
| Field | Required | Meaning |
|---|---|---|
Base Path ( |
No |
A folder inside the agent’s own file area, for example |
AWS S3
| Field | Required | Meaning |
|---|---|---|
Access Key ID ( |
Yes |
The access key ID of an AWS user that may read this bucket |
Secret Access Key ( |
Yes |
The secret key of that access key. The field is hidden like a password |
Bucket Name ( |
Yes |
The S3 bucket |
Region ( |
No |
For example |
S3 Prefix ( |
No |
A folder in the bucket, for example |
Azure Blob Storage
| Field | Required | Meaning |
|---|---|---|
Connection String ( |
Yes |
The connection string of the storage account, from the Azure portal. The field is hidden like a password |
Container Name ( |
Yes |
The container to read from |
Account Name ( |
No |
Usually leave it empty. The connection string already holds the account |
Blob Prefix ( |
No |
A folder in the container, for example |
Result
-
Text files are passed on as plain text. A file counts as text when its type is
text/…, orapplication/json,application/xml,application/javascriptorapplication/x-yaml. -
All other files are passed on as a JSON object:
{"encoding": "base64", "data": "…", "filename": "…", "fileType": "…"}. File Write understands this object and writes the original file again. -
File Type empty: the type is guessed from the extension. Known are
txt,csv,json,xml,html,htm,md,yaml,yml,log,js,css,png,jpg,jpeg,gif,pdf,zipandgz. A file with any other extension, or none, is passed on as binary data. Set File Type if you want such a file read as text. -
A missing file, wrong credentials or an unreachable storage make the step fail with a message that names the file and the storage.
As a tool
Connected to an Agent’s Tools port, the module becomes a function the agent can call. Its name is
file_read_ plus the Default Filename (letters and digits only, at most 40 characters). It has one
optional argument:
| Argument | Required | Meaning |
|---|---|---|
|
Only if Default Filename is empty |
The file to read. A plain name, no folder separators. Empty → the Default Filename |
So the agent can call it with no arguments to read a fixed document. With an empty Default Filename the agent must name the file and can pick any file of the chosen folder, bucket prefix or container.
You do not write the tool text. It is made from the settings: where the file is, which file, and how text and binary files come back. The Description (tool use) is added at the end. Use it to say what the file means, for example "the current price list". Without it, the agent knows how to call the tool but not why.
The agent gets the result as values: success, path, fileType and the content. For a binary file, the
content is encoded and encoding is base64.
Use cases
-
Ingestion chain: File Read → Text Splitter → Iterator → Embedding.
-
A prompt text from S3: Storage Type
AWS S3, Default Filenamesystem-prompt.txt, started by a Scheduler. The text can be changed without touching the pipeline. -
Reference data: Default Filename
product-catalog.csv, Content wired to an Agent that answers product questions. -
As a tool: the agent reads a document when the conversation needs it.
Notes
-
Local Filesystem means the agent server’s own file area, not your computer. It works with Docker only (see below).
-
On Kubernetes, a pipeline with a File Read that uses Local Filesystem is refused by the agent server. Use AWS S3 or Azure Blob Storage there.
-
Files in the local file area do not survive a stop of the agent. Stopping an agent in this app removes its container, and the file area is not stored on a volume. Use S3 or Azure for files you need to keep.
-
The module reads the whole file into memory. Very large files make the agent slow. Split big data into smaller files.
-
The secret fields are not part of an export. Access Key ID is, but the Secret Access Key and the Azure Connection String are left out. Enter them again after an import.