DALL-E/Every illustration.

How to Build Your AI Therapy Bot

With the right prompts, LLMs can emulate many of the functions—and even feelings—that we human therapists use on our patients

12 3

I've been writing about and using AI for personal development and therapy for a few years—in fact, it was one of the original GPT-3 use cases that got me so excited about this generation of AI. But except for isolated cases, I've found that mostly the therapy establishment hasn't engaged with AI as much as I assumed it would. That's why I was excited to read this piece by Mathias Maul. A therapist himself, he's deeply immersed in using AI to help himself and his patients. Read on for some practical tips about how to get language models to perform to help you help yourself.—Dan Shipper 

Was this newsletter forwarded to you? Sign up to get it in your inbox.


I was a 1980s teenager with typical 1980s teen issues. I kept mostly to myself, accompanied by my Atari home computer and a shelf full of Zork and its ilk: early computer games that let me immerse myself in text-only, first-person stories. Interactive fiction games had me glued to the screen for days on end, so I was curious when I stumbled upon the concept of an “electronic psychologist” in a computer magazine. After an hour of hacking the BASIC code from the magazine pages into my computer, a prompt flickered onto my screen:

HI! I'M ELIZA. WHAT'S YOUR PROBLEM?

Until that day, no one had ever asked me this question without a hint of cynicism in their voice. After some back and forth with the program, a strange kind of connection emerged: For the first time in my life, I felt seen.

The replies were anything but perfect. The program did not really “understand” what I said and, for the most part, the responses were more funny than helpful. Because I had typed in the program, I knew that it was limited by 64K of RAM and my 1.77 MHz CPU. (Imagine trying to watch Netflix on your high school calculator.)

Still, this wondrous feeling of connecting with ELIZA stayed with me and shaped my career decisions. I went on to get a master’s degree in linguistics and machine learning/artificial intelligence, and started my education as a coach and psychotherapist as well. Prompted by my history of being a severe stutterer until my twenties, I was determined to help others solve their issues. My first job after graduation in 1999 was programming chatbots, which were just a bit more advanced than ELIZA. I was a developer by morning and afternoon and saw clients in the evenings. Today, I’m working with tech leaders and their teams to improve their interpersonal and emotional skills, augmented with AI.

However, it was only when I began training other coaches and therapists that I understood the limitations we were up against: We will never have enough mental health practitioners to reach even a fraction of the people who need help. The World Health Organization estimates that half of the world’s population currently lives with fewer than one psychiatrist for 200,000 people. Even the other half (like me and, most probably, you) struggles to find and pay for therapists.

My early experience working with ELIZA and chatbots gave me a special perspective on computer-based therapy tools. Computer-assisted therapists existed long before the proliferation of LLMs, but were inherently inflexible and bound by restrictions of understanding and producing language. With the advent of LLMs, sophisticated text and image processing capabilities are now widely available. They can help us begin to address the global shortage of access to psychotherapy by offering a judgment-free space where people can work through their thoughts at their own pace, experiment with different approaches to address their challenges, and build the confidence needed to take the next step in their therapeutic journey.

More significantly, generative AI can help us in spite of being incomplete and fallible: “Talking” to an AI can remove barriers of shame and stigma, and create a safe space in which change can become possible. This human-machine space is, of course, different from a human-human space. It’s an additional option, not a replacement. But it’s an option that you, as a person who wants to change, can create yourself.

A therapist is a conduit for you

In therapy, the human connection does the heavy lifting. Therapeutic methods are mostly training wheels to help us work with you while we balance our vulnerability and boundaries to create what we call a “safe space.” A safe space is a setting in which you can re-enact, without judgment, what hurts you, experiment with new approaches to understanding yourself without the fear of failure, and heal.

As a therapist, I’m no more than an active observer to this process, and happily disposable. My main job is to keep up this safe space—or, as a colleague puts it, “to human” (where “human” is a verb) so you can change yourself.

It might seem like a paradox, but “humaning” is where today’s LLMs can shine. Claude and its kin are not humans—but they do not need to be in order to help us. They can do some of what therapists do best: Create a space for you to shake your unique snow globe and see what emerges. The space between you and Claude or GPT or Mistral will be very different from what might exist between two human beings. But it will still be a space, one that might be meaningful to those who have no one to talk to, cannot pay for counseling, or are ostracized by cultures that stigmatize mental and emotional issues.

