Example use case
You retire an older product line on the inbound support line and must remove its manual, or a prospect asks you to delete a confidential proposal uploaded to their sales agent.Setup
Call DELETE/v2/agents//files/ as the agent’s owner:
- Immediate removal: before returning
202, Priors deletes the file bytes, any extracted pictures cut from it, and its upload ledger rows. - Background memory cleanup: Priors starts a job that erases the file’s pieces and forgets every memory from turns citing the file.
- Verify completion: poll the returned
Locationheader (GET/v2/agents//memories?file_id=) until every listed turn reachesforgotten.
Benefit with Priors
- One-call cleanup: removes original file bytes, extracted figures, upload metadata, and learned memories together.
- Safe across large documents: avoids looping through thousands of individual file pieces (and DELETE
…/memories/deliberately directs file pieces here).
What goes wrong
Recommendation
Wait until ingestion finishes before deleting a file, always delete using the parent document’sfile_id, and poll the Location URL until every citing turn reads forgotten. Forget any manual chat excerpts separately if needed.
Calls used
- Guides: Files, Memories, Your data
- API reference: List files, Delete file, List memories