Keeping Knowledge Bases Current
This lesson describes the mechanisms that keep an index aligned with its sources, incremental updates, change detection and scheduled refreshes, so a knowledge base does not give confident but outdated answers.
Learning outcomes
After completing this lesson, you will be able to:
- Use incremental ingestion jobs.
- Detect changes with events for near-real-time freshness.
- Schedule and orchestrate refreshes for other sources.
Incremental sync
A knowledge base is only as current as its last sync. An ingestion job, started with StartIngestionJob or the Sync button in the console, is incremental: it compares the data source with what was previously ingested and processes only documents that were added, modified or deleted since the last run. This makes frequent syncs affordable even for large sources.
Deletions matter as much as additions. If a retired policy document remains in the vector store, the assistant will continue to quote it with full confidence. Each job reports statistics, including the number of documents scanned, indexed, deleted and failed. These should be checked after every run and alarmed on, because a sync that silently fails for some documents, for example because of unsupported formats or permission changes, leaves the knowledge base incomplete without any visible error to users. Syncs are typically scheduled with EventBridge Scheduler or triggered by changes in the source.
How sync works
Event-driven change detection
For near-real-time freshness, changes trigger updates. S3 event notifications or EventBridge rules for S3 object events invoke a Lambda function that starts an ingestion job, debounced so a burst of uploads starts one job rather than hundreds (only a limited number of ingestion jobs can run at once per knowledge base). For immediate updates of individual documents, the direct ingestion APIs (IngestKnowledgeBaseDocuments and DeleteKnowledgeBaseDocuments) add, update or remove specific documents without a full sync, for custom and S3 data sources.
For databases, change data capture, such as DynamoDB Streams, triggers a function that re-renders the affected record as a document and ingests it directly.
The following diagram shows the event-driven update path.

Ingestion that falls behind
Scheduled refresh and orchestration
Sources that cannot emit events, such as connectors to SaaS wikis, are refreshed on a schedule with EventBridge Scheduler. A Step Functions workflow can orchestrate the whole refresh: export or copy data, validate it, start the ingestion job, poll until it completes, check failure counts, run a retrieval smoke test and notify owners. Full re-indexing into a new knowledge base or index is required when the embedding model, dimensions or chunking strategy change, followed by a cut-over. The following table compares the mechanisms.
| Mechanism | Freshness | Use for |
|---|---|---|
| Direct ingestion API | Seconds | Individual document changes from applications or CDC |
| Event-triggered sync | Minutes | S3 uploads and deletions |
| Scheduled sync | Schedule interval | Connector sources without events |
| Full re-index with cut-over | Planned | Embedding model, dimension or chunking changes |
Price list freshness
A sales assistant answers from product sheets in S3. Prices change several times a day, and sales staff report quoting outdated prices for hours after updates. Ingestion currently runs nightly.
Nightly sync is too slow. An EventBridge rule on S3 object created and deleted events invokes a Lambda function that calls IngestKnowledgeBaseDocuments (or DeleteKnowledgeBaseDocuments) for the changed sheet, making updates searchable within seconds, while the nightly sync remains as a consistency check.
Does an ingestion job re-embed every document each time it runs?
Show answer
No. Ingestion jobs are incremental: they process new, changed and deleted documents only.
Exam Tips
Remember for the exam
- Ingestion jobs are incremental and process deletions too.
- Immediate single-document updates: direct ingestion APIs.
- S3 changes: event-driven sync, debounced.
- Connector sources: scheduled sync with EventBridge Scheduler.
- New embedding model or chunking: full re-index and cut-over.