Back to projects

Project

Hockey Referee RAG

A retrieval system for hockey rulebook Q&A with cited answers

Hockey Referee RAG preview

A RAG assistant that answers referee questions using the Finnish ice hockey rulebook, with chunking, ranking, and source citations.

Why I built this

I wanted to build a project focused on chunking data for Retrieval Augmented Generation (RAG). I’m also a long-time hockey referee and I hate searching for a specific rule in the rulebook. The rulebook can sometimes be hard to navigate.

This made it the perfect project. Even today, I use this often when searching for a rule. It has been a great investment of my time.

What is Retrieval Augmented Generation? (RAG)

Retrieval-Augmented Generation is a way for an AI to look up information before actually answering a question. RAG was a perfect fit for this project because I didn’t want the AI to answer based on general hockey knowledge. A rule in Finland can be completely different from the rules used in the United States or elsewhere.

In my case, RAG allows the AI to retrieve the relevant rules from the Finnish Ice Hockey Association’s rulebook. Because of this, I never have to wonder, “Does this rule apply the same way in Finland?“ The answer comes from the official rulebook rather than the AI’s general training data. It comes directly from the Finnish ice hockey rulebook.

You can ask questions about ice hockey in natural language

Techstack

This project uses a React frontend and a FastAPI backend. It uses the Gemini API for both the LLM model and the embedding model.

The data chunking is done with LangChain, and the resulting chunks are stored in a ChromaDB vector database.

The application is deployed to Render using a Docker image.