You may think, at least if you are not a dog lover, that the dog memoir is for a niche, non-literary readership. But some of the best memoirs I have read have been about dogs: JR Ackerley’s indispensable We Think the World of You soothed my broken heart as a teenager after a beloved dog had died, and Paul Bailey’s A Dog’s Life is a splendid memoir about the collie cross that took over his and his partner’s life. Even Virginia Woolf wrote a book about a dog: Flush (which is also a semi-fictional biography of Elizabeth Barrett Browning although, admittedly, not one of her best). But Eileen Myles’s Afterglow belongs in a strange category of its own – it is unlike anything I have read and is a work of Joycean ambition in comparison with, say, John Grogan’s popular bestseller Marley and Me.

The dog is Rosie – a stolid, black-and-white pit bull terrier chosen by Myles from a New York street litter. We read early on about Rosie’s last trip to the vet aged 15 (and her last supper: carne asada). But Rosie’s end turns out not to be an ending and her afterlife is in playful hands. Myles, who started as a poet and performance artist in New York City, is now a professor in San Diego and is billed as a “queer feminist literary icon”, lets her imagination off the lead and feels no need to make runaway thoughts come to heel.

This is not a dog elegy that, on the whole, tugs at the heart strings (and I am sorry about that), although its ending is comically moving, in its quaint way, as Myles scatters Rosie’s ashes into green water and the powder just kind of sits on a rock and refuses to disappear: “C’mon, swim baby,” Myles says. Rum and random non-sequiturs flourish throughout (there is an academic footnote, on the toothlessness of Native Americans) and Rosie links all the eccentric synapses – she is regularly sighted and cited. She is even the purported author/posthumous editor of a delightful chapter in which she reveals her low opinion of Myles’s earlier writing efforts: “Afterglow is totally a book with legs (four if I can be dumb) so it will go a lot further than your earlier Eileen-based fictions.”

Myles also raises the hilarious and sobering notion of the dog as ghostwriter: “Dog is travelling through you. I’m dead but you’re going to be dead.” And this leads to a nice aside on writers as ghosts: “All the vitality floods on to the page while her own existence grows wanner and thinner.” There is no missing Myles’s vitality as puppets interview Rosie or during the filming of unmomentous dog moments, written up with the intensity of a detective or clairvoyant. And as Rosie’s voice is broadcast with droll authority – matter-of-fact, gruff, butch – you realise the dog is the ultimate alter ego:

“I feel like a funeral director. Lots of funeral directors are dogs. The Grannan family in Arlington. Remember them. I think they were mainly terriers. Anyhow I knew their son. I don’t want to get distracted.”

This is no run-of-the-mill anthropomorphism – Myles prefers the reverse traffic: the dog in us and in other people: “They cast their eyes up. They do a deep huh.” Dog is even experimentally promoted as God. And there is, throughout, the burden of guilt, the sense that Myles should somehow have been able to keep Rosie alive – the book is one way of doing it. There is a wonderful chapter about attending an AA meeting with Rosie and feeling “up in my head like a depressed lighthouse keeper in cool sneakers” (wonderful image) and psyching herself up to give an eloquent confessional. But when Myles’s turn comes round, the worry is about whether Rosie might have crapped on the floor – and she says so. Everyone laughs. Posturing goes out the window. For all its dog-leg turns, there is no putting down of Rosie or of this book.

• Afterglow (A Dog Memoir) by Eileen Myles is published by Grove Press (£14.99). To order a copy for £12.74 go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99