Lee Sedol, the best human go player in the world, was supremely confident that he would easily beat his opponent, the A.I.-powered robot AlphaGo. “I think it will be five to zero, or perhaps four to one,” he told the camera, smiling slightly. “I’m going to do my best to protect humans.”

In a Google office building halfway across the world, Sedols opponents were worried. Their creation, a deep learning algorithm designed to bring the full power of mathematical might to the ancient Chinese board game of go, had a bug that could send the program’s entire decision-making process spiraling out of control. And with the showdown with Sedol just days away, it was too late to fix it.

A new documentary, AlphaGo, which premiered at the Tribeca Film Festival on Friday, reveals an inside look at the dramatic competition between Se-Dol and AlphaGo. Director Greg Kohns follows a group of engineers working for Google’s DeepMind program, led by Demis Hassabis, in the build-up to their trip to South Korea to face off against Sedol. He is essentially the Roger Federer of go in the current professional rankings; a slender, quiet man, Sedol is nevertheless treated like a rock star or MVP-worthy athlete in Korea and China, where the game is most popular (60 million people streamed the matches in China alone). Kohns follows along as both Sedol and the men trying to defeat him realize that they are in the middle of a historic leap forward for artificial intelligence.

I covered the contest, which took place from March 8 through 15 of last year, while working the night shift at Inverse. I knew absolutely nothing about go, besides that it was seen as a benchmark for rudimentary A.I. progress, mainly because the game itself is stupidly complicated and requires a combination of creative genius and decades of practice. But the live-streamed matches, which stretched on for close to five hours on back-to-back nights, sucked me in with a combination of live color commentary and exhaustive analysis.

Kohns’ documentary does an even better job of this, capturing moments of levity and career-changing tension behind the scenes in AlphaGo’s war room, where a multi-cultural team of programming nerds tracked win rates. Fan Huei, a 2-dan professional that lost to AlphaGo months before Sedol’s competition and then served as a sort of human mentor to the algorithm, provides some of the film’s most human moments, as his enthusiasm for both the game and AlphaGo shine through in Kohns’ interviews. The director’s camera lingers on Sedol’s face, showing the viewing a portrait of a man who has finally seen something on the other side of the table that he doesn’t fully understand.

AlphaGo beat Sedol decisively, winning four out of the five matches it played. The documentary hinges on two moments, small instances of a single action in a game that often involves 200-400 separate moves. In game two, AlphaGo’s 37th move placed a black tile by itself in an unorthodox, unconventional, and most likely unprecedented place. The move was so strange that the announcers thought it was a mistake by the algorithm’s human proxy (DeepMind engineer Aja Huang).

Sedol, confused and shaken, loses the match, and the next one after that. But the fourth match was different. AlphaGo made an early mistake, and Sedol pushed hard, before pulling off an incredible move of his own. AlphaGo assessed Sedol’s move 78 in game four as a one in 10,000 chance — what players like Fan Huei call a “God Move” — but Sedol said it was the only good move he could see. And it worked, because he won. While AlphaGo didn’t spiral off as badly as its engineers feared, Sedol’s move still managed to cause it enough consternation that it wasn’t able to recover, making more mistakes.

“That’s when I knew I really had a film,” Kohn said during a Q&A following the film’s premiere.

One member of the audience compared it to a boxing match, and it’s not hard to see the punches in the sharp clicks of a tile on the board, the minuscule twitches in Sedol’s face, and the gasps and groans of Hassabis and his team behind the scenes. And remember, Rocky loses in the first film too.