Skip to main content
Problem: you have a document archive in S3 and want agents to retrieve content from those files. Items should upsert on every run, skip unchanged files, and let a processor fetch the bytes for extraction. Prerequisite: read Data sources and sync and Custom processors first — this recipe assumes you are familiar with the source and processor shapes.

What you will build

  • A context with a file_s3key field and a content_hash field.
  • A source that lists an S3 prefix concurrently, computes an ETag-based hash, and upserts one item per object.
  • A processor that fetches the file bytes via utils.storage.getPresignedUrl and extracts text.

Complete source listing

src/contexts/document-archive-context.ts

Key points

Incremental sync deep dive

How upsert matching, hash checks, and deletion work in detail.

Custom processors tutorial

Full walkthrough of writing a processor with filter and execute.