Calafai Docs

File Uploads

File Uploads

Purpose

File uploads allow you to attach reference documents to an engagement so the AI crew can use them as context during execution. Upload market research, design mockups, brand guidelines, data spreadsheets, or any relevant material -- the engine automatically processes these into a context index that agents reference while producing deliverables.

Where to Upload

Files can be uploaded in two places:

  • Engagement creation wizard (Step 1, resources phase) -- Upload style guides and reference materials before launching the engagement. The wizard provides separate upload sections for style guides and reference materials.
  • Engagement detail page -- The Attachments section on an existing engagement's detail page. Available when the engagement is not actively running.

Upload Methods

Drag and Drop

Drag files from your computer directly onto the upload zone. The zone highlights when files are dragged over it. Multiple files can be dropped at once; they are uploaded sequentially. A progress indicator shows which file is being uploaded and the count (e.g., "Uploading report.pdf (2/5)..."). If an upload fails, an error message appears below the zone with the reason.

You can also click the upload zone to open your system's file picker.

URL Fetching

Below the file upload zone, a URL input field lets you add web content as an attachment. Enter a URL and click Add URL. The platform fetches the page, converts the HTML content to markdown, and stores it as an attachment. The filename is auto-generated from the hostname and URL path (e.g., example.com_page-name.md). A source metadata header (URL and fetch timestamp) is prepended to the content.

If the generated filename already exists in the engagement, a numeric suffix is appended to avoid duplicates.

Allowed File Types

The following file extensions are accepted:

CategoryExtensions
Documents.pdf, .txt, .md, .rtf, .html, .htm
Office (Modern).docx, .xlsx, .pptx
Office (Legacy).doc, .xls, .ppt
Open Document.odt, .ods, .odp
Images.png, .jpg, .jpeg, .svg
Data.csv, .json, .yaml, .yml
Archives.zip

Files with extensions not in this list are rejected at upload time.

File Categories

Each uploaded file is assigned a category that helps the engine understand how to use the document:

  • reference -- General reference material such as reports, articles, or background reading. This is the default category.
  • styleguide -- Brand style guides, PowerPoint templates, or example documents that show how outputs should look and feel. Used by the design adherence system to match your visual and tonal standards.
  • design_inspiration -- Visual inspiration, mockups, screenshots, or design examples.
  • data -- Spreadsheets, datasets, CSV files, or structured data.
  • brand_assets -- Logos, brand guidelines, style guides, or brand-related materials.

When creating an engagement via the wizard, the resources step provides two separate upload sections: Style Guide (uses the styleguide category) and Reference Materials (uses the reference category). The design adherence slider sits between them, controlling how closely the AI crew follows any uploaded style guides. When uploading via the API, specify the category form field directly.

Automatic Summarization

For parseable file types (PDF, DOCX, XLSX, PPTX, images, text, CSV, JSON, YAML), the platform automatically generates an LLM-powered summary after upload. This summary is stored in the database and serves two purposes:

  • It appears in the attachment list as a brief description of the file's content.
  • It is included in the manifest used by the AI crew, helping agents understand each file's relevance without reading the entire document.

Summarization runs asynchronously and does not block the upload process.

Optional Summary (API)

When uploading via the API, you can include an optional summary field -- a short text description of what the file contains. If provided, this manual summary is used instead of the auto-generated one.

Plan-Based Storage Limits

Storage limits vary by subscription plan:

PlanMax File SizeTotal Storage
Starter10 MB per file100 MB total
Professional50 MB per file500 MB total
Enterprise100 MB per file2 GB total
  • If a single file exceeds the per-file limit, the upload is rejected with a 413 error indicating the maximum allowed size for your plan.
  • If adding a file would push your total storage usage over the plan limit, the upload is rejected with a 413 error showing the total storage cap.
  • Storage usage is calculated across all engagements in your tenant, not per engagement.

Duplicate Filenames

Each engagement enforces unique filenames. If you try to upload a file with the same name as an existing attachment in that engagement, the upload is rejected with a 409 error. To replace a file, delete the existing one first, then upload the new version. (URL-fetched files automatically append a numeric suffix to avoid collisions.)

Attachment List

The attachment list on the engagement detail page shows each file with:

  • File type badge -- A short label indicating the file type (PDF, DOC, XLS, PPT, IMG, ZIP, JSON, YAML, RTF, HTML, ODF, TXT).
  • Filename -- Truncated if long.
  • Size -- Human-readable (B, KB, MB).
  • Category -- The assigned category label (Reference, Design, Data, Brand).
  • Source link -- For URL-fetched files, a link to the original source URL.
  • Summary preview -- For files with a summary, the first 80 characters.
  • Download and Delete buttons.

The header shows the total attachment count and combined storage size.

Storage Backend

Files are stored in Supabase Storage at the path:

{tenantId}/{engagementSlug}/{filename}

This path structure ensures tenant isolation at the storage level. Files are associated with a database record in the EngagementAttachment table that tracks the filename, MIME type, file size, category, summary, source URL (if fetched), and who uploaded it.

Context Injection

When you upload or delete a file, the platform automatically regenerates two artifacts:

  • Manifest -- A structured JSON list of all attachments for the engagement, including filenames, categories, MIME types, sizes, and summaries.
  • Context index -- A processed text index that the AI engine injects into agent context windows during runs.

This means the AI crew can reference your uploaded documents when producing deliverables. For example, if you upload a competitive analysis spreadsheet, the research agent can cite specific data points from it. If you upload brand guidelines, the communications agent incorporates them into messaging deliverables.

The context regeneration happens automatically -- no manual action is needed after uploading or deleting files.

Deleting Files

Files can be deleted individually from the engagement's attachments list. A confirmation dialog appears before deletion. When a file is deleted:

  1. The file is removed from Supabase Storage.
  2. The database record is deleted.
  3. The manifest and context index are regenerated to reflect the removal.

GDPR Compliance

Uploaded files are included in GDPR data handling:

  • Data export (GET /api/account/export) -- All attachments and their metadata are included in the exported ZIP file.
  • Account deletion (DELETE /api/account/delete) -- All files are permanently deleted from Supabase Storage and all database records are removed as part of the cascade deletion.
  • Engagements -- Creating and managing engagements where files are uploaded.
  • Deliverables -- The output documents produced by AI agents using your uploaded context.
  • Billing -- Storage limits by subscription plan.

On this page