Head in hands, eight-year-old Timmy muttered to himself as he tried to beat a robot powered by artificial intelligence at a game of chess.

But this was not an AI showroom or laboratory – this robot was living on a coffee table in a Beijing apartment, along with Timmy.

The first night it came home, Timmy hugged his little robot friend before heading to bed. He doesn't have a name for it – yet.

"It's like a little teacher or a little friend," the boy said, as he showed his mum the next move he was considering on the chess board.

Moments later, the robot chimed in: "Congrats! You win." Round eyes blinking on the screen, it began rearranging the pieces to start a new game as it continued in Mandarin: "I've seen your ability, I will do better next time."

China is embracing AI in its bid to become a tech superpower by 2030.

DeepSeek, the breakthrough Chinese chatbot that caught the world's attention in January, was just the first hint of that ambition.

Money is pouring into AI businesses seeking more capital, fuelling domestic competition. There are more than 4,500 firms developing and selling AI, schools in the capital Beijing are introducing AI courses for primary and secondary students later this year, and universities have increased the number of places available for students studying AI.

"This is an inevitable trend. We will co-exist with AI," said Timmy's mum, Yan Xue. "Children should get to know it as early as possible. We should not reject it."

She is keen for her son to learn both chess and the strategy board game Go – the robot does both, which persuaded her that its $800 price tag was a good investment. Its creators are already planning to add a language tutoring programme.

Perhaps this was what the Chinese Communist Party hoped for when it declared in 2017 that AI would be "the main driving force" of the country's progress. President Xi Jinping is now betting big on it, as a slowing Chinese economy grapples with the blow of tariffs from its biggest trading partner, the United States.

Beijing plans to invest 10tn Chinese yuan ($1.4tn; £1tn) in the next 15 years as it competes with Washington to gain the edge in advanced tech. AI funding got yet another boost at the government's annual political gathering, which is currently under way. This comes on the heels of a 60 billion yuan-AI investment fund created in January, just days after the US further tightened export controls for advanced chips and placed more Chinese firms on a trade blacklist.

But DeepSeek has shown that Chinese companies can overcome these barriers. And that's what has stunned Silicon Valley and industry experts – they did not expect China to catch up so soon.