Dubbed as "Deep Drumpf", the bot is based on an artificial-intelligence (AI) algorithm that is trained on just a few hours of transcripts of Republican presidential candidate Trump's victory speeches and debate performances, said post-doc Bradley Hayes from MIT's Computer Science and Artificial Intelligence Lab (CSAIL).
The "Deep Drumpf" got its name from "Last Week Tonight" host and comedian John Oliver who bombarded Trump on his show where he revealed the politician's original family name is actually Drumpf.
The bot creates tweets one letter at a time. For example, if the bot randomly begins its Tweet with the letter "M," it is somewhat likely to be followed by an "A," and then a "K," and so on until the bot types out Trump's campaign slogan, "Make America Great Again."
It then starts over for the next sentence and repeats the process until it reaches the 140-character limit.
The Tweetbot's creator Hayes used techniques from "deep-learning," a field of artificial intelligence that uses systems called "neural networks" to teach computers to find patterns on their own.
Hayes was inspired by an existing training model that can simulate Shakespeare, as well as a recent report that analyzed the presidential candidates' linguistic patterns to find that Trump speaks at a fourth-grade level.
"Trump's language tends to be more simplistic, so I figured that, as a modelling problem, he would be the most manageable candidate to study," Hayes said in a statement.
@DeepDrumpf's Tweets don't always make complete sense but are usually at least partially coherent - much like the candidate himself.
"The algorithm essentially learns an underlying structure from all the data it gets, and then comes up with different combinations of the data that reflect the structure that it was taught," Hayes explained.
The bot has even directly interfaced with Trump's Twitter account.
In those cases, Hayes gives the algorithm language from the real Trump's Tweet, which primes it to give a response that is more likely to be contextually relevant.
With Trump emerging as the undisputed frontrunner in the presidential nomination race, the Republican establishment has mounted a concerted attack on the brash billionaire on and off stage only to have the tables turned on them.
Trump leads the Republican delegate count with 315, according to a CNN estimate.
Cruz is in the second lead with 205, and Rubio with 106.
The winner needs to have the support of a majority of the 2,340 delegates in 50 states.