“I wanted to be a U.S. Senator, and that didn’t work,” Rep. Joe Kennedy III, D-Mass., said Wednesday as he spoke with GBH News about his time in office and talked of what lies ahead.

The outgoing congressman said he is leaving “proud and hopeful” after his failed bid for a U.S. Senate seat earlier this year.

“It's a bittersweet moment,” Kennedy said. “We are at a difficult time in our country. We're at a period of transition in our nation on big issues — not just from one administration to the next, but economically, culturally, demographically, socially.”

Kennedy — the son of a U.S. representative, grandson of a U.S. senator and U.S. attorney general, grandnephew of both a president and another U.S. senator and great-grandson to a U.S. ambassador to the United Kingdom — campaigned against incumbent Democratic Sen. Ed Markey as a younger, fresher face.

“From the moment that I entered this profession, I was on the ballot — not my father or my grandfather, or either of his brothers or sisters, for that matter," Kennedy said. "Despite knowing what others would try to make that into being, that's not what this was.”

Describing himself as a “new generation of leadership,” Kennedy urged voters in two separate campaign advertisements to both “ fight for change” and “ reject the policies of the past.”

In his farewell speech to Congress on Wednesday, Kennedy, who has struggled to get clear of his own legacy, highlighted the “complicated and messy” legacy of the United States.

“We violated our founding promises before the ink was dry,” Kennedy said. “We boldly declared 'we the people' and promptly defined 'we' as with rich white Protestant men.”

Each generation, he explained, “expands the definition of ‘we.’”

At 39, Kennedy may have missed his window after years of political dominance by white Irish male leaders across the state. Yet Kennedy’s vacated seat in the 4th congressional district will be filled by another young white man from Massachusetts — 32-year-old Newton City Councilor Jake Auchincloss, a moderate Democrat and former Republican.

Kennedy’s Senate bid also came down to two Massachusetts-born white Irish men, resulting in a battle over specific ideas and policies, most of them local, since the candidates mirrored each other on so many national issues.

So what’s next for Kennedy?

The soon-to-be former congressman says he might pivot to advocacy work outside of a political office, focusing on civil rights, access to healthcare and protections for the middle class.

“Trying to find the right way to take some of that advocacy and plug that in without being in elected office will take me a little bit of time,” he said. “I'm getting there, and I'm excited for what the next chapter will be.”