When I arrived at the wine bar, there was only one open table — dimly lit and intimate. The booze, music and candlelight felt like a callback to our first kiss 15 years before, almost to the day.

There was no sign of him, so I ordered a chardonnay and two small plates, and tried to focus on the novel I brought with me, ironically titled What She Knew. Instead, I found myself flashing back to the last time I saw him.

We had just returned from a trip to Napa to scout wedding venues. After a heated kiss, I drove to my apartment 95 miles away.

Days later, I learned he’d been cheating on me, and I ended our six-year relationship — the best of my life up to that point — with a two-line email. He fired back with a litany of messages, which began with profanity and culminated in pleas.

“PLEASE DON’T LEAVE ME. . . YOU ARE MY EVERYTHING,” he screamed through the screen.

He sent texts, letters, roses, and initiated countless hang-up calls.

I never responded. I never told him a mutual friend confirmed my suspicions. I never considered reconciling.

Over the years, we corresponded intermittently, but not about anything deep — and never to revisit our history. But when work took me to his hometown of Santa Barbara, I reached out and asked if he’d like to meet.

I’m happily married with kids. He’s engaged. What’s the harm?

Apparently my urge to reconnect with an ex makes sense. “The brain develops pathways based on learned patterns,” says love expert Helen Fisher, a senior research fellow at the Kinsey Institute, Indiana University. “So, if you laid down a powerful pattern that this person was your life partner, your brain can retain traces of that circuitry, even after you’ve bonded with someone new.”

Nevertheless, I struggled to understand why, even though it’s certainly not the case for everyone — especially those who have had toxic relationships — I felt so comfortable sitting across the table from someone who pulled the rug out from under me. So down the rabbit hole I went to find out what happens in our brains when we reunite with an old love.

Laying Down a Template

I met Ben (not his real name) when we were both 26. We had a sweet, albeit star-crossed romance. He was an irrepressible free spirit, a dreamer, a romantic. I was an ambitious type A who played it safe. Like peanut butter and jelly, we complemented each other.

He was the first to make me dinner, teach me to surf in ice-cold waters and unlock the seemingly impenetrable fortress of my body. Together, we formed our identities and defined what love meant. In the process, he ingrained himself into my psyche.

(Credit: Klaus Vedfelt/Getty Images)

Experts say the neurological attachment that happens between young lovers is not unlike the attachment a baby forms with its mother. Hormones like vasopressin and oxytocin are key in helping create a sense of closeness in relationships and play a starring role in both scenarios.

If that person was your first, best or most intimate, the mark is even more indelible. Such preferential encoding in the brain is one reason why stories of people reconnecting with a high school or college flame are commonplace.

“The person you have your first orgasm with, especially if that person cuddles with you afterward, lays down a template for what you find attractive,” says Jim Pfaus, a professor of psychology and neuroscience at Concordia University in Montreal.

It goes something like this: According to a 2010 study published in The Journal of Neurophysiology, feelings of romantic love trigger the brain’s dopamine system, which drives us to repeat pleasurable experiences. The brain’s natural opiates help encode the experience, and oxytocin acts as the glue that helps forge those feelings of closeness.

“Oxytocin unleashes a network of brain activity that amplifies visual cues, odors and sounds,” explains Larry Young, a psychiatry professor at Emory University in Atlanta. That, plus the effects from your brain’s natural opiates and dopamine, and your romantic partner’s traits — strong jaw, piercing blue eyes, musky scent — leave a sort of neural fingerprint. Those preferences become soft-wired into your reward system, just like an addiction.

Even creatures prone to promiscuity, like rats, are often primed to revisit their first pleasure-inducing partner, according to a 2015 study co-authored by Pfaus. And it seems humans may follow a similar pattern.

Drawn to the Past

When Ben walked into the bar, I stood up, navigated my way toward him and gave him a big hug, standing on my tiptoes to reach his neck. My first thought: He bulked up! I felt like a doll enveloped in his 6-foot-1 frame.

“Congratulations,” I whispered. “You look great!”

He puffed up with the compliment, that familiar sparkle gleaming in his eyes.

It was comfortable. Easy. Seeing him instantly reactivated the networks my mind encoded 15 years before. Throw a bear hug into the mix — and the accompanying flood of oxytocin — and that old brain circuitry lit up like fireworks. Justin Garcia, the associate director for research and education at the Kinsey Institute, says that’s no surprise. Just like a recovering alcoholic craving a drink after decades of sobriety, we can still be drawn to an old lover.

(Credit: GaudiLab/Shutterstock)

“It doesn’t mean you still want to be with that person,” he says. “It doesn’t mean there’s something wrong with you. It means there’s a complex physiology associated with romantic attachments that probably stays with us for most of our lives — and that’s not something to be afraid of, particularly if you had a great run.”

Focus on the Good

While high school sweethearts typically meet, fall in love and dissolve before their brains are fully developed — somewhere in their mid- to late 20s — I met Ben just as my brain’s frontal lobes were reaching maturity. In fact, once I began operating with a full mental deck, we were entering our final act.

By the time we split, my 32-year-old brain was viewing life in high definition. I wanted a family. He wanted freedom. We reached an impasse.

Today, our lives couldn’t be more disparate. He’d been living in a loop since I left — upscale dinners, regular happy hours, exotic vacations — and before his engagement, a different woman by his side every few years. I married, bore three children and spent most days with a toddler attached at the hip — or more often the knee because both hands are full.

But I don’t regret our relationship. Instead, I treasure the time we spent together. And that’s in line with how many people look back on their old, positive relationships. The human mind not only becomes more sentimental with age, it’s also adept at rewriting our early romantic history.

“After we resolve a romantic relationship,” Fisher says, “we have this remarkable ability to forget the bad parts and focus on the good ones.” So while I could easily recall the time Ben scattered hundreds of rose petals throughout my apartment, I conveniently forgot the time he took off on a guys’ ski trip without warning.

I still love Ben, for the role he played in my story. The experiences we shared together, and even how we separated, stay with me in a positive and healthy way and they helped form the person I am today.

When Reconnecting Makes Sense

Most people have a lost love they wonder about. Someone who held your hand through transformative moments and helped you define you. Love research supports the notion that it’s psychologically intoxicating to reconnect with a former flame you still feel friendly toward; the brain lights up the same way a cocaine addict’s does before a hit.

But, unless you’re single, divorced or widowed, it’s probably best to avoid searching for that old love on Facebook. According to psychologist Nancy Kalish, professor emeritus at California State University, Sacramento, when social media collides with a generally happy marriage, the results can be disastrous. A whopping 62 percent of married folks in her study wound up having an affair with their ex — even though they didn’t reach out to them with any such plan in mind.

“You can’t compare the person who you experienced a first or early love with to someone who you’ve had a deep abiding love with for many years through the course of a marriage,” Kalish says. “Both are good and both are powerful.”

So before you follow an ex on Twitter, send them a Facebook message or stalk them on Instagram, consider two big factors: Are you single? And if not, are you prepared to let reconnecting with your ex devastate your current relationship? If the answer to either question is “yes,” you could be in for a pleasant reunion with an old friend.

Amy Paturel is a health journalist based in Temecula, Calif. This article originally appeared in print as "Fired Up."