I remember reading a very peculiar novel that I really enjoyed about 10 years or so ago. The novel might have been significantly older than that.
I remember the plot was about a scientist / inventor who was working on some form of mechanical computer / artificial intelligence. He found an insectoid creature that was responsible for the secretion of a certain kind of drug. That insect had the capacity to hypnotize other creatures or something similar.
If I recall, the solution they found to solve the problem was by designing some sort of artificial intelligence that was harnessed in a mechanical computer (or something with punch card inputs) that fought the drug secreting insects.