Chatbot for fantasy football

Hello everyone, I am currently developing a chatbot that assists users in playing fantasy football. For the development of this chatbot, I rely on a platform that contains extensive data on fantasy football, which is updated throughout the season.

The chatbot must be able to answer any questions about the rules of fantasy football and also suggest all the strategies to win, as well as provide all the data the user requests.

To do this, I have access to the following data:

  • A MySQL database with semi-processed data on football players.
  • A comprehensive text document describing all the rules of fantasy football that the bot must implement.

I envisioned the following structure for the chatbot, similar to a router chain:

The first step determines whether the query requires data from the MySQL database or not. This bot is trained with some general knowledge about fantasy football and few-shot learning on when data is needed or not.

If yes, I have a bot that accesses the MySQL database and retrieves a JSON of data based on the user’s query, then returns this JSON. This bot is also equipped with a detailed guide on everything in the database, its purpose, and how it works, so it can retrieve the necessary data.

The final step is the chatbot itself, which answers the user’s question. It’s an OpenAI assistant with a code interpreter, receiving an input JSON if the first step was positive, and a detailed description of fantasy football gameplay, along with many examples of how I would like the responses to be given.

Being new to the world of creating chatbots with LangChain, I wanted to share what I have done so far to gather feedback, and especially advice on how to improve the bot and if this is the right path to take. I would be happy to receive as many tips as possible. I hope I have been thorough in my explanation, and anyone who wants more information can write to me. I would be excited to talk with all of you!

1 Like

Hi! I am also newish to AI agents but have worked on a proper functioning system before.
Some thoughts:

  1. In your first steps you can add to your system prompt a summary of the data contained in your mySQL database, this summary is ideally produced by an LLM. You then ask the LLM to determine if it needs to access the database to provide a comprehensive answer to the user.
  2. What is your strategy to let the LLM choose which MySQL data/tables to access? and also how to structure this SQL request to retrieve the right data?
  3. What happens if the query was incorrect and wrong information from the database was retrieved?