by Stuart Russell and Peter Norvig
This is the definitive, comprehensive textbook on AI. If you want a generic but incredibly thorough grounding in the underlying algorithms and mathematical concepts, from search algorithms to logic and probabilistic reasoning, this is the place to start. It's the bible of the field for a reason.