It was 2015 when first lady Chirlane McCray unveiled ThriveNYC, her pet project to combat mental illness.

Except that’s not quite right: When it launched, she said it would “support the mental well-being of New Yorkers” with an “effective and holistic system.”

We’ve since discovered that the city has spent nearly $850 million and counting not on what the average person would consider the real mental health crisis in our city — people living on the street, or in prison, with schizophrenia and delusions — but on ennui.

That’s $850 million spent on:

“Having an open conversation about mental health.”

Encouraging people to call an (already in existence) 800 number for advice and support.

Nebulous “training” for personnel to recognize the signs of, say, depression.

In short, $850 million that didn’t go where it was needed — to recognize, intervene and treat Randy Santos.

We don’t know what Santos suffers from, but it’s safe to say that mental illness contributed to him coldheartedly bludgeoning to death four fellow homeless men with a metal object early Sunday.

It is a failure of society that the problem of Santos fell to the police. He was arrested at least 14 times previously, for everything from biting a man’s cheek to sexual assault.

For minor incidents, say yelling profanity at passersby, the mentally ill homeless are usually taken to Bellevue Hospital. There they are treated, perhaps medicated, but when there is nothing left to do — or if the patient objects — they are let go.

For more serious crimes, mentally ill homeless end up in Rikers. Treatment is almost nonexistent.

By the way, search the announced initiatives of ThriveNYC for “Rikers” and you find one program. The group “partners” with Correctional Health Services in a “therapeutic creative arts programming” for young adults. “The program aims to help incarcerated youth and young adults feel better and provide access to appropriate clinical interventions as needed.”

The life of the mentally ill on our streets is a vicious cycle of arrest, hospitalization/incarceration and then back on the streets. It is one of the great urban crises of our time, ripe for bold strokes and innovative ideas.

McCray and Mayor Bill de Blasio have provided neither. They have wasted hundreds of millions on the mental health equivalent of a “Free Hugs” T-shirt.

The first lady bristles at any connection between mental illness and violence. “It promotes that misconception that too many people have, that people who have mental illness or people suffering from substance use disorders are violent, which is not true,” McCray said at a 2018 conference, according to Politico.

That may be so, but even the nonviolent mentally ill homeless wouldn’t want to be living on a sidewalk if they were in their right mind. Not to mention that it lowers the quality of life for all New Yorkers.

And the seriously mentally ill who go untreated are as a group more violent than others. That’s why psychiatric units are locked and psychiatric nurses wear panic buttons.

There is a homeless crisis in New York City. Our very generous social safety net shelters and feeds many — 63,839 as of January — yet the Coalition of the Homeless found that there were 3,588 still sleeping on the streets in April of this year.

City officials and police try to get these homeless to come inside. Some are drug addicts who don’t like the rules of the shelters. But many, perhaps most, are mentally ill, who object because they can’t decide what’s best for themselves.

Previous administrations forced them to get in a shelter or move on. De Blasio considers that cruel — but offers no alternative except for liberal platitudes.

What should be done? For starters:

The city should robustly expand its use of Kendra’s Law, the state’s most effective tool for preventing the seriously mentally ill from becoming violent. This law lets judges put the seriously mentally ill with histories of going off treatment (and thereby losing their ability to stay balanced) into mandatory, monitored treatment. Individuals under Kendra supervision are four times less likely to commit violent acts than untreated ones. Yet the latest Mayor’s Management Report shows the city is cutting back the numbers it has under such supervision.

Require mandatory evaluation of all mentally ill leaving jail or involuntary hospital commitment, to see what services (including Kendra’s Law supervision, if appropriate) each needs to stay safe in the community. These are the two highest-risk groups.

Provide more housing slots for mentally ill individuals who are going through mental health courts.

Stop the loss of mental health beds in hospitals and other facilities. That means getting the state, which has seen a steady drop in beds under Gov. Andrew Cuomo, to reverse course. And the city should, for example, get NewYork-Presbyterian to drop its plan to close Allen Hospital, a psychiatric facility in Inwood.

Where will they get the money?

Here’s an idea: The first thing the City Council must do is stop ThriveNYC. Even after budget cuts, it’s still slated to get another $250 million a year going forward.

New York City can’t afford to waste that cash. Shut down ThriveNYC. Put the resources where they’re needed most. Find and treat people like Randy Santos before they kill, and help the people living on the streets with mental illness.