Skip to main content

Overview

This tutorial shows you how to build an automated system that monitors file sources (local directories, S3 buckets, web feeds) and automatically ingests new documents into your Rayrift knowledge base, organizing them into folders for easy retrieval.

Use Cases

  • Document Management: Automatically index reports, invoices, or contracts as they arrive
  • Content Monitoring: Watch RSS feeds or websites for new content
  • Batch Processing: Process large document collections from cloud storage
  • Data Pipeline Integration: Integrate Rayrift into your existing data workflows

Architecture

Step 1: Set Up Folder Structure

Create folders to organize your documents:

Step 2: Monitor Local Directory

Watch a local directory for new files:

Step 3: Monitor S3 Bucket

Watch an S3 bucket for new objects:

Step 4: Monitor Web Content

Automatically ingest content from URLs:

Step 5: Batch Processing

Process existing document collections:

Complete Example: File Watcher Service

Here’s a complete Node.js service that monitors multiple sources:

Best Practices

Error Handling: Implement retry logic for failed uploads and log errors for debugging.
Deduplication: Track processed files to avoid re-uploading the same document.
Rate Limiting: Respect Rayrift API rate limits when processing large batches.
Metadata: Consider adding metadata tags when uploading to help with organization and search.

Next Steps