This question already has an answer here:
I'm looking for help identifying a story where everyone lives in a city run by machines.
The main character has a helper robot who won't/can't do something or give him some information. He goes deep into the city and a bigger machine makes him a new robot that can do "the thing" and the first robot shuts down.
I remember he goes up some stairs to the city wall and finds a ship, I think covered in sand outside the city walls.
He then travels to another part of the planet where the "non technology" people live, they try and make him stay using mind control, but he has the robot instructed to make sure he gets back, and to ignore him if he tried to give it other orders.
I thought it was by Arthur C. Clarke, but I'm not sure, I also thought it might be a two-part where the first part is written by Clarke and the second part written by someone else but I'm not to sure of these parts.