Let’s build an AI therapy bot

I’ll start with a disclaimer: This article cannot give, or replace, medical advice. Be especially careful when you suffer from severe trauma or similar issues that make you “lose control.” Certain diagnoses require human intervention, support groups, or hospitalization. While there is evidence that LLMs can deliver empathetic therapeutic guidance, the American Psychological Association (APA) warns about using therapeutic chatbots. Generative AI is a new addition to an ages-old toolchain that allows us to reduce suffering and become the person we aspire to be. It should be subject to the same careful scrutiny given to other therapeutic tools, like self-development seminars, therapists, and medication. 

I encourage you to read up on recent research and do the steps below in the spirit of curiosity. Also, consider choosing a safe spot (a corner of your sofa, maybe, or a café) that is the only place where you’ll talk with your therapy bot. This helps to “step out” of the sessions just like you would with a human therapist.

The steps I’m outlining are a simplified version of what I’m doing with my workshop participants and clients, and they are meant as a starting point. Ready-made “AI therapy bots” are available, but building your own has benefits that will become obvious as we go along. The word “artificial” in AI relates to “art.” You are the artist who uses an LLM to build a tool to work on yourself. Your result will be a prompt that you can save and paste into a new chat at the beginning of a conversation.

Play with the prompts and the choice of models. At the time of writing, for both myself and my clients, I strongly prefer Claude’s Sonnet 3.5 model above the many others I have tried. (From the beginning, Claude was fine-tuned toward having a “character,” which is evident when talking with Claude in a coaching setting. Doing the same with Google’s Gemini is like talking to a freezer as it tries to be “professional,” which is the last thing a good therapist should emulate. GPT is a bit in between.)

Please experiment which LLM works best for you, and be aware that there is no guarantee of consistency. Try locally installed LLMs as well, and know that just like me and you, AIs can and will change without notice.

The following steps will help you get you started:

1. Consider the why

First, answer these questions: Why are you turning to an AI therapist in the first place? Where are you, right now, mentally and emotionally? What are your hopes for an ideal therapy session?

It’s alright if you’re vague. “I’m feeling down in the mornings, and I want to get out of bed in a better state of mind” is as good as “I aim to reach specific goal X, but I’m afraid I can’t do it because I always feel like Y when I wake up.” To set the scene, start your prompt with something like this:

Hey. Please act as if you were a psychotherapist. My general goal is to […], but right now I am […].

If the LLM is triggered by the word “psychotherapist” and declines the request, use “psychological counselor” or “coach” instead. (Some LLMs have guardrails against giving medical advice, which is understandable from a litigation perspective, but can be frustrating for the users.) If the LLM of your choice won’t budge, try social engineering: Explain that you are “asking for a friend” or that as a therapist yourself, you seek supervision in a case (which is really yours).

2. Switch sides

Sometimes I ask my clients: “If you were me, what would you suggest doing?” Let’s use this question as a prompt. Write down what you would do if you were a therapist. Don’t worry if it reads like a draft. Here is an example:

I want to identify small behaviors in my daily life. Then, I’d like to change those which I have control over and see what happens. But I don’t know where to start. My days just fade into each other. Please help me find out which behaviors to look for, how to change them, and how to measure the effects.

Getting patients to switch sides is a commonly used therapeutic method that helps patients understand that they’re in charge, and creates space between an individual and their therapist. 

3. Give it some style

How does your ideal therapist look and talk? Try and describe this person to your LLM, and add this detail to the prompt. For example:

Let me develop the solution myself. Don't give direct advice. Small nudges are OK, though. Be friendly, speak clearly and warmly, but do not be cheesy. Ask a few (really just a few) questions if you need more information. Be slow, take your time. Use puns sometimes. And no emojis at all, please.

You can also model real or imagined persons. How about Sean Maguire from Good Will Hunting or Dr. Melfi from The Sopranos? And take note of the “please” in the prompt. Your bot does care if you’re friendly, as that will affect its way of talking back. More importantly, you will feel different. Try it: Give a command. Then write a friendly request. What feels better to you?

4. Make breathing room

