As the saying goes, you can pick your friends, but you can’t pick your family. But what happens when a family member is also a friend, albeit one who is as loving and magnetic as he is exasperating and inappropriate? “A Real Pain,” writer-director-star Jesse Eisenberg ’s loosely autobiographical, beautifully observed dramedy, takes an affecting look at this familial dynamic as mismatched cousins David (Eisenberg) and Benji ( Kieran Culkin ) travel to Poland to visit the childhood home of their beloved, recently deceased grandmother Dory, a Holocaust survivor. The cousins’ journey — which starts with a guided Jewish heritage tour of Warsaw and Lublin, after which they splinter off to Dory’s rural birthplace — covers as much emotional territory as it does physical.

Though the sightseeing may, at first, seem like a device to throw the estranged David and Benji together for a much needed if inevitably fraught reunion, Eisenberg deftly blends the story’s strands in darkly amusing, moving and combustible ways. But it’s the creation of Benji that proves the film’s secret sauce; he’s one of the most vivid and compelling characters you’ll see onscreen this year. Culkin, in a career-best turn, tears into the role with a remarkable mix of exuberance and pathos.

A rudderless, sporadically volatile guy who hit bottom after his grandma’s death (and reacted in drastic form), the unfiltered Benji is also the life of the party: an F-bombing, rules-be-damned whirlin.