Inspiration
The inspiration for this project comes from a very specfic problem faced by the owner of Soccer Box Lubbock, Randy. Randy has 60+ soccer teams under him, and he has to schedule them to play over 10 weeks. But, each team has very specific constraints. For instance, Team A cannot play on Mondays, or Team B can only play late games. With the season rules that each team must play exactly 10 games, Randy has to schedule over 300 games, keeping in mind the constraints and preferences of the teams. While he does use a software, the software becomes obselete whenever it is faced with a conflict. This app is designed to solve this problem, while also allowing the admin to perform CRUD (create, read, update, and delete) operations using an appealing interface.
What it does
To put it in simple terms, it allows 60+ teams to communicate with the AI through their constraints and preferences to get the best possible schedule that is fair to all teams. It also does CRUD operations so that the admin is easily able to work with all the teams data.
How we built it
I worked on this project solo. I used round robin algorithm to figure out the matchmaking for all the 10 weeks. I then set up on-demand api calls to send weekly data as a part of the prompt and return a json object with the scheduled games. These games where then displayed on the frontend in a table format. Since it is common knowledge that even the best gpt models can give an inaccurate response, I also implemented a chat feature that would allow the admin to interact with openAI and the database to makes changes as required. Example, "Move Team A vs Team B game to Friday 10:00". This gives control back to the admin. I also used MongoDB to set up the database to store all the teams data as well as the final schedule. I started out with using Supabase, but then switched to MongoDB as I had never tried it before.
Challenges we ran into
The biggest challenge I faced with this project was coming up with a concise, yet descriptive prompt to send for my api call that would get the most accurate response. It had to be as concise as possible because I am sending a fair bit of data back and forth, making the call a very expensive process- interms of both time and cost. Yet, it also had to be descriptive to make sure that the AI understands the project requirements, and gives a very specfic json response. I would not say that the prompt I have right now is the best. The AI still makes mistakes here and there, but the chat box feature is implemented to balance that out.
Accomplishments that we're proud of
I am glad that I was able to figure out the algorithms for matchmaking, for both odd and even teamed divisions. It seemed fairly daunting not having a lot of experience with algorithms, but I liked how it turned out. I am also glad that the chat box feature is also working. It is definitely not perfect, but just the fact that it works for that big of data is a win in itself. It was also really nice to figure it all out by myself, without a team.
What we learned
One of the biggest things I learned was using MongoDB for databases. I had never used it before, so it was cool figure out the basic CRUD operations using it. Another big thing I learned with this project were the limitations of AI. I initially tried to give the entire teams dataset to OpenAI and have it do all the matchmaking and also do the scheduling simultaneously. But going this route, I quickly ran into problems as I realized AI was, in most of the cases, not able to give a response because of amount of data it would have to return. Yet, when modularized, I was able to see that it was able to give accurate responses for week-by-week case. At this point, I saw a need for an algorithm, allowing me to do half of the job programmatically, and letting AI do the job it is good at - making logical decisions.
What's next for Intelligent Scheduler App
The next big thing for the app would be to perfect the AI responses. The responses work and in most cases are vaild json responses, but in a few cases, it still gives a non-json response which throw an error. So coming up with the best possible prompt to give the most accurate response would be nice. In a future version, it would also be possible to open a modal box to see the given constraints on a game, and manually ask GPT to make changes if it was an important constraint.
Built With
- mongodb
- nextjs
- openai
- tailwindcss
- typescript
Log in or sign up for Devpost to join the conversation.