He was speaking after dedicating the Wadhwani Institute for Artificial Intelligence in suburban Kalina to the nation.
"It is our intention that will determine outcomes of AI," PM Modi said.
"With every technological revolution, the scalability of technology has increased manifold. This has given humans increasingly more power," he said.
The march of technology can't be at the expense of further increasing the difference in society, he added.
The evolution of technology has to be rooted in the ethics of Sab ka saath, Sab ka vikas . "We need to make AI in India and it should work for India," PM Modi said.
"The road ahead for artificial intelligence depends on and will be driven by human intentions. It is our intention that will determine outcomes of AI," he said.
"We are using technology in an unparalleled way, from aeronautics to agriculture and from space missions to service deliveries," PM Modi said.
"We are such a diverse nation of hundreds of languages and hundreds of dialects, can we have AI that makes communication and conversation across these languages and dialects easier? I am sure, we can," he said.
"With the arrival of artificial intelligence, there is no doubt that productivity will go up. But there are also rising fears of human redundancy because there is a competition between the mind and the machine," he said.
"Such fears are neither unfounded nor new. At every stage of technological evolution, we have faced such doubts and questions. This leads to two views of the future. The first brings hopes and aspirations and second brings fears and disruption," he said.
On Maharashtra government and Mumbai University helping set up the institute for artificial intelligence, Modi said it was an excellent example of public-private sector cooperation.
"The institute has ten scientists working at present and their number will go up to 50-100 in a few years. Initial investment (in the project) is Rs 200 crore," said Romesh Wadhwani, co-founder of the institute.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.