All of the machine characters we see in the movie are just doing the job they have been programmed to do, without questioning it. Even characters like The Oracle, who acts as a sort of counter-agent to the Matrix, is actually designed to be that way; she is the program built to represent the idea of free will, vs. the architect, who represents predestination.
As suchLogically, the machine-level programs only know what they need to know to perform their routine tasks. It's highly unlikely that the Agents have any idea that the Matrix itself already knows where Zion is. Instead, they are following their programming, which is to track down and eliminate the free humans, and part of that job means finding out where they are hiding outside the matrix.
However, thisThis really just begs the question;question, though ; what we really need to answer is, why were they were programmed that way? To figure that out, you need to understand something that was not well explained in the movies, but is more clearly laid out in the supplemental material: this was the third Matrix attempt. The first two failed because humans are inherently not fully logical beings -- their brains will not just "accept reality" as presented to them, it has to choose their reality. This concept of giving the plugged-in brains the freedom to act as the want is the reason the third Matrix iteration survived.
ButHowever, itthis freedom leads to a number of problems, the main one being that certain minds choose not to accept the reality of the Matrix. The Architect explains that, for whatever reason, the necessity of free will in the Matrix means they also have to give the humans the freedom to escape, or the "glitches" brought about by their rejection will eventually crash the system. But obviously they can't just let everyone out, or eventually they won't have anyone left. So, they set up the system we see in the third movie: every so often, the matrix spits out The One, as a reset switch, and the machines kill everyone else and the whole cycle starts over.
ButOne major problem with this is that getting that cycle to end successfully requiresmeans somehow getting all of the humans involved to make the correct choices, up to and including The One. SoIn fact, the machines haveArchitect's speech implies that everything that happened in the first movie, including Neo rescuing Morpheus from the Agents, was part of the plan, and had to set uphappen in order to move towards a reset of the cycle. Everything we see the human agents do in the movies was something The Matrix wanted to be done, so it needs to take every precaution to make sure those humans stay on the right path.
Requiring the humans to all behave exactly as The Matrix wants means setting up a scenario where those actions are the natural decisions for the humans to make. Things need to play out in such a way that The One does not figure out what's going on until it's too late to do anything about it. Part of this facade includes programming lower-level programs, like Agents, that really believe they are hunting for humans, so the humans have a legitimate enemy to struggle against. In fact, the Architect's speech implies that everything that happened in the first movie, including Neo rescuing Morpheus from the Agents, was part of the plan, and had to happen in order to move towards a reset of the cycle.