Data such as engagement with tweets or Facebook Live videos have been taken into account. The result is that Trump has overtaken the engagement numbers of Barack Obama 's peak in 2008 — the year he was elected president — by 25 percent.

The AI system was created in 2004, so it has been getting smarter all the time. It had already correctly predicted the results of the Democratic and Republican Primaries.

MogIA was developed by Sanjiv Rai, founder of Indian start-up Genic.ai. It takes in 20 million data points from public platforms including Google, Facebook, Twitter and YouTube in the U.S. and then analyzes the information to create predictions.

An artificial intelligence system that correctly predicted the last three U.S. presidential elections puts Republican nominee Donald Trump ahead of Democrat rival Hillary Clinton in the race for the White House.

Rai said that his AI system shows that the candidate in each election who had leading engagement data ended up winning the election.

"If Trump loses, it will defy the data trend for the first time in the last 12 years since Internet engagement began in full earnest," Rai wrote in a report sent to CNBC.

Currently most national polls put Clinton and the Democrats ahead by a strong margin. Rai said his data shows that Clinton should not get complacent.

But the entrepreneur admitted that there were limitations to the data in that sentiment around social media posts is difficult for the system to analyze. Just because somebody engages with a Trump tweet, it doesn't mean that they support him. Also there are currently more people on social media than there were in the three previous presidential elections.

"If you look at the primaries, in the primaries, there were immense amounts of negative conversations that happen with regards to Trump. However, when these conversations started picking up pace, in the final days, it meant a huge game opening for Trump and he won the primaries with a good margin," Rai told CNBC in a phone interview.

Using social media to predict outcomes of elections has become increasingly popular because of the amount of data available publicly. In September, Nick Beauchamp, an assistant professor of political science at Northeastern University, published a paper about his experiment applying AI to more than 100 million tweets in the 2012 election. He found that this closely mirrored the results seen in state-level polling.

"These results provide not just a tool for generating surveylike data, but also a method for investigating how what people say and think reflects, and perhaps even affects, their vote intentions," Beauchamp said.

Rai said his system would be improved by more granular data. He said that If Google was to give him access to the unique internet addresses assigned to each digital device, he could then collect data on exactly what people were thinking.

For example, Rai said if someone was searching for a YouTube video on how to vote, then looked for a video on how to vote for Trump, this could give the AI a good idea of the voter's intention. He added that there would be no privacy concerns as these internet addresses would be anonymized.

"Granularity of data will determine progressively lesser bias despite the weightage of negative or positive conversations," Rai wrote in his report, explaining how to improve the system.

MogIA is based on Mowgli, the child from Rudyard Kipling's novel "The Jungle Book." Rai said this is because his AI model learns from the environment.

"While most algorithms suffer from programmers/developer's biases, MoglA aims at learning from her environment, developing her own rules at the policy layer and develop expert systems without discarding any data," Rai said.

Correction: MogIA is based on Mowgli from the novel "The Jungle Book." An earlier version misspelled the character's name.