Bug: KB not updating after document replacement and re-sync
I’m running into a KB syncing issue. I replaced a “Settings.docx” file (deleted the old one, uploaded the new version, and re-synced). But the AI Agent still pulls info from the old file — including a client I had removed. This is happening across multiple agents, so it seems like the old data is stuck in cache.
Steps to Reproduce:
1. Upload a document (“Settings.docx”) to feed the KB.
2. Edit the document (e.g., remove a client).
3. Delete the original file from KB.
4. Upload the new version.
5. Re-sync the agent.
6. Ask a question related to the removed content.
Expected Result:
AI Agent should ignore the removed client and only respond from the updated document.
Actual Result:
The Agent continues to reference the removed client, as if the original document is cached.
Notes:
• Issue also occurs in other AI Agents, not just one.
• Resync + re-upload does not clear outdated data.
3 Replies
Hey there!
When you want to swap a file that’s already in your Knowledge Base, the safest path is to replace the document in-place (so the same documentID is kept) rather than deleting and re-uploading it under a new ID. Why this matters • Every KB document is chunked and stored under its unique documentID.
• If you delete then re-upload, the old chunks are put in a deletion queue while the new file is queued for re-chunking. During that short window your Agent can still fetch the “orphaned” chunks, so you’ll see answers that reference removed content. How to fix it 1. In the KB UI use ⋯ → Replace file (or call the Replace Document endpoint – see docs below). This keeps the same documentID and guarantees the old chunks are purged the moment the new file finishes processing.
2. Wait until the file’s status turns Synced (green check).
3. Click Re-sync in the Agent step and republish your assistant. After the status is Synced, a KB preview query or a live Agent query should no longer surface the removed client name. API reference (for automation) • Replace document (non-URL file types): https://docs.voiceflow.com/reference/replace-document-non-url
• Replace document (URL sources): https://docs.voiceflow.com/reference/replace-document-url If you still see stale content after the file shows Synced, give it a few minutes (the deletion job can take a couple more moments to propagate). Then run a Preview inside the KB; if the removed client still appears there, let us know – that would indicate the purge job didn’t complete. Hope that clears it up! :rocket:
When you want to swap a file that’s already in your Knowledge Base, the safest path is to replace the document in-place (so the same documentID is kept) rather than deleting and re-uploading it under a new ID. Why this matters • Every KB document is chunked and stored under its unique documentID.
• If you delete then re-upload, the old chunks are put in a deletion queue while the new file is queued for re-chunking. During that short window your Agent can still fetch the “orphaned” chunks, so you’ll see answers that reference removed content. How to fix it 1. In the KB UI use ⋯ → Replace file (or call the Replace Document endpoint – see docs below). This keeps the same documentID and guarantees the old chunks are purged the moment the new file finishes processing.
2. Wait until the file’s status turns Synced (green check).
3. Click Re-sync in the Agent step and republish your assistant. After the status is Synced, a KB preview query or a live Agent query should no longer surface the removed client name. API reference (for automation) • Replace document (non-URL file types): https://docs.voiceflow.com/reference/replace-document-non-url
• Replace document (URL sources): https://docs.voiceflow.com/reference/replace-document-url If you still see stale content after the file shows Synced, give it a few minutes (the deletion job can take a couple more moments to propagate). Then run a Preview inside the KB; if the removed client still appears there, let us know – that would indicate the purge job didn’t complete. Hope that clears it up! :rocket:
Thanks for your quick reply! My apologies, but I'm not finding the option you mentioned "replace the document in-place"

... actually, in the KB UI, I cannot find the "Replace file", but only; URL(s), Sitemap, Upload file (I tried to upload the file again to see if "Replace file" would be displayed, but not), Plain text and Zendesk.
