A board game rules assistant — because "just read the rulebook" isn't always helpful at 11pm on game night.
RulesBot answers natural language questions about board game rules using a RAG (Retrieval-Augmented Generation) pipeline. Ask it anything: it retrieves relevant rule passages and generates an answer grounded in the actual text.
This is a starter repo. The UI and infrastructure are built. The retrieval and generation pipeline is yours to implement.
Fork this repo, then clone your fork locally.
python -m venv .venv
source .venv/bin/activate # Mac/Linux
# or: .venv\Scripts\activate # Windowspip install -r requirements.txtNote:
sentence-transformerswill download the embedding model (~80MB) on first run. This only happens once — it's cached locally afterward.
cp .env.example .envOpen .env and replace your_key_here with your key from console.groq.com. No credit card required.
python app.pyRulesBot will start and open in your browser. Before you implement the retrieval pipeline, it will load and display the UI but won't be able to answer questions.
ai201-lab1-rulesbot-starter/
├── app.py # Gradio UI and startup logic — fully built
├── config.py # Settings (models, paths, retrieval params) — fully built
├── ingest.py # Document loading + chunking — TODO: chunk_document()
├── retriever.py # Vector store + semantic search — TODO: embed_and_store(), retrieve()
├── generator.py # LLM response generation — TODO: generate_response()
├── docs/ # Board game rule documents (pre-loaded)
│ ├── catan.txt
│ ├── clue.txt
│ ├── codenames.txt
│ ├── monopoly.txt
│ ├── pandemic.txt
│ ├── risk.txt
│ ├── ticket_to_ride.txt
│ └── uno.txt
├── specs/ # Design documents — start here before writing any code
│ ├── system-design.md # Complete — read this first
│ ├── chunk-document-spec.md # Partial — you complete before Milestone 1
│ ├── retrieve-spec.md # Partial — you complete before Milestone 2
│ └── generate-response-spec.md # Partial — you complete before Milestone 3
└── planning.md # Your observations and reflections — fill in as you go
Before opening any .py file, read specs/system-design.md. It explains what's built, what's left for you, and why the technical decisions were made. Each milestone then begins by completing the corresponding spec file before writing code — that spec becomes the brief you hand to your AI tool when you're ready to implement.
ChromaDB persists to disk in ./chroma_db. If you change your chunking strategy and want to re-ingest, delete that folder and restart the app:
rm -rf chroma_db/ # Mac/Linux
# or: rmdir /s chroma_db # Windows
python app.py| Game | File |
|---|---|
| Catan | docs/catan.txt |
| Clue | docs/clue.txt |
| Codenames | docs/codenames.txt |
| Monopoly | docs/monopoly.txt |
| Pandemic | docs/pandemic.txt |
| Risk | docs/risk.txt |
| Ticket to Ride | docs/ticket_to_ride.txt |
| Uno | docs/uno.txt |