There is a 41-year-old woman, an administrative assistant from California known in the medical literature only as "AJ," who remembers almost every day of her life since age 11. There is an 85-year-old man, a retired lab technician called "EP," who remembers only his most recent thought. She might have the best memory in the world. He could very well have the worst.

"My memory flows like a movie—nonstop and uncontrollable," says AJ. She remembers that at 12:34 p.m. on Sunday, August 3, 1986, a young man she had a crush on called her on the telephone. She remembers what happened on Murphy Brown on December 12, 1988. And she remembers that on March 28, 1992, she had lunch with her father at the Beverly Hills Hotel. She remembers world events and trips to the grocery store, the weather and her emotions. Virtually every day is there. She's not easily stumped.

There have been a handful of people over the years with uncommonly good memories. Kim Peek, the 56-year-old savant who inspired the movie Rain Man, is said to have memorized nearly 12,000 books (he reads a page in 8 to 10 seconds). "S," a Russian journalist studied for three decades by the Russian neuropsychologist Alexander Luria, could remember impossibly long strings of words, numbers, and nonsense syllables years after he'd first heard them. But AJ is unique. Her extraordinary memory is not for facts or figures, but for her own life. Indeed, her inexhaustible memory for autobiographical details is so unprecedented and so poorly understood that James McGaugh, Elizabeth Parker, and Larry Cahill, the neuroscientists at the University of California, Irvine who have been studying her for the past seven years, had to coin a new medical term to describe her condition: hyperthymestic syndrome.

EP is six-foot-two (1.9 meters), with perfectly parted white hair and unusually long ears. He's personable, friendly, gracious. He laughs a lot. He seems at first like your average genial grandfather. But 15 years ago, the herpes simplex virus chewed its way through his brain, coring it like an apple. By the time the virus had run its course, two walnut-size chunks of brain matter in the medial temporal lobes had disappeared, and with them most of EP's memory.

The virus struck with freakish precision. The medial temporal lobes—there's one on each side of the brain—include an arch-shaped structure called the hippocampus and several adjacent regions that together perform the magical feat of turning our perceptions into long-term memories. The memories aren't actually stored in the hippocampus—they reside elsewhere, in the brain's corrugated outer layers, the neocortex—but the hippocampal area is the part of the brain that makes them stick. EP's hippocampus was destroyed, and without it he is like a camcorder without a working tape head. He sees, but he doesn't record.

EP has two types of amnesia—anterograde, which means he can't form new memories, and retrograde, which means he can't remember old memories either, at least not since 1960. His childhood, his service in the merchant marine, World War II—all that is perfectly vivid. But as far as he knows, gas costs less than a dollar a gallon, and the moon landing never happened.

AJ and EP are extremes on the spectrum of human memory. And their cases say more than any brain scan about the extent to which our memories make us who we are. Though the rest of us are somewhere between those two poles of remembering everything and nothing, we've all experienced some small taste of the promise of AJ and dreaded the fate of EP. Those three pounds or so of wrinkled flesh balanced atop our spines can retain the most trivial details about childhood experiences for a lifetime but often can't hold on to even the most important telephone number for just two minutes. Memory is strange like that.

What is a memory? The best that neuroscientists can do for the moment is this: A memory is a stored pattern of connections between neurons in the brain. There are about a hundred billion of those neurons, each of which can make perhaps 5,000 to 10,000 synaptic connections with other neurons, which makes a total of about five hundred trillion to a thousand trillion synapses in the average adult brain. By comparison there are only about 32 trillion bytes of information in the entire Library of Congress's print collection. Every sensation we remember, every thought we think, alters the connections within that vast network. Synapses are strengthened or weakened or formed anew. Our physical substance changes. Indeed, it is always changing, every moment, even as we sleep.

I met EP at his home, a bright bungalow in suburban San Diego, on a warm spring day. I drove there with Larry Squire, a neuroscientist and memory researcher at the University of California, San Diego, and the San Diego VA Medical Center, and Jen Frascino, the research coordinator in Squire's lab who visits EP regularly to administer cognitive tests. Even though Frascino has been to EP's home some 200 times, he always greets her as a stranger.

