Module 07 Activity
Scenario
The app now has conversations, which means state that outlives a request and belongs to a person.
What you build
Extracted facts instead of transcripts, deliberate trimming, per-user isolation and a retention policy.
Steps
- Take a real multi-turn exchange and extract established facts into named fields. Compare the sizes.
- Implement trimming by tokens that keeps the system message and starts on a user turn.
- Key session state on the authenticated user id and the session id together. Prove two users with one session id do not cross over.
- Confirm the user id comes from your authenticated session, never the request body.
- Give stored conversations a retention limit, access control and a deletion path. Demonstrate a purge.
- Mark which facts were verified against a source and carry only those forward.
Evidence to hand in
- The transcript and the extracted fields with sizes.
- Trimming output showing what was kept.
- Two users, one session id, no crossover.
- Where the user id comes from, in code.
- The retention policy and a demonstrated purge.
- The verified/generated marking.
Review checklist
- Facts are fields, not a summary.
- Trimming keeps the system message and starts on a user turn.
- The session key includes the authenticated user id.
- The user id is not read from the request body.
- Only source-verified facts are carried forward.
