In my previous posts, I explored the importance of tools in developing AI Agents and discussed how agents can extend the capabilities of LLMs by using external tools. This time, I’m excited to share a real-world example: a Rugby Pundit Agent that I built on a weekend afternoon using the Cursor IDE Composer and CrewAI as an agent framework.
The goal was to ground the last couple of posts in a real world example, use an open-source agent framework and develop some tools to get up-to-date information. This was also a good opportunity to experiment with Cursor's Composer mode to set a project up from scratch.
• Objective: Develop an AI Agent that acts as a group of rugby pundits from different nations to offer perspective on this years tournament.
• Data Source: It gathers the latest news on the Six Nations tournament from a Google search tool.
• Perspectives: The agent simulates pundit opinions from three different perspectives—one each for Ireland, France, and England.
• Outcome: After analyzing the news, the team of agents (or “crew”) collaborates and gives their predictions for the next round of matches.
Rugby is a personal interest of mine, I played a long time ago and now I'm a keen fan. The Six Nations is often referred to as rugby's oldest and greatest tournament and is underway at the moment so it made sense to parody some real pundits and see what an Agent can come up with when given access to the internet.
The primary tools I used were the Cursor IDE and crewAI to create and run the Agent. I also used Google for web search and OpenAI's gpt-4o as the main language model.
Cursor is a new AI code editor that has a build in Agent named Composer that can help kick-start a project. Composer has a chat interface and I was able to outline what I was trying to achieve and watch it automatically create the files I needed. There are some drawbacks that I'll get into below but overall the time I saved by using Composer instead of having to research and write the code myself can't be understated.
Pros:
Cons:
Using crewAI as the orchestration layer and LangChain’s extensive tool integrations, I was able to:
The full code is available here and there are some example snippets below.
Data Retrieval:
I leveraged LangChain tools to fetch the latest rugby news. These tools query real-time APIs and web sources, ensuring that the agent works with current information. Here's a brief snippet of how this can be accomplished:
Agent Design:
The 3 regional agents were created simply using the crewAI Agent class as follows:
Prediction Generation:
After collecting diverse viewpoints, a coordinating agent compiles the opinions and uses simple aggregation algorithms to provide final match predictions. This was achieved by using the crewAI Task class and the host Agent as defined below:
Rapid Prototyping with Cursor IDE:
The entire project was developed in a weekend. Cursor’s features — such as multi-line code completion and intelligent context awareness — helped streamline the process, from setting up the project structure to integrating the tools and debugging in real-time.
If your are not familiar with the Six Nations tournament: there are 5 round which take place over a 7 week period beginning in February. Each team plays each other team only once and so each game is vital to win the tournament.
For some reason, the crew only predicted the result for 2 of the 3 games in Round 3 and is basing it's insights on Round 1 instead of Round 2... even though in the standings table it recognises that the team's have played two games each.
Wales vs Ireland
England vs Scotland
Overall, Agents creating Agents is pretty trivial and can be achieved in a couple of hours. That said, I wouldn't trust this Agent, I didn't write myself and I didn't take the time to go through each line. It's not always right which you can see from the weekly round-up report where there are inconsistencies and inaccuracies in the data.
These issues could likely be resolved with a bit more time and effort but this was a quick side project and I just wasn't bothered so take the report with a grain of salt. Let's see how good this Agent was at predicting the results when the team's take to the pitch this weekend.