As humans, our failings are epic. We eat too much, lie to ourselves, never exercise enough, and spend so much money we have nothing left for that vacation in Hawaii. But technology, Dan Ariely believes, might save us from ourselves.

Ariely, professor of psychology and behavioral economics at Duke University is an investor and chief behavioral economist at Qapital, a Swedish-startup geared toward making millennials save.

He tells Quartz the reason we fail to save—or spend effectively:

The most difficult problem is our lack of desire to think about it. You go to the supermarket and you buy and buy and buy. People always underestimate. Even the cashier underestimates. We don’t add up all our costs. We are supposed to think about it and think of all the things we want to spend on now vs. later. But the reality is, we live in the moment and we make decisions in a myopic way without thinking about the big picture. It’s really, really hard. So we don’t do it.

Ariely says the app will force people to think about the opportunity cost of money, or what you give up (saving for college) to get what you want (another bottle of rare gin). You can create a goal—a $300 budget for groceries—and an anti-goal—whatever is not spent from that $300 goes toward something else (Ariely is saving for a car). You can pre-assign money to do the things you mean to do but don’t do. Every time you spend $3 on coffee, you can donate $1 to your favorite charity (and perhaps start curbing your expensive coffee habit).

Research, conducted by Ariely and others, has revealed how product design can change our hapless spending.

He has found that how couples design their savings directly impacts how much they save (the research is not yet published).

Imagine two couples. With couple one, each person has a salary and the money goes into their own accounts first. Then they put funds into a joint account to pay for household spending.

Couple two puts their salaries directly into a joint account and then takes money out to put into separate personal spending accounts.

Here’s what happens: if the money goes into separate accounts first, each person tends to contribute a percentage of their salary. But if they make different amounts and each puts 80% of their salary into the joint account, things doesn’t work out so well. If one person makes $100,000 and the other makes $10,000, one puts in $80,000 and the other $8,000. That leaves person one with $20,000 person two with $2,000.

Ariely finds that the couples that put the money into a joint account first tend to pull out similar dollar amounts for their own spending and wind up saving more. “People think more long-term and the amount of savings is increased,” he says.

Research like this gets at the heart of behavioral economics. Classical economists assumed humans were rational and made sensible decisions, like actually saving money for retirement. Behavioral economists proved we aren’t rational and we don’t save. The main reasons: we prefer the short term to the long term and we prefer concrete things—eating a croissant today—to abstract things, like anything related to the future.

“The environment around us is not trying to get us to make long-term decisions. It is trying to get us to make short-term decisions,” Ariely, author of Predictably Irrational, says. He compares our inability to make sound financial decisions to our ability to lie.

What happens in dishonesty? We have a short-term desire to see life in a certain way and we are changing the facts in our mind to see things that way. Financial decision-making is the same. It’s as if we close our eyes to the facts and they truth. We need a mirror. Better habits. Codes of ethics makes rules for ourselves. The same thing is true here: you don’t want to face a trade off between shopping and saving every time. You want to create rules.

Qapital helps create those rules. George Friedman, the CEO and cofounder, told Tech Crunch, “We’re going after the 20% or 30% of your income that’s spent on crap….It’s that huge chunk of your money that you don’t remember spending or don’t care about at the end of the month.” The app has something called IFTTT (If This Then That) which allows you to tie two apps together so you can automatically put money toward savings goals every time you run five miles or call your mom.

Ariely points to research on migrant workers in India to show that small changes can have big impacts.

In one experiment (pdf), researchers gave workers their salary in one of three ways: group one got an envelope with cash, group two got two envelopes with cash, equally divided. Group two spent less of it and sent more money home. Group three got envelopes with their kids names on them and they saved even more.

“When you give it in one envelope they spend it and they don’t stop,” Ariely said. “When it’s in two and they get to the end of the envelope and they think about whether they want to open a new one, they stop and think about it. This was the decision point.”

“The money was allocated—it had an opportunity cost, it was colored it was named,” Ariely says. Apps like Qapital and others effectively let you create electronic envelopes (think earmarks); visuals like these help you emotionally invest in your goal.

Ariely’s own research found that in Kibera, Kenya workers saved twice as much when they had a physical item to remind them of their savings (in this case, a physical coin). Another study by Michael Sherraden at the Center for Social Development at Washington University in St. Louis shows that just opening a college savings plan can lead to parents investing more in their children’s education.

In the end, the technology and the research point to the same goal: we need help to be the people we want to be and not the ones we usually are. Technology may be our last hope for that.