Case study

IFS Therapist Assistant

Streamlit-based assistant that guides users through structured IFS sessions with safety checks and session management.

Feb 2025 – Apr 2025
GenAIProductSafety

Overview

A Streamlit application that simulates Internal Family Systems (IFS) sessions through a structured 11-step flow. It manages session state, checks step completion automatically, and flags sensitive content to keep interactions safer.

Problem

Self-guided therapy-style tools can become unstructured and potentially risky without clear boundaries, progression logic, and escalation guidance.

Solution

I implemented a step-based UX with explicit session management, automated step completion checks, and a safety layer that flags sensitive content and reinforces disclaimers.

Architecture

  • User input → safety/content flag check
  • LLM response (gpt-4o-2024-08-06) → step completion check
  • Session state tracking (thread_id, current_step, timer) → UI progress indicators + warnings

Tech stack

Streamlit UI (chat + step indicators + session timer)OpenAI API (gpt-4o-2024-08-06) with thread/session persistencePydantic validation for structured checksVector store usage for step-wise context

Key engineering decisions

  • Hard-coded 11-step IFS structure to keep sessions coherent and testable.
  • Explicit safety flagging + disclaimers to reduce misuse risk.
  • Session commands (/new) and thread IDs to support continuity without confusing users.

Results

  • Implemented end-to-end guided flow across 11 IFS steps with automatic progression logic.
  • Added safety flagging and professional-help guidance prompts.

Links

What I’d improve next

  • Add offline safety resources and clearer crisis-routing UX.
  • Add an automated test suite for step transitions across edge cases.
  • Add analytics for drop-off points to improve completion rate.