Frascino sits down opposite EP at his dining room table and asks a series of questions that gauge his common sense. She quizzes him about what continent Brazil is on, the number of weeks in a year, the temperature water boils at. She wants to demonstrate what IQ tests have already proved: EP is no dummy. He patiently answers the questions—all correctly—with roughly the same sense of bemusement I imagine I would have if a total stranger walked into my house, sat down at my table, and very earnestly asked me if I knew the boiling point of water.

"What is the thing to do if you find an envelope in the street that is sealed, addressed, and has a stamp on it?" Frascino asks.

"Well, you'd put it in the mailbox. What else?" He chuckles and shoots me a sidelong and knowing glance, as if to say, Do these people think I'm an idiot? But sensing that the situation calls for politeness, he turns back to Frascino and adds, "But that's a really interesting question you've got there. Really interesting." He has no idea he's heard it many times before.

"Why do we cook food?"

"Because it's raw?" The word raw carries his voice clear across the tonal register, his bemusement giving way to incredulity.

"Why do we study history?"

"Well, we study history to know what happened in the past."

"But why do we want to know what happened in the past?"

"Because, it's just interesting, frankly."

EP wears a metal medical alert bracelet around his left wrist. Even though it's obvious what it's for, I ask him anyway. He turns his wrist over and casually reads it.

"Hmm. It says memory loss."

EP doesn't even remember that he has a memory problem. That is something he discovers anew every moment. And since he forgets that he always forgets, every lost thought seems like just a casual slip—an annoyance and nothing more—the same way it would to you or me.

Ever since his sickness, space for EP has existed only as far as he can see it. His social universe is only as large as the people in the room. He lives under a narrow spotlight, surrounded by darkness.

On a typical morning, EP wakes up, has breakfast, and returns to bed to listen to the radio. But back in bed, it's not always clear whether he's just had breakfast or just woken up. Often he'll have breakfast again, and return to bed to listen to some more radio. Some mornings he'll have breakfast a third time. He watches TV, which can be very exciting from second to second, though shows with a clear beginning, middle, and end can pose a problem. He prefers the History Channel, or anything about World War II. He takes walks around the neighborhood, usually several times before lunch, and sometimes for as long as three-quarters of an hour. He sits in the yard. He reads the newspaper, which one can only imagine must feel like stepping out of a time machine. Bush who? Iraq what? Computers when? By the time EP gets to the end of a headline, he's usually forgotten how it began. Most of the time, after reading the weather, he just doodles on the paper, drawing mustaches on the photographs or tracing his spoon. When he sees home prices in the real estate section, he invariably announces his shock.

Without a memory, EP has fallen completely out of time. He has no stream of consciousness, just droplets that immediately evaporate. If you were to take the watch off his wrist—or, more cruelly, change the time—he'd be completely lost. Trapped in this limbo of an eternal present, between a past he can't remember and a future he can't contemplate, he lives a sedentary life, completely free from worry. "He's happy all the time. Very happy. I guess it's because he doesn't have any stress in his life," says his daughter Carol, who lives nearby.

"How old are you now?" Squire asks him.

"Let's see, 59 or 60. You got me. My memory is not that perfect. It's pretty good, but sometimes people ask me questions that I just don't get. I'm sure you have that sometimes."

"Sure, I do," says Squire, kindly, even though EP is almost a quarter of a century off.

An enormous amount of what science knows about memory was learned from a damaged brain that is remarkably similar to EP's. It belongs to an 81-year-old man known as "HM," an amnesiac who lives in a nursing home in Connecticut. As a child, HM suffered from epilepsy that began after a bike accident at age nine. By the time he was 27, he was blacking out ten times a week and unable to do much of anything. A neurosurgeon named William Scoville thought he could cure HM's epilepsy with an experimental surgery that would excise the part of the brain that he suspected was causing the problem.

In 1953, while HM lay awake on the operating table, his scalp anesthetized, Scoville drilled a pair of holes just above the patient's eyes. The surgeon lifted the front of HM's brain with a small metal spatula while a metal straw sucked out most of the hippocampus, along with much of the surrounding medial temporal lobes. The surgery reduced the number of HM's seizures, but it soon became clear that he'd also been robbed of his memory.

Over the next five decades, HM was the subject of countless experiments and became the most studied patient in the history of brain science. Given the horrific outcome of Scoville's surgery, everyone assumed HM would be a singular case study.

