သဘောတရား
RAG update and knowledge base refresh pipelines
Keep a knowledge base fresh: trigger syncs, reindex, swap indexes and watch for failures.
ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။
- 1A document is added, changed or deleted in S3.
- 2An event reaches an EventBridge rule.
- 3A Lambda function starts an ingestion job.
- 4The job updates the knowledge base.
အဆင့်ဆင့်
- 1A document is added, changed or deleted in S3.
- 2An event reaches an EventBridge rule.
- 3A Lambda function starts an ingestion job.
- 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
| Approach | Use it when | Trade-off |
|---|---|---|
| Incremental sync | Documents are added or changed | Cheap and fast |
| Scheduled sync | Freshness by the hour or day is enough | May do nothing |
| Full reindex | Embeddings model or chunking changes | Costly, needs a new index |
| Versioned index and swap | You need no downtime | Two indexes for a while |
| Freshness metadata | Old content must rank lower or be filtered | Needs metadata files |
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
| Approach | Use it when | Trade-off |
|---|---|---|
| Incremental sync | Documents are added or changed | Cheap and fast |
| Scheduled sync | Freshness by the hour or day is enough | May do nothing |
| Full reindex | Embeddings model or chunking changes | 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
| Approach | Use it when | Trade-off |
|---|---|---|
| Versioned index and swap | You need no downtime | Two indexes for a while |
| Freshness metadata | Old content must rank lower or be filtered | Needs metadata files |
ဘာလဲ
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.
ဒီ task ထဲမှာ · 3.3
- Deployment strategies and rollback
CodePipeline
CodeBuild
CodeDeploy
SageMaker Pipelines
- Automated testing in ML pipelines
- Triggering retraining
Model Registry
Prompt Management
- Agent deployment pipelines and versions
- AI model and prompt testing
- Automating FM deployment and fine-tuned model versions
- RAG update and knowledge base refresh pipelines
Step Functions