{"id":1303,"date":"2025-07-11T10:47:03","date_gmt":"2025-07-11T10:47:03","guid":{"rendered":"https:\/\/www.newsbeep.com\/us\/1303\/"},"modified":"2025-07-11T10:47:03","modified_gmt":"2025-07-11T10:47:03","slug":"how-bet365-cracked-a-gen-ai-conundrum","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/us\/1303\/","title":{"rendered":"How bet365 cracked a gen AI conundrum"},"content":{"rendered":"<p>        \u2018In theory, Gen AI could be useful. In practice, the likelihood of errors was enormous.\u2019<\/p>\n<p>            <img decoding=\"async\" loading=\"lazy\" alt=\"\" src=\".\/media_1b7d06bdf274c012286ee0301283a18e2a15ae74b.jpg?width=750&amp;format=jpg&amp;optimize=medium\" width=\"724\" height=\"482\"\/><\/p>\n<p>Bet365 had a breakthrough by combining metadata tagging and GraphRAG to give gen AI the all-important context it needed.<\/p>\n<p>Like painting the fabled Forth Bridge, code modernisation is a continuous process. Over time, as a platform expands and evolves, the complexity of the modernisation task increases. New features are added, old logic is reworked and legacy systems are patched to meet modern demands.<\/p>\n<p>At a business like bet365, which deploys hundreds of changes a week, keeping pace requires a sustained effort in an environment of growing complexity.<\/p>\n<p>With the emergence of LLMs and generative artificial intelligence (gen AI) we now have the potential to transform this arena by automating refactoring at scale, accelerating documentation and assisting with legacy system interpretation.<\/p>\n<p>However, efforts to make this a reality have been hampered by one critical flaw: context. You can feed an LLM every line of code you\u2019ve ever written, but without the business context, the AI lacks the ability to generate code that\u2019s truly fit for purpose.<\/p>\n<p>That is, until a recent breakthrough changed the game. By utilising a GraphRAG approach, bet365\u2019s Platform Innovation team has unlocked a new standard in scalable, human-aligned code modernisation. Gen AI now has the potential to take on the heavy lifting, while expert engineers step into a new role.<\/p>\n<p>Let\u2019s break it down.<\/p>\n<p>        The code modernisation challenge<\/p>\n<p>At bet365, modernising legacy code is a resource-intensive process that requires consistent effort from a team of dedicated experts. The interconnected nature of our systems means that every change has the potential to have a knock-on effect on other parts of the system. Therefore, developers must manually analyse stored procedures and business logic, making educated guesses about dependencies and potential risks.<\/p>\n<p>With decades of accumulated complexity, we needed a smarter, more scalable approach to understanding and modernising our SQL estate. Given the pace of technological evolution and our continuous system enhancements, it became essential to find a way to streamline the modernisation process while minimising risk.<\/p>\n<p>Finding the solution fit perfectly within the Platform Innovation team\u2019s remit. We are dedicated to exploring, developing and deploying cutting edge technologies that enhance bet365\u2019s operational efficiency and technical capabilities.<\/p>\n<p>Image<\/p>\n<p>                <img decoding=\"async\" loading=\"lazy\" alt=\"\" src=\".\/media_1216787b6524c2797347892f46caa33b718a9bc0f.jpg?width=750&amp;format=jpg&amp;optimize=medium\" width=\"1024\" height=\"683\"\/><\/p>\n<p>Description<\/p>\n<p>Bet365 has its headquarters in Stoke-on-Trent, as well as satellite offices around the world<\/p>\n<p>GenAI\u2019s ability to rapidly ingest complex information and summarise what it\u2019s looking at positioned it as a powerful tool for overcoming the complexity of code modernisation. The idea was to put an AI in front of our codebase and get it to tell us what it does, what it\u2019s connected to and the potential impact of making changes to it.<\/p>\n<p>However, there is a problem. While AI is very fast, it\u2019s not always effective. Yes, it can do things quickly, but it doesn\u2019t always do them well. For example, <a href=\"https:\/\/www.computing.co.uk\/news\/2025\/ai\/bbc-releases-damning-research-on-ai-news-accuracy\" rel=\"nofollow noopener\" target=\"_blank\">a recent BBC report<\/a> highlighted how often AI gets facts wrong when asked to summarise something as simple as a news story. In theory, Gen AI could be useful in helping us to understand our legacy code, but in practice, the likelihood of it making errors was enormous.<\/p>\n<p>This shaped our challenge. To be successful we needed to give the AI context. In essence, we needed a map of how we\u2019ve developed our code since day one, and why we do it in the way we do. But setting out all the context and nuance needed is almost impossible for a human. Even if we could write out the prompt, there isn\u2019t a window large enough to provide all the context needed.<\/p>\n<p>        The solution: Delivering GraphRAG<\/p>\n<p>The breakthrough came when we combined two key techniques: metadata tagging and Graph-based Retrieval-Augmented Generation (GraphRAG).<\/p>\n<p>GraphRAG helps LLMs navigate complex relationships within a dataset. On its own, it provides a map of how elements relate. But it doesn\u2019t explain what any of it means. That\u2019s where metadata tagging is immensely valuable. By enriching our codebase with meta information \u2013 labels that explain the business function, historical reasoning, and system dependencies \u2013 we built a contextual roadmap.<\/p>\n<p>Image<\/p>\n<p>                <img decoding=\"async\" loading=\"lazy\" alt=\"\" src=\".\/media_11d3bc35034e29ec4863301a7767d6a2b403249c1.jpg?width=750&amp;format=jpg&amp;optimize=medium\" width=\"2714\" height=\"1811\"\/><\/p>\n<p>Description<\/p>\n<p>Metadata tagging proved immensely valuable for providing context to gen AI<\/p>\n<p>Using the full breadth of our MS SQL database estate, which spans hundreds of databases, we extracted every stored procedure, function and join to create a living map of the system. The result was a richly contextualised dataset, surfaced through a chatbot interface that allowed us to query the system using natural language.<\/p>\n<p>To build this capability, we parsed every database object into an abstract syntax tree and used Microsoft\u2019s ScriptDOM to extract relevant facts. These were then compiled into a knowledge graph (KG). We enriched this graph with natural language descriptions to make the data more interpretable.<\/p>\n<p>The result was a detailed representation of tables, functions, stored procedures, views, variables and joins, all mapped with their relationships and usage patterns. Finally, we added runtime statistics, including execution counts, CPU time, and physical and logical read metrics.<\/p>\n<p>        A true partner<\/p>\n<p>This implementation transformed AI into a true partner. Instead of feeding it pages of documentation or crafting complex prompts, which would need to provide bespoke context for each inquiry, we could ask simple, natural language questions like, \u201cWhat is this procedure connected to?\u201d or \u201cWhat impact will this change have?\u201d, and the AI would deliver answers grounded in our environment and experience. It reveals the impact, highlights the risk and even suggests the fix.<\/p>\n<p>AI no longer replaces human judgement. It informs it.<\/p>\n<p>We\u2019ve also gone one step further and built a tool developers can use to create a visual representation of the AI generated summary in real-time. The tool renders a 3D model of the code with all its procedures and interdependencies. By refining how AI understands and interacts with our data, we\u2019ve transformed prompt engineering from a bottleneck into a competitive advantage.<\/p>\n<p>Image<\/p>\n<p>                <img decoding=\"async\" loading=\"lazy\" alt=\"\" src=\".\/media_10535f9505a7ddd148d246831eced5cac91478eea.jpg?width=750&amp;format=jpg&amp;optimize=medium\" width=\"2714\" height=\"1811\"\/><\/p>\n<p>Description<\/p>\n<p>Rather than replacing human judgement, AI works with them<\/p>\n<p>The results have been impressive. Our AI can now parse and understand our codebase, providing insights that previously required extensive manual effort. Developers can assess the potential impact of change with much greater accuracy, reducing the likelihood of system failures. What previously took weeks of manual investigation can now be completed in hours, improving both speed and accuracy.<\/p>\n<p>One key application is our data warehouse migration project. Our Data Engineering team is leveraging the visualisation tool to support the migration of our SQL database to the cloud. By building a visual representation of the database, they can see its current design. They can then figure out how to redesign it for the modern cloud environment so that we can leverage all its benefits.<\/p>\n<p>        Next steps and the future of code modernisation<\/p>\n<p>The next step is embedding this intelligence into our QA and design planning. If AI can analyse code before it\u2019s deployed &#8211; highlighting issues, surfacing dependencies, flagging conflicts &#8211; it becomes a form of continuous assurance.<\/p>\n<p>We\u2019re also expanding our approach beyond SQL. The same GraphRAG and tagging principles can be applied to other languages and frameworks, unlocking a scalable, cross-platform modernisation engine.<\/p>\n<p>We\u2019ve proven that with the right blend of human ingenuity and machine intelligence we can transform code modernisation. We\u2019re no longer trying to document the past just to keep up with the future. We\u2019re designing systems that are self-aware, self-explaining, and ultimately, self-improving. For our Platform Innovation team, that\u2019s the real breakthrough. Not just making things faster, but making them smarter.<\/p>\n","protected":false},"excerpt":{"rendered":"\u2018In theory, Gen AI could be useful. In practice, the likelihood of errors was enormous.\u2019 Bet365 had a&hellip;\n","protected":false},"author":2,"featured_media":1304,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[181,1636,191,1637,74],"class_list":{"0":"post-1303","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-computing","8":"tag-artificial-intelligence","9":"tag-bet365","10":"tag-computing","11":"tag-genai","12":"tag-technology"},"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/1303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/comments?post=1303"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/1303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media\/1304"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media?parent=1303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/categories?post=1303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/tags?post=1303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}