A RAG App for Old School Runescape: a personal assistant for a childhood game
Building a Retrieval-Augmented Generation app as a personal assistant as I rediscover my favorite game from childhood: Old School RuneScape.
The idea
Old School RuneScape has two decades of accumulated wikis, quest guides, drop tables, and community meta. General-purpose LLMs know the broad strokes but hallucinate confidently on the specifics that matter: exact stat requirements, optimal training routes, item prices, quest prerequisites. The goal is a locally-hosted RAG chatbot that answers OSRS questions backed by the OSRS Wiki, with every answer citing the page it pulled from. Beyond being a fun side project, it doubles as hands-on practice with RAG fundamentals I can carry into my day job as a Data Engineer.
How it works
Two pipelines: a one-time ingestion job and a per-query retrieval loop.
Ingestion pulls page content from the OSRS Wiki through its
public MediaWiki API (no scraping; they expose a clean endpoint),
chunks each page into roughly 400-token segments with a 50-token
overlap so meaning doesn't get cut at boundaries, embeds the chunks
with sentence-transformers, and stores them in a local
Chroma vector DB along with source metadata: page title, URL, and
category (item or quest). The first cut covers items and quests
only, around 2,000 to 3,000 pages, before expanding.
Query embeds the user's question, runs a similarity search against Chroma to pull the top few relevant chunks, assembles a prompt from a system message, the retrieved context, chat history, and the question itself, and sends the whole thing to a local Ollama LLM. The response renders in Streamlit with a "Sources" expander that lists the wiki pages the answer drew from.
Stack
- LLM: Ollama running
llama3locally; swap-ready for a hosted API on deployment - Embeddings:
sentence-transformers, local and free - Vector DB: Chroma, pure-Python and zero setup
- RAG framework: LlamaIndex, less boilerplate than rolling my own
- UI: Streamlit, Python-only and fast to iterate
- Language: Python 3.11+
Constraints
To stay on the free tier, the chatbot is slower than it could be with more powerful models. Furthermore, the wiki I'm pulling from has tens of thousands of pages, and I don't want to embed every single one. The challenge has been knowing which broad categories of pages to embed so the app stays performant and isn't overloaded with context. This is a work in progress; the implementation has largely been trial and error.
Code
Source on GitHub: github.com/rceid/osrs_rag.
Return to main