Skip to course content
Free LangChain course

LangChain for LLM Applications and RAG

Module 08 Activity

Scenario

The assistant now has conversations. Everything here is about what crosses between turns and between users.

What you build

Extracted facts instead of transcripts, deliberate trimming, per-user session isolation, and a retention policy for persisted sessions.

Steps

  1. Take a real multi-turn exchange and extract established facts into named fields. Compare the size against the transcript.
  2. Implement trimming by tokens, keeping the system message and starting on a human turn. Show what gets dropped.
  3. Key session state on the authenticated user id and the session id together. Prove two users with the same session id do not cross over.
  4. Confirm the user id comes from your authenticated session and never from the request body.
  5. Give persisted sessions a retention limit, access control and a deletion path, and show a purge.
  6. Mark which facts were verified against a source, and carry only those forward.

Evidence to hand in

Review checklist