Skip to main content

Working with Files

This guide covers how to provide files to your agents using Castari’s managed file storage.

Quick Start

Your agent can now read the file at /files/agent/data.csv.

Uploading Files

CLI Upload

Dashboard Upload

  1. Go to Files in the sidebar
  2. Click Upload File
  3. Drag & drop or select a file
  4. Add optional description and tags
  5. Click Upload

Large Files

Files larger than 10MB automatically use presigned uploads:
The CLI shows progress for large uploads:

Attaching Files to Agents

Basic Attachment

The file appears at /files/agent/<filename> in the sandbox.

Custom Mount Path

Writable Files

By default, files are read-only. For writable files:
Writable files can be modified by the agent. Use with caution.

Using Files in Agent Code

Reading Files

Parsing Common Formats

CSV:
JSON:

Checking File Existence

Managing Files

List Your Files

View File Details

Delete Files

Deleting a file automatically detaches it from all agents.

Download Files

Agent File Management

List Attached Files

Detach Files

Dashboard File Management

Files Page

The Files page shows:
  • All your uploaded files
  • Storage usage bar
  • Quick search and filtering

Agent Files Section

Each agent’s detail page has an Attached Files section:
  • View attached files and mount paths
  • Attach new files with the file picker
  • Detach files you no longer need

Storage Usage

Check Your Quota

Storage Limits

Best Practices

File Organization

  1. Use meaningful namescustomer-data-2024.csv not data.csv
  2. Add descriptions — Document what each file is for
  3. Tag consistently — Use tags like dataset, config, reference
  4. Clean up unused files — Delete files you no longer need

Performance

  1. Keep files reasonably sized — Under 100MB for best performance
  2. Use appropriate formats — CSV/JSON for structured data
  3. Consider streaming — For very large files, process in chunks

Security

  1. Don’t upload secrets — Use Secrets for credentials
  2. Review before attaching — Only attach files agents actually need
  3. Verify file integrity — Check SHA256 hash for critical files

Common Patterns

Configuration Files

Data Processing

Reference Documents

Troubleshooting

File Not Found

If your agent can’t find a file:
  1. Verify the file is attached:
  2. Check the mount path in the output
  3. Ensure you’re using the correct path in code

Upload Failures

For upload issues:
  1. Check your storage quota:
  2. Verify the file exists locally
  3. For large files, ensure stable network connection

Permission Errors

If you get permission errors:
  1. Files are read-only by default
  2. Use --writable when attaching if writes are needed
  3. Check file mode in cast agents files list

See Also