EP shattered that assumption. What Scoville did to HM with a metal straw, nature did to EP with herpes simplex. Side by side, the grainy black-and-white MRIs of their brains are uncannily similar, though EP's damage is a bit more extensive. Even if you have no idea what a normal brain ought to look like, the gaping symmetrical holes stare back at you like eyes.

Like EP, HM was able to hold on to memories just long enough to think about them, but once his brain moved to something else, he could never bring them back. In one famous experiment, Brenda Milner, a Canadian psychologist, asked HM to remember the number 584 for as long as possible. To keep the number on the tip of his tongue, he used a complicated system, which he recounted to Milner:

"It's easy. You just remember 8. You see 5, 8, and 4 add to 17. You remember 8, subtract it from 17, and it leaves 9. Divide 9 in half and you get 5 and 4 and there you are: 584. Easy."

He concentrated on this elaborate mantra for several minutes. But as soon as he was distracted, the number dissolved. He couldn't even remember that he'd been asked to remember something. Though scientists had known that there was a difference between long- and short-term memory since the late 19th century, they now had evidence in HM that the two types of memory happened in different parts of the brain, and that without most of the hippocampal area, HM couldn't turn a short-term memory into a long-term one.

Researchers also learned more about another kind of remembering from HM. Even though he couldn't say what he'd had for breakfast or name the current President, there were some things that he could remember. Milner found that he was capable of learning complicated tasks without even realizing it. In one study, she showed that HM could learn how to trace inside a five-pointed star on a piece of paper while looking at its reflection in a mirror. Each time Milner gave HM the task, he claimed never to have tried it before. And yet, each day his brain got better at guiding his hand to work in reverse. Despite his amnesia, he was remembering.

Though there is disagreement about just how many memory systems there are, scientists generally divide memories into two types: declarative and nondeclarative (sometimes referred to as explicit and implicit). Declarative memories are things you know you remember, like the color of your car or what happened yesterday afternoon. EP and HM have lost the ability to make new declarative memories. Nondeclarative memories are the things you know without consciously thinking about them, like how to ride a bike or how to draw a shape while looking at it in a mirror. Those unconscious memories don't rely on the hippocampal region to be consolidated and stored. They happen in completely different parts of the brain. Motor skill learning takes place at the base of the brain in the cerebellum, perceptual learning in the neocortex, habit learning at the brain's center. As EP and HM so strikingly demonstrate, you can damage one part of the brain, and the rest will keep on working.

The metaphors we most often use to describe memory—the photograph, the tape recorder, the mirror, the hard drive—all suggest mechanical accuracy, as if the mind were some sort of meticulous transcriber of our experiences. And for a long time it was a commonly held view that our brains function as perfect recorders—that a lifetime of memories are socked away somewhere in the cerebral attic, and if they can't be found it isn't because they've disappeared, but only because we've lost access to them.

A Canadian neurosurgeon named Wilder Penfield thought he'd proved that theory by the 1940s after using electrical probes to stimulate the brains of epileptic patients while they were lying conscious on the operating table. He was trying to pinpoint the source of their epilepsy, but he found that when his probe touched certain parts of the temporal lobe, the patients started describing vivid experiences. When he touched the same spot again, he often elicited the same descriptions. Penfield came to believe that the brain records everything to which it pays any degree of conscious attention, and that this recording is permanent.

Most scientists now agree that the strange recollections triggered by Penfield were closer to fantasies or hallucinations than to memories, but the sudden reappearance of long-lost episodes from one's past is an experience surely familiar to everyone. Still, as a recorder, the brain does a notoriously wretched job. Tragedies and humiliations seem to be etched most sharply, often with the most unbearable exactitude, while those memories we think we really need—the name of the acquaintance, the time of the appointment, the location of the car keys—have a habit of evaporating.

Michael Anderson, a memory researcher at the University of Oregon in Eugene, has tried to estimate the cost of all that evaporation. According to a decade's worth of "forgetting diaries" kept by his undergraduate students (the amount of time it takes to find the car keys, for example), Anderson calculates that people squander more than a month of every year just compensating for things they've forgotten.

AJ remembers when she first realized that her memory was not the same as everyone else's. She was in the seventh grade, studying for finals. "I was not happy because I hated school," she says. Her mother was helping her with her homework, but her mind had wandered elsewhere. "I started thinking about the year before, when I was in sixth grade and how I loved sixth grade. But then I started realizing that I was remembering the exact date, exactly what I was doing a year ago that day." At first she didn't think much of it. But a few weeks later, playing with a friend, she remembered that they had also spent the day together exactly one year earlier.

