Fifty years ago, an MIT professor created a chatbot that simulated a psychotherapist.

Named Eliza, it was able to trick some people into believing it was human. But it didn’t understand what it was told, nor did it have the capacity to learn on its own. The only test it had to pass was: Could it fool humans?

These days, with robotics advancing to drive cars, beat humans at chess and Go!, and replace entire workforces, Eliza’s smoke and mirrors is child’s play. Researchers now build chatbots that can listen, learn and teach cognitive behavioral therapy to humans. Forget simply simulating a psychotherapist – can a chatbot do what a therapist does, or at least come close?

A San Francisco startup thinks so. Its chatbot, named Woebot, doesn’t replace therapists, but its creators believe it could be the next best thing to seeing one.

Delivered over Facebook Messenger, Woebot teaches users cognitive behavioral therapy skills, such as exercises that people can do to combat negative thinking and ways to manage mood disorders such as anxiety and depression.

Built by former Stanford researcher Alison Darcy and a team of psychologists, linguists and software engineers, Woebot has enormous ambition: to help an increasingly anxious, depressed and stressed population feel happier.

“Right now you can see a therapist, or you can access self-help books, and there’s nothing in between,” Darcy said. “The major gap we want Woebot to fill is the nothing.”

The current model for therapy, in which patients see a therapist once a week for an hour at a time, isn’t, in tech parlance, “scalable,” she said. A therapist can’t reach everyone at every minute of the day. For $39 a month, Woebot can.

“You can access it when you need it most,” Darcy said. “If it’s 2 a.m. and you’re having a panic attack, a physician isn’t going to be available at that time.”

Woebot sends users a message each day to check in with them, asks them about their mood and energy levels, and draws from cognitive behavior therapy to combat self-defeating thinking.

With a personality that’s a cross between Kermit the Frog and Spock from “Star Trek,” the innocent, logical and often goofy chatbot acts as a nonjudgmental listener, while adding levity with the occasional dad joke (“How many therapists does it take to change a lightbulb? One, but the lightbulb has to want to change”).

There are many apps and websites that purport to improve users’ mental health, but Woebot hopes to differentiate itself in two key ways.

The first is that it’s a robot people can talk to, much as they would to a therapist (although the company stresses that Woebot is not a therapist).

The second is that it has undergone a randomized control trial under the supervision of Stanford University researchers and was shown to be effective in improving symptoms of anxiety and depression in college-aged users. The results were published in June in the Journal of Medical Internet Research.

By filling in the gap between self-help books and full-blown therapy, Woebot could be tapping into a significant business opportunity.

Mental disorders topped the list of the most costly health conditions in the U.S., with spending at $201 billion (more than what was spent on heart conditions and cancers), according to 2013 research by Charles Roehrig, the director of the Center for Sustainable Health Spending at Altarum Institute.

Spending included hospital care, traditional therapy and counseling sessions and prescription drugs. Alternative medicines and self-help guides were not included. The report also did not consider how much would be spent if more people had access to mental health services.

A separate market report published by MarketsandMarkets last year estimated that the cognitive assessment and training market – which chatbots such as Woebot fall under – could be worth more than $8 billion by 2021.

This doesn’t come as a surprise to mental health experts, who said the majority of people who could benefit from mental health services don’t access them because of cost, lack of availability or fear of the stigma still associated with mental illness. Even those who have health insurance can have a challenging time getting help.