> ## Documentation Index
> Fetch the complete documentation index at: https://www.sapientpriors.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# A policy changes

> Replace an outdated document cleanly so retired rules stop appearing in answers

## Example use case

Your company changes its refund window from 14 days to 30 days on the inbound support line, or updates an on-call escalation handbook on the team assistant. The previous PDF is already indexed, and the updated version must take over cleanly without conflicting answers.

## Setup

Replace the outdated document in three ordered steps as the agent's owner:

1. Delete the old file with [DELETE`/v2/agents/{agent_id}/files/{file_id}`](https://www.sapientpriors.com/docs/api-reference/v2/files/delete-file). Priors removes the file immediately and returns `202` with a `Location` header pointing to [GET`/v2/agents/{agent_id}/memories?file_id={file_id}`](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories).
2. Poll that `Location` URL until every listed turn reaches `forgotten`.
3. Upload the updated document via multipart [POST`.../observe`](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files) and poll until `committed`.

On a learning agent (such as the team assistant), if anyone also repeated the old rule in a separate chat turn that did not cite the file, list those turns via [GET`/v2/agents/{agent_id}/memories`](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories) and forget them too.

## Benefit with Priors

* **Complete file teardown:** deleting the superseded file removes its bytes, extracted figures, pieces, and every memory from turns citing it.
* **Clean source of truth:** uploading the replacement leaves one authoritative document for answers and citations.

## What goes wrong

> [!WARNING]
>
> Uploading the revised policy without deleting the old one keeps both versions in memory, causing answers to mix old and new rules or cite the retired PDF. Note also that `DELETE` returns `409 conflict` while the old file is still learning, and deleting a file does not remove unrelated chat turns where someone restated the old policy in conversation.

## Recommendation

Always delete the superseded file and wait for its turns to reach `forgotten` before uploading the replacement. Map each document slug (such as `refund-policy`) to its active `file_id` so policy refreshes stay automated.

## Calls used

* Guides: [Files](https://www.sapientpriors.com/docs/concepts/files.md), [Memories](https://www.sapientpriors.com/docs/concepts/memories.md), [Your data](https://www.sapientpriors.com/docs/data.md)
* API reference: [Delete file](https://www.sapientpriors.com/docs/api-reference/v2/files/delete-file.md), [List memories](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories.md), [Forget a memory](https://www.sapientpriors.com/docs/api-reference/v2/memories/forget-a-memory.md), [Learn messages or a file](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.