The story is completely different from that of the books. The show Wikipedia page summary is below (emphasis mine):
The show is based around the eccentric Dirk Gently (Samuel Barnett) who claims to be a "holistic detective", investigating obscure cases based on the inter-connectivity of all things. During the first season he befriends Todd Brotzman (Elijah Wood) and Farah Black (Jade Eshete) who help him with his cases. Dirk's past is linked with "Project Blackwing", a secret CIA project to evaluate subjects with strange abilities. Dirk is not only followed by agents of Blackwing trying to recapture him but also by Bart Curlish (Fiona Dourif), another Blackwing subject who considers herself a "holistic assassin" and believes she is destined to kill Dirk.
While the book's summary begins:
Richard MacDuff attends the Coleridge dinner at his old college St Cedd's, where he witnesses his former tutor, Professor Urban "Reg" Chronotis*, perform an inexplicable magic trick in which he makes a salt cellar disappear, then reveals it by smashing a centuries-old clay pot that a young girl brought to the dinner. The dinner concludes with a reading of Coleridge's poem "Kubla Khan", including a mysterious (and fictional) second part.
Meanwhile, an Electric Monk and his horse find a mysterious door on an alien planet, which leads them to Earth. MacDuff and Prof. Chronotis find the horse in the Professor's bathroom, but this does not seem to overly surprise him. The Monk, misunderstanding a casual comment, shoots and kills MacDuff's boss Gordon Way. Way's ghost makes several attempts to contact the living.
I've read/watched both and they are definitely different stories, as can be seen simply by the characters involved (highlighted). Everything from the show is original to the series, except Dirk and the basic idea of his "agency".
@CrowTRobot mentioned that the first episode had a quote referencing a sofa and Thor, implying that the show follows the two completed novels.
"Have you ever actually solved a case?"
"Sure. Tons. Well, some. Well, a few. There was a bit about a sofa, a thing with Thor..."