BlogWorkshops
All posts

Diving Deep: Building "Dr. Jung's Analysis"

Psychoanalytic word-association reimagined with React + OpenAI

· 1 min read


Diving Deep: Building "Dr. Jung's Analysis"

One of the most widespread use cases for LLMs like Claude.ai and ChatGPT is personal therapy.

We wondered if we could build a digital version of Carl Jung's famous word association experiments? That question led us down a fascinating technical rabbit hole, resulting in a web app that attempts to glimpse into your unconscious mind through simple word associations.

We came up with https://xoself.com/jung

Try it out. Entertainment purposes only. But maybe you’ll find out something new about yourself. As Carl Jung said: The most terrifying thing is to know oneself completely.

🌀 What the app does

  1. Jungian analysis from your word associations – GPT-4 interprets your immediate replies to stimulus words, looking for patterns, archetypes, and psychological themes

  2. Interactive therapy sessions – choose between a short or long session depending on how much of your psyche you're willing to expose

  3. Clickable psychological themes – hover tooltips unpack concepts like archetypes, shadows, and the interplay between conscious and unconscious elements

  4. Personalized "Deeper Truth" – a dramatized takeaway written in Jung's own aphoristic style, giving you something to contemplate

🛠️ Two implementation tricks engineers will appreciate

1. Dynamic word generator

  • Attempts to ensure that every session gets a fresh but balanced stimulus list

2. Per-word hesitation metric

  • Each key-press stops a high-res timer, capturing microsecond-level hesitations

  • Latencies feed directly into the prompt so GPT can flag "shadow" words you lingered on

  • This mimics Jung's original technique where delayed responses indicated emotional complexes

  useEffect(() => {
    setStartTime(Date.now())
    setResponse("")
    // Focus the input field
    if (inputRef.current) {
      inputRef.current.focus()
    }
  }, [currentPrompt])

  const handleSubmit = () => {
    if (response.trim()) {
      const endTime = Date.now()
      const responseTimeSeconds = (endTime - startTime) / 1000
      onResponseSubmit(response, responseTimeSeconds)
    }
  }

Dive into your own psyche at https://xoself.com/jung – no login required, just your unfiltered associations.


Stay Updated

Subscribe to get more insights delivered to your inbox.

Originally published on Substack.

© 2026 XoSelf
More from XoSelf