Intermediate level · Module 7: Document Processing and Chunking · Lesson 3 of 3
Versioning, Updates and Safe Uploads
Learners handle document updates without stale answers, and design safe handling for uploaded files: type and size checks, access levels and privacy.
In this lesson you will
- Version and update documents in a collection
- Handle uploads safely
Key concepts
document versionsre-indexingstale contentupload validationaccess levels
The lesson
When a document changes, remove its old chunks and index the new version; record the version and date in metadata. Otherwise the assistant may cite outdated fees or policies.
Uploaded files are untrusted: check type and size, store them outside the web root, scan for instruction-like text, and never send them to third-party services without authorisation.
Give each document an access level and filter retrieval by the user's level, so restricted documents never reach unauthorised users.
Step by step
- Add version and date metadata.
- Implement update by document ID (delete old chunks, add new).
- Add upload checks for type and size.
- Test access-level filtering with two users.
Practice activity
Add versioning, safe uploads and access filtering to the project collection.
Expected result: Updates without stale chunks, safe uploads and correct access filtering.
Check your understanding
-
What happens if old chunks are not removed after an update?
Show answer
The assistant may cite outdated information.
-
Why treat uploaded files as untrusted?
Show answer
They may be the wrong type, too large, contain hidden instructions or include sensitive data.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.