"Each year has a certain feeling, and then each time of year has a certain feeling. The spring of 1981 feels completely different from the winter of 1981," she says. Dates for AJ are like the petite madeleine cake that sent Marcel Proust's mind hurtling back in time in Remembrance of Things Past. Their mere mention starts her reminiscing involuntarily. "You know when you smell something, it brings you back? I'm like ten levels deeper and more intense than that."

"My brother used to say, 'Oh, she's the Rain Man.' And I was like, 'No I'm not!' But I thought, what if I really. . . . Am I? Is there something wrong with me?" At one point AJ considered setting up shop on the nearby boardwalk as the Human Calendar and charging people five bucks to let them try to stump her with dates. She decided against it. "I don't want to be a sideshow."

It would seem as though having a memory like AJ's would make life qualitatively different—and better. Our culture inundates us with new information, yet so little of it is captured and cataloged in a way that it can be retrieved later. What would it mean to have all that otherwise lost knowledge at our fingertips? Would it make us more persuasive, more confident? Would it make us, in some fundamental sense, smarter? To the extent that experience is the sum of our memories and wisdom the sum of experience, having a better memory would mean knowing not only more about the world, but also more about oneself. How many worthwhile ideas have gone unthought and connections unmade because of our memory's shortcomings?

The dream that AJ embodies, the perfection of memory, has been with us since at least the fifth century B.C. and the supposed invention of a technique known as the "art of memory" by the Greek poet Simonides of Ceos.

Simonides had been the sole survivor of a catastrophic roof collapse at a banquet hall in Thessaly. According to Cicero, who wrote an account of the incident four centuries later, the bodies were mangled beyond recognition. But in his mind, Simonides was able to close his eyes to the chaos and see each of the guests at his seat around the table. He'd discovered the powerful technique known as the loci method. If you can convert whatever it is you're trying to remember into vivid mental images and then arrange them in some sort of imagined architectural space, known as a memory palace, memories can be made virtually indelible.

Peter of Ravenna, a noted Italian jurist and author of a renowned memory textbook of the 15th century, was said to have used the loci method to memorize the Bible, the entire legal canon, 200 of Cicero's speeches, and 1,000 verses of Ovid. For leisure, he would reread books cached away in his memory palaces. "When I left my country to visit as a pilgrim the cities of Italy, I can truly say I carry everything I own with me," he wrote.

It's hard for us to imagine what it must have been like to live in a culture before the advent of printed books or before you could carry around a ballpoint pen and paper to jot notes. "In a world of few books, and those mostly in communal libraries, one's education had to be remembered, for one could never depend on having continuing access to specific material," writes Mary Carruthers, author of The Book of Memory, a study of the role of memory techniques in medieval culture. "Ancient and medieval people reserved their awe for memory. Their greatest geniuses they describe as people of superior memories." Thirteenth-century theologian Thomas Aquinas, for example, was celebrated for composing his Summa Theologica entirely in his head and dictating it from memory with no more than a few notes. The Roman philosopher Seneca the Elder could repeat 2,000 names in the order they'd been given to him. A Roman named Simplicius could recite Virgil by heart—backward. A strong memory was seen as the greatest of virtues since it represented the internalization of a universe of external knowledge. Indeed, a common theme in the lives of the saints was that they had extraordinary memories.

After Simonides' discovery, the art of memory was codified with an extensive set of rules and instructions by the likes of Cicero and Quintilian and in countless medieval memory treatises. Students were taught not only what to remember but also techniques for how to remember it. In fact, there are long traditions of memory training in many cultures. The Jewish Talmud, embedded with mnemonics—techniques for preserving memories—was passed down orally for centuries. Koranic memorization is still considered a supreme achievement among devout Muslims. Traditional West African griots and South Slavic bards recount colossal epics entirely from memory.

But over the past millennium, many of us have undergone a profound shift. We've gradually replaced our internal memory with what psychologists refer to as external memory, a vast superstructure of technological crutches that we've invented so that we don't have to store information in our brains. We've gone, you might say, from remembering everything to remembering awfully little. We have photographs to record our experiences, calendars to keep track of our schedules, books (and now the Internet) to store our collective knowledge, and Post-it notes for our scribbles. What have the implications of this outsourcing of memory been for ourselves and for our society? Has something been lost?