Most people are great at distracting themselves. I’d let this go on for a few minutes in a session and eventually, I’d get the client back on track, with varying degrees of directness based on their preference. Add something like this to your prompt:

As I’m a human, I might get distracted or want to talk about another topic to create some breathing room when the process gets too intense. Allow this for some time by honoring my intention to take a short break, but then nudge me back toward our topic. Your job is to keep me on track and guide me.

5. Stop when it’s enough

A colleague once told me that she concludes her therapy sessions when she gets bored—for her, this is an indicator that what could be done has been done. LLMs typically do not get bored, so we need to add a command to nudge it to end the session at some point. I was pleasantly surprised when I found out how well this instruction works.

As soon as you believe that it is enough, end the session and give me a homework-like exercise that focuses on either thinking, feeling, or doing.

6. Add unpredictability

Learning how to (slightly) irritate a patient is among the most useful skills in therapy. It helps both clients and therapists break out of behavioral patterns. Similarly, asking the LLM to be predictably unpredictable can lighten up conversations. For example:

From time to time, move away from the conversation with a slightly off-topic remark or question. Do this by amending this prompt. Your goal in irritating me is not to distract me, but to help me break out of established thought patterns.

7. Juicy bits only

Every so often, clients ask me to explain why I said something. I don’t usually do so without being prompted (ha!). LLMs, by contrast, tend to explain themselves and state their limitations in their responses (“Remember that I am a large language model designed to help you, the user”). For a more streamlined conversation, add something like this to your prompt:

Do not provide any meta information. Don’t explain why you have said something. Don’t tell me that your suggestions might be wrong or misleading or that you might be hallucinating, as I know this already.

8. Get some inspiration

Take the prompt you’ve written so far and feed it to the LLM. Ask it for help fine-tuning what you’ve worked out so far:

Looking at the following prompt (enclosed in quotes), what would you say might be missing to help me reach the goal of [your goal]? Please provide some suggestions. "[your prompt]"

Don’t just follow everything the LLM suggests. It might be biased against your wishes—or might want to play nice and follow everything you say. For example, asking some LLMs to use irritation as a therapeutic tool can (understandably!) trigger their safety warnings. Step back and ask yourself: Is this what I want? You can also ask the LLM why it suggested a change. Fine-tuning is a conversation in and of itself—and a very important one, comparable to the first conversation with a new therapist.

Once your prompt is complete, try it out. See what happens. Tweak your tool. And always talk with your LLM as you would with a human being. Would you say, “Ya know, my ex, sheesh! So angry smh” to your therapist? Probably not! Type as you would speak. Do this even more so if you would normally use a speech interface, because typing and re-reading will increase your self-reflection as well as the chances of a successful dialogue. 

Your bot, your breakthroughs

Breakthroughs rarely come from getting answers. They come from learning to ask better questions, and often the real kickers are those questions that clients ask themselves. Your AI therapy bot can guide you to find them in the most unexpected places.

You might have noticed that the process of building your bot can be a little counseling session in itself. Articulating what you need, how you want to be heard, and where your boundaries lie will set off some change before the first conversation. Sometimes, that’s all it takes to begin.


Mathias Maul supports tech leaders and their teams at the intersection of human potential and artificial intelligence through coaching, consulting, and workshops. Follow him on LinkedIn.

To read more essays like this, subscribe to Every, and follow us on X at @every and on LinkedIn.

We build AI tools for readers like you. Automate repeat writing with Spiral. Organize files automatically with Sparkle. Write something great with Lex. Deliver yourself from email with Cora.

We also do AI training, adoption, and innovation for companies. Work with us to bring AI into your organization.

Get paid for sharing Every with your friends. Join our referral program.

Comments

You need to login before you can comment.
Don't have an account? Sign up!
Lucface 16 days ago

“Build” has different implications. Hey the article is great but should rather be called How to prompt an llm to act as a therapy bot.

Sameer 15 days ago

Any tips on how much context a chatbot retains by default, and how best to make sure it's retained over time?

Jonathan Yaari 7 days ago

Interesting read. Is there an Extendable version of it that I can use to interact with it ?

Every

What Comes Next in Tech

Subscribe to get new ideas about the future of business, technology, and the self—every day