ladderlore
  • S3 や IAM などのサービス名を入力してください。

概念

RAG update and knowledge base refresh pipelines

Keep a knowledge base fresh: trigger syncs, reindex, swap indexes and watch for failures.

このレッスンはまだ翻訳されていないため、英語で表示しています。

Document change in S3
EventBridge rule
Lambda function
Ingestion job
Knowledge base
Failure alarm
  1. 1A document is added, changed or deleted in S3.
  2. 2An event reaches an EventBridge rule.
  3. 3A Lambda function starts an ingestion job.
  4. 4The job updates the knowledge base.
A document change leads to a sync.

流れ

  1. 1A document is added, changed or deleted in S3.
  2. 2An event reaches an EventBridge rule.
  3. 3A Lambda function starts an ingestion job.
  4. 4The job updates the knowledge base.

A document change leads to a sync.

  • Incremental sync

    Use it when
    Documents are added or changed
    Trade-off
    Cheap and fast
  • Scheduled sync

    Use it when
    Freshness by the hour or day is enough
    Trade-off
    May do nothing
  • Full reindex

    Use it when
    Embeddings model or chunking changes
    Trade-off
    Costly, needs a new index
  • Versioned index and swap

    Use it when
    You need no downtime
    Trade-off
    Two indexes for a while
  • Freshness metadata

    Use it when
    Old content must rank lower or be filtered
    Trade-off
    Needs metadata files
Five choices for keeping a knowledge base current.

1 / 2

  • Incremental sync

    Use it when
    Documents are added or changed
    Trade-off
    Cheap and fast
  • Scheduled sync

    Use it when
    Freshness by the hour or day is enough
    Trade-off
    May do nothing
  • Full reindex

    Use it when
    Embeddings model or chunking changes
    Trade-off
    Costly, needs a new index

2 / 2

  • Versioned index and swap

    Use it when
    You need no downtime
    Trade-off
    Two indexes for a while
  • Freshness metadata

    Use it when
    Old content must rank lower or be filtered
    Trade-off
    Needs metadata files
Five choices for keeping a knowledge base current.

概要

A knowledge base only knows what was last ingested. To keep it fresh, a file change in S3 sends an event to EventBridge. A rule starts an AWS Lambda function, and the function calls StartIngestionJob for that data source. A schedule (EventBridge Scheduler) is a simpler option that may sync nothing. For a custom data source, your code can send documents straight in with the ingest documents API. When changes arrive in bursts, collect them before calling, so you do not start a job for every file.

概要

A sync is incremental. Only added, changed and deleted documents are processed, so it is cheap. A full reindex is needed when the embeddings model or the chunking changes, because old vectors no longer match. Build a new knowledge base or index, check it, and then switch the application to it, which is a versioned index and swap. Keep the old one until the new one is proved.

概要

Add freshness as metadata, such as a last-updated date, so queries can filter out old content. Watch ingestion: read the ingestion job status and its counts of failed documents, publish them as CloudWatch metrics and alarm on failures. A silent failed sync means stale answers with no error.

覚えること

  • S3 event, EventBridge and Lambda start StartIngestionJob.
  • A schedule is simple but may sync nothing. Batch bursts of changes.
  • Incremental sync handles changes. A new embeddings model or chunking needs a full reindex.
  • Versioned indexes: build the new one, test, then swap.
  • Freshness metadata lets queries ignore old content.

覚えること

  • Alarm on failed documents in ingestion jobs.

試験では

  • “Update the knowledge base when a document is uploaded” points to an S3 event through EventBridge to Lambda that starts an ingestion job.
  • “Change the embeddings model without downtime” points to a new knowledge base or index, tested, then swapped in.
  • “Answers are stale but nothing failed” points to missing sync monitoring.