## TL;DR
A session context reset wiped the employee ID the user already gave. Persist collected facts to durable session storage on every turn and restore them after any reset.

## The query
```text
agent looped asking for the user's employee id: session context reset broke the flow
```

## Use this when
- the agent re-asks for the employee ID
- context resets mid-conversation
- facts vanish between turns

## Not for
- users who will not share their ID
- ID validation failures
- lookup errors with a valid ID

## Steps
1. Confirm the reset by finding the context-clear event in the session log. Expected output: the reset point is identified.
2. Move collected facts to durable session storage written on every turn. Expected output: facts survive any reset.
3. On reset, restore the facts and continue without re-asking. Expected output: the conversation resumes seamlessly.
4. Add a fact ledger the agent checks before asking anything. Expected output: the agent never asks twice.
5. Test with forced resets at every conversation stage. Expected output: no repeated questions anywhere.

## Applies to
Conversational helpdesk agents, session management, any framework with context windows or resets.

## Variant phrasings
### Reset from a handoff between agents
Pass the fact ledger with the handoff, not just the transcript.

### User corrects the ID mid-flow
Updates must overwrite the stored fact everywhere.

## Why it happens
Context windows reset, compact, and truncate. Facts that live only in the transcript are facts waiting to be forgotten.

## Edge cases
- Persist minimally; employee IDs are sensitive, so encrypt session storage.
- Expire sessions so stale facts do not haunt future conversations.
- Show the user what the agent remembers on request.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_Vx4s_xbc7O0KHS5l-cu-_g
