True to the crumbling marriage at its center, what’s best in “Here I Am” — Jonathan Safran Foer’s moving, maddening and messy novel — comes early.

Julia and Jacob have been married for 16 years and have three boys. In the beginning, they’d committed to a policy of complete honesty, convinced they could tell each other everything and be stronger for doing so.

But by the time we meet them, Jacob is sexting a work colleague and Julia is fantasizing about a life on her own. When she stumbles on Jacob’s phone, it looks like game over — even as Julia admits to herself that it was possible she was being too hard on Jacob, for having “been first to express what she knew she’d been first to feel.”

Safran Foer is excellent in summarizing how an idealistic couple moves from A to Z:

“Domestic closeness had become intimate distance, intimate distance had become shame, shame had become resignation, resignation had become fear, fear had become resentment, resentment had become self-protection. Julia often thought that if they could just trace the string back to the source of their withholding, they might actually find their openness.”

But one can’t live life through a rearview mirror; by the time Julia and Jacob’s oldest is preparing to make his bar mitzvah, this once tight-knit couple had grown “afraid of not having the kids to fill the void.”

Perhaps reflecting the recent, well-publicized demise of his own seemingly idyllic marriage to novelist Nicole Krauss, Safran Foer suggests that marriages go south because we expect too much; invoking a Hasidic proverb, he wonders whether our pursuit of happiness involves fleeing contentment. Expecting perfection, we wind up with nothing.

“Here I Am” is also very good at what happens when we’re so preoccupied with playing it safe that we fail to take risks and so afraid to die that we forget to live. Both Julia and Jacob tread increasingly narrow paths, realizing too late, as Jacob puts it, that they’d been “inside the Holiest of Holies all along.” Seeing what they were missing, they’d failed to count their blessings.

Safran Foer is far less successful when applying the lessons learned through this domestic drama to the larger story he simultaneously tells, involving an earthquake that nearly destroys an embattled Israel. It’s another embodiment, for him, of an imperfect world that therefore risks being unappreciated altogether — or, worse, idealized as something better than it could ever be.

The novel’s reflections on Israel trigger a parallel series of ruminations involving the meaning and value of Judaism, best captured through a rabbi’s spellbinding speech following the death of Jacob’s grandfather and through exchanges between Jacob and his visiting Israeli cousin, Tamir.

Taken separately, these set pieces — and many more like them — radiate intelligence. But they aren’t always filled with life; instead, many of them play like the podcasts to which Jacob is addicted: informative one-offs that aren’t necessarily being connected to a larger picture.

That picture frequently fails to come into focus. And long as this novel is, many of its characters never make the transition from talking heads to credible beings. They’re smart and archly clever — often annoyingly so — as well as correspondingly obscure.

All of which is to say that “Here I Am” practices what it preaches: it’s an imperfect novel, urging us to learn what Jacob eventually does: We live in a fallen, post-Edenic world. Safran Foer doesn’t shy away from how sad this is, even as characters like Jacob and Julia gamely carry on.

“Their relationship, like all relationships,” was “dependent on willful blindness and forgetting,” we’re told at one point of Jacob and Julia. Looking back years from now on this novel, I doubt I’ll remember much about its flaws. But I’m confident I’ll continue recommending its uneven sprawl because it rightly dares to insist that it nevertheless has something vital to say. (TNS)