I hate the expression "everything happens for a reason." Always have. You can't say that to a person whose mother died in terrible pain at the age of 49, and expect them to take you seriously... at least, not this person. But some things, sometimes, do. And the agent search process is one of them.
Before I started, I'd heard all about how subjective the whole thing was, and how infuriating that could be—the near misses, the "I just didn't connect with this" letters. But the truth is, even though it feels like a bummer, those rejection letters are a good thing. Because ultimately, they're bringing you closer to the agent who instinctively *gets* your work, and absolutely can't wait to see it out there in the world. Some stranger on one of the zillions of forums, blogs, and articles that I obsessively studied before and while I was querying put it best: it's not enough for an agent to think your work is great. They can't be just readers, enjoying a well-written book and then moving on; to summon the commitment and enthusiasm that their job demands, they have to be moved, addicted, totally over the moon. And anybody who isn't? Not the right agent for you. She never was. It's like dating: it doesn't matter if you thought she was your "dream agent;" if she's not madly in love with your work, she isn't it. Somebody else is.
So put down the consolation chocolate and the Chardonnay—or, you know what—don't. Those sound delicious. But do stop stewing about the rejection. Cross that wrong agent off your list, shake off your blues, and go find the right one. She's waiting for you.