# Keep vector stores fresh or they rot

## The steps

1. Set `expires_after` when you create the store. The `anchor` can be `last_active_at`, so an idle store cleans itself up instead of billing you forever. A store with no expiration policy is a slow leak.
2. Attach meaningful `attributes` to every file at upload time: source, version, date, language, whatever your queries will filter on. Adding attributes later means re-uploading, so do it now.
3. Decide the refresh cadence before the first query: who re-uploads changed docs, and how often. A store of last quarter's docs answering this quarter's questions is worse than no store.
4. Delete replaced files instead of stacking versions. When a doc updates, remove the old file and add the new one with a bumped version attribute. Duplicate versions of the same doc are the top cause of contradictory retrieved context.
5. Re-verify indexing after bulk changes. Files take time to index; run your standard question set after a refresh and confirm the answers moved.

## The trap

One giant store with no attributes and no expiry. Retrieval quality degrades as the corpus grows, cost grows with it, and nobody owns the cleanup. Small, fresh, filtered stores beat one big stale one every time.

## Checklist

- `expires_after` is set on every store.
- Attributes cover every dimension queries filter on.
- A named owner and cadence exist for refreshes.
- Old versions are deleted, not stacked.
- A question set re-runs after each refresh.