His name is Albert, and he just wants to be your friend.

Another day and we’re one step closer to the Minecraft singularity thanks to players building everything from Atari emulators to working cellphones. And now, thanks to the efforts of builder Onnowhere, Minecraft has its own self-learning chatbot. Forget playing with friends, AlbertAI is a chatty little AI you can talk to using a keyboard interface and learns to talk the more you do.

“I’ve always been interested in artificial intelligence, so naturally I really wanted to make one,” Onnowhere tells me. He’d been messing around in Python and Java, but was drawn to the challenge of building an AI inside of Minecraft. While the room in which you chat with Albert seems clean and simple, it really masks a massive physical computer that determines how he’ll respond to your dialogue.

The secret to this is Minecraft’s command blocks that dramatically expanded the potential for engineering and programming inside of Minecraft. With these blocks, players can execute simple console commands, which is what allows Albert’s responses appear in the chat window like any normal player. More impressive, however, is how Albert knows what to say.

The algorithm is complicated, but it relies on finding the frequencies of letters used in your messages as well as length and the total difference between letters to determine what the response should be. So if you say ‘Hello’ to Albert, he’ll scan his memory bank of responses for ones that closely match that syntax, and then respond. What’s impressive is that the more you speak to him the larger that memory bank grows and the more responses he develops.

These massive towers contain all of Albert’s responses.
“When I began making my first chatbot in Python for fun, I made it a goal of mine not to have it ‘preset’ with responses, because if it’s just responding to things with stuff the creator has already determined, I feel it won’t be as genuine,” Onnowhere says. “Users would probably see a pattern and it would cut off from the uniqueness of the idea. Cleverbot was a big inspiration for the method I came up with, because it learns by talking with users rather than using premade chats.”

That kind of programming already seems complex, but it becomes almost mind-boggling when it has to be done within a physical Minecraft world. For example, text input is stored in wool and clay blocks that are broken down to ‘interpret’ the value of each letter in your sentences. “There is an odd satisfaction one can get out of creating something despite limits,” Onnowhere says.

AlbertAI has been his pet project for almost a year, and while he had the basic concepts nailed down from previous chatbots he made in Java and Python, implementing them in Minecraft wasn’t easy. It only took him a day to build the basic foundation to calculate Albert’s responses, but he tells me that he quickly ran into hurdles. “I had a major issue with lag due to a method I was using to calculate things, and it took quite some time before I came to a solution that could fix it,” he says. “I’m glad it finally worked out though, as I almost didn’t release it due to how slow it ran.”

This is hardly Onnowhere’s most impressive project either. He’s also well known for recreating Redstonia, a city from Telltale’s Minecraft: Story Mode, inside of vanilla Minecraft. So he’s ported a Minecraft city from a non-Minecraft game back into Minecraft. If you’re interested in seeing if AlbertAI passes the Turing Test, you can download it here, and check out Onnowhere’s YouTube channel for more on his other Minecraft projects.

Talk to this self-learning AI chatbot one player built entirely inside of Minecraft