Skip to course content
Free generative AI app course

Generative AI Application Development with Python

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

  1. Take a real multi-turn exchange and extract established facts into named fields. Compare the sizes.
  2. Implement trimming by tokens that keeps the system message and starts on a user turn.
  3. Key session state on the authenticated user id and the session id together. Prove two users with one session id do not cross over.
  4. Confirm the user id comes from your authenticated session, never the request body.
  5. Give stored conversations a retention limit, access control and a deletion path. Demonstrate a purge.
  6. Mark which facts were verified against a source and carry only those forward.

Evidence to hand in

Review checklist