Back to feed
Dev.to
Dev.to
6/17/2026
Stop Passing Files Between Agents With Local Paths

Stop Passing Files Between Agents With Local Paths

Short summary

Agents running in production containers and serverless environments cannot rely on local filesystem persistence. The solution: build an artifact store—object storage (S3/R2) paired with a metadata table tracking session, agent, content-type, expiry, and stable retrieval IDs. This pattern progresses from naïve file uploads to deduplication, idempotency, and shareable links.

  • Local file persistence hides a critical gap: production containers and serverless functions have ephemeral filesystems that reset on retry
  • Artifact store pattern: object storage + metadata table + API gives you queryable context (session_id, agent_id, TTL, content_hash) instead of just filepath
  • Progressive pattern: start with S3 + content hashing for dedup, add metadata table, then handle idempotency keys and presigned URLs for production safety

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more