Former president Barack Obama walks by his presidential portrait at the Smithsonian National Portrait Gallery in February. (Matt McClain/The Washington Post)

Former president Barack Obama's vision of America was rooted in uniting those who often process politics and policy differently because of their different identities.

In the 2004 Democratic National Convention speech that introduced the then-senator to much of the world, he received resounding applause when he said:

“The pundits, the pundits like to slice and dice our country into red states and blue states: red states for Republicans, blue states for Democrats. But I've got news for them, too. We worship an awesome God in the blue states, and we don't like federal agents poking around our libraries in the red states. We coach Little League in the blue states and, yes, we've got some gay friends in the red states.”

He also said in that speech:

“Now even as we speak, there are those who are preparing to divide us, the spin masters and negative ad peddlers who embrace the politics of anything goes. Well, I say to them tonight, there's not a liberal America and a conservative America; there's the United States of America. There's not a black America and white America and Latin America and Asian America; there's the United States of America.”

More than a decade later, as the first black president was ending his historic time in the White House, Obama was faced with acknowledging something that perhaps he had not previously — America was far more divided than many people realized.

According to a New York Times piece previewing longtime Obama adviser Benjamin Rhodes's upcoming book “The World As It Is,” the former president questioned whether he had misjudged the American electorate in the months leading up to the end of his administration. A conversation shortly after the 2016 election went like this, according to Rhodes:

“What if we were wrong?” he asked aides riding with him in the armored presidential limousine.

He had read a column asserting that liberals had forgotten how important identity was to people and had promoted an empty cosmopolitan globalism that made many feel left behind. “Maybe we pushed too far,” Mr. Obama said. “Maybe people just want to fall back into their tribe.”

His aides reassured him that he still would have won had he been able to run for another term and that the next generation had more in common with him than with Mr. Trump. Mr. Obama, the first black man elected president, did not seem convinced. “Sometimes I wonder whether I was 10 or 20 years too early,” he said.

It's fair to say, more than a year after President Trump entered the White House, Obama was wrong about one thing: just how many people bought into his vision of an inclusive America where diversity is fundamental to the country's — and the world's — success.

Very often after a racist, sexist or other discriminatory comment or incident captures national headlines, some politicians and other cultural influencers head to Twitter to say: “This is not who we are.”

The frequency with which these episodes happen is proof that that's not true. Obama often called on Americans “to appeal ... to our better angels.” This is a line he borrowed from Abraham Lincoln, who had to challenge Americans to do the same thing more than a century and a half ago.

While Obama may have underestimated just how tribalistic the country had become during his presidency, and the role he may have played in it, the idea that most people bought into the vision of America that Trump promoted is also unsupported by the data.

A majority of the electorate voted against Trump. The agenda articulated by Hillary Clinton, who often campaigned on continuing the vision of America that Obama had promoted, received more votes than Trumpism. And the continued low approval ratings Trump receives suggest that Obama may not have been as wrong in his grasp of the American electorate as he felt in the days following Trump's win.

The elections following Trump's electoral college victory have been a better — or at least, more recent — gauge of how Americans feel about the direction of the United States now. The upcoming midterms will be the next major test of whether "falling back into their tribe" is attractive for large swaths of Americans, as the former president feared.