To supplement the memories in her mind, AJ also stores a trove of external memories. In addition to the detailed diary she's kept since childhood, she has a library of close to a thousand videotapes copied off TV, a trunk full of radio recordings, and a "research library" consisting of 50 notebooks filled with facts she's found on the Internet that relate to events in her memory. "I just want to keep it all," she says.

Preserving her past has become the central compulsion of AJ's life. "When I'm blow-drying my hair in the morning, I'll think of whatever day it is. And to pass the time, I'll just run through that day in my head over the last 20-something years—like flipping through a Rolodex."

AJ traces the origins of her unusual memory to a move from New Jersey to California that her family made when she was just eight years old. Life in New Jersey had been comfortable and familiar, and California was foreign and strange. It was the first time she understood that growing up and moving on necessarily meant forgetting and leaving behind. "Because I hate change so much, after that it was like I wanted to be able to capture everything. Because I know, eventually, nothing will ever be the same," she says.

K. Anders Ericsson, a professor of psychology at Florida State University, believes that at bottom, AJ might not be all that different from the rest of us. After the initial announcement of AJ's condition in the journal Neurocase, Ericsson suggested that what needs to be explained about AJ is not some extraordinary, unprecedented innate memory but rather her extraordinary obsession with her past. People always remember things that are important to them. Baseball fanatics often have an encyclopedic knowledge for statistics, chess masters often remember tricky gambits that took place years ago, actors often remember scripts long after performing them. Everyone has got a memory for something. Ericsson believes that if anyone cared about holding on to the past as much as AJ does, the feat of memorizing one's life would be well within reach.

I mention Ericsson's theory to AJ, and she becomes visibly upset. "I just want to call him on the phone and yell at him. If I spent that much time memorizing my life, then I really would be a boring person," she says. "I don't sit around and memorize it. I just know it."

Remembering everything is both maddening and lonely for AJ. "I remember good, which is very comforting. But I also remember bad—and every bad choice," she says. "And I really don't give myself a break. There are all these forks in the road, moments you have to make a choice, and then it's ten years later, and I'm still beating myself up over them. I don't forgive myself for a lot of things. Your memory is the way it is to protect you. I feel like it just hasn't protected me. I would love just for five minutes to be a simple person and not have all this stuff in my head. "Most people have called what I have a gift," AJ says, "but I call it a burden."

The whole point of our nervous system, from the sensory organs that feed information to the massive glob of neurons that interpret it, is to develop a sense of what is happening in the present and what is about to happen in the future, so that we can respond in the best possible way. Our brains are fundamentally prediction machines, and to work they have to find order in the chaos of possible memories. Most of the things that pass through our brains don't need to be remembered any longer than they need to be thought about.

Harvard psychologist Daniel Schacter has developed a taxonomy of forgetting to catalog what he calls the seven sins of memory. The sin of absentmindedness: Yo-Yo Ma forgetting his 2.5-million-dollar cello in the back of a taxi. The Vietnam War veteran still haunted by the battlefield suffers from the sin of persistence. The politician who loses a word on the tip of his tongue during a stump speech is experiencing the sin of blocking. Though we curse these failures of memory on an almost daily basis, Schacter says, that's only because we don't see their benefits. Each sin is really the flip side of a virtue, "a price we pay for processes and functions that serve us well in many respects." There are good evolutionary reasons why our memories fail us in the specific ways they do. If everything we looked at, smelled, heard, or thought about was immediately filed away in the enormous database that is our long-term memory, we'd be drowning in irrelevant information.

In his short story "Funes the Memorious," Jorge Luis Borges describes a man crippled by an inability to forget. He remembers every detail of his life, but he can't distinguish between the trivial and the important. He can't prioritize, he can't generalize. He is "virtually incapable of general, platonic ideas." Perhaps, as Borges concludes in his story, it is forgetting, not remembering, that is the essence of what makes us human. "To think," Borges writes, "is to forget."

To age is to forget, also. Roughly five million Americans have Alzheimer's disease, and even more suffer from mild cognitive impairment, or lesser degrees of memory loss. When asked to recall a list of 15 words read 20 minutes earlier, octogenarians in one large study recalled fewer than 60 percent, while the twentysomethings could remember close to 90 percent.

Not surprisingly, people have been searching a long time for chemicals that might halt that tide of forgetting. According to the Franciscan Bernardo de Lavinheta, writing in the early 1500s, "Artificial memory is twofold: the first part consists in medicines and poultices." The second part, of course, is the art of memory, which Lavinheta deemed both safer and more effective (since memory medicines can sometimes have the unfortunate side effect of "drying up the brain"). Today ginkgo biloba is sold as an over-the-counter supplement, or added to fruit smoothies and "smart" soft drinks, even without conclusive evidence that it either boosts memory—or dries up the brain.

Within the past decades, drug companies have elevated the search to brave new heights. Armed with a sophisticated understanding of memory's molecular underpinnings, they've sought to create new drugs that amplify the brain's natural capacity to remember. In recent years, at least three companies have been formed with the express purpose of developing memory drugs. One of those companies, Cortex Pharmaceuticals, is attempting to develop a class of molecules known as ampakines, which facilitate the transmission of the neurotransmitter glutamate. Glutamate is one of the primary excitatory chemicals passed across the synapses between neurons. By amplifying its effects, Cortex hopes to improve the brain's underlying ability to form and retrieve memories. When administered to middle-age rats, one ampakine was able to fully reverse their age-related decline in the cellular mechanism of memory.

It may not be long before drugs such as ampakines begin to reach the market; when they do, they could have an enormous impact on society. Though the pharmaceutical companies are searching for therapeutic treatments to stave off Alzheimer's and combat dementia, it seems inevitable that their pills will end up in the hands of students cramming for exams and probably a whole lot of other people who just want to enhance their brains. Already psycho-stimulants designed to treat ADHD, like Adderall and Ritalin, are used as "study buddies" by as many as one in four students at some colleges trying to increase their concentration and improve their memories.

All of this raises some troubling ethical questions. Would we choose to live in a society where people have vastly better memories? In fact, what would it even mean to have a better memory? Would it mean remembering things only exactly as they happened, free from the revisions and exaggerations that our mind naturally creates? Would it mean having a memory that forgets traumas? Would it mean having a memory that remembers only those things we want it to remember? Would it mean becoming AJ?

I want to see EP's unconscious, nondeclarative memory at work, so I ask him if he's interested in taking me on a walk around his neighborhood. He says, "not really," so I wait and ask him again a couple minutes later. This time he agrees. We walk out the front door into the high afternoon sun and turn right. I ask EP why we're not turning to the left instead.

"I'd just rather not go that way. This is just the way I go. I don't know why," he says.

If I asked him to draw a map of the route he takes at least three times a day, he'd never be able to do it. He doesn't even know his own address, or (almost as improbably for someone from San Diego) which way the ocean is. But after so many years of taking the same walk, the journey has etched itself on his unconscious. His wife, Beverly, now lets him go out alone, even though a single wrong turn would leave him completely lost. Sometimes he comes back from his walks with objects he's picked up along the way: a stack of round stones, a puppy, somebody's wallet. He's never able to explain how they came into his possession.

"Our neighbors love him because he'll come up to them and just start talking to them," Beverly says. Even though he thinks he's meeting them for the first time, he's learned through habit that these are people he should feel comfortable around, and he interprets those unconscious feelings of comfort as a good reason to stop and say hello.

We cross the street and I'm alone with EP for the first time. He doesn't know who I am or what I'm doing at his side, although he seems to sense that I'm there for some good reason. He is trapped in the ultimate existential nightmare, blind to the reality in which he lives. The impulse strikes me to help him escape, at least for a second. I want to take him by the arm and shake him. "You have a rare and debilitating memory disorder," I want to tell him. "The last 50 years have been lost to you. In less than a minute, you're going to forget that this conversation ever even happened." I imagine the sheer horror that would befall him, the momentary clarity, the gaping emptiness that would open up in front of him, and close just as quickly. And then the passing car or the singing bird that would snap him back into his oblivious bubble.

We turn around and walk back down the street whose name he's forgotten, past the waving neighbors he doesn't recognize, to a home he doesn't know. In front of the house, there is a car parked with tinted windows. We turn to look at our reflections. I ask EP what he sees.