An intelligent AI assistant for The Space Bar adventure game that provides contextual hints.
-
๐ฌ Watch the video to get oriented to Thudbot
-
๐งช Try out Thudbot locally
-
Follow the Quick Start steps below
-
Try these Example Questions
-
Thudbot is an AI-powered player companion for The Space Bar, a cult-classic adventure game from legendary game designer Steve Meretzky.
It provides contextual, spoiler-sensitive hints through an immersive, in-universe interface: the playerโs Personal Digital Assistant (PDA), Zelda.
Designed as a standalone web tool, Thudbot keeps you grounded in the game worldโeven when you need help solving its trickiest puzzles.
Built with LangGraph, FastAPI, and Next.js, Thudbot is a stepping stone toward fully agentic NPCs for the Boffo Games universe.
See Thudbot in action
Not familiar with "The Space Bar" game? No problem! Here are ready-to-test examples:
Q: "Where is the bus token?"
Expected: Thud explains it's in a cup, with character-specific advice
Q: "How do I get the token from the cup?"
Expected: Step-by-step hint about asking Thud for help or looking carefully
Q: "When does the shuttle to Karkas 4 leave?"
Expected: Specific time (22:50) with character commentary about checking monitors
- ๐ฎ Game Hint System: RAG-powered hints for The Space Bar adventure game puzzles
- ๐ก๏ธ Robust Error Handling: Graceful error recovery
- ๐ Web Interface: Next.js frontend
- โก FastAPI Backend: High-performance Python API server
- ๐งช Comprehensive Testing: Robust test suite
# Clone the repo
git clone https://github.com/BQ31X/thudbot.git
cd thudbot
# Add your API keys to .env (copy from .env.example)
cp .env.example .env
# Edit .env with your OPENAI_API_KEY
# Start everything with Docker
cd infra
docker compose up --build
# โจ Thudbot backend now at: http://localhost:8000
- Python 3.13+
- Node.js 20+
# ๐ฆ Clone the repo
git clone https://github.com/BQ31X/thudbot.git
cd thudbot
# Install Python dependencies (backend)
cd apps/backend
uv sync
# Install Node.js dependencies (frontend)
cd ../frontend
npm install
# Return to project root and copy environment template
cd ../..
cp .env.example .env
# Edit .env and add your API keys:
# OPENAI_API_KEY=your_api_key_here
# LANGCHAIN_API_KEY=your_langchain_key_here # Optional: for LangSmith tracing
Terminal 1 - Backend:
cd apps/backend
uv run python -m thudbot_core
Terminal 2 - Frontend:
cd apps/frontend
npm run dev
Access: Open http://localhost:3000
in your browser!
Frontend (Next.js) โ Backend (FastAPI) โ Agent (LangGraph)
Built with:
- Backend: FastAPI + LangChain + OpenAI GPT-4
- Frontend: Next.js + React + Tailwind CSS
- Data: CSV hint database + Qdrant vector store
Data-driven retriever selection using comprehensive evaluation:
- ๐ Full evaluation in:
00_Thud_construction.ipynb
- ๐งช Framework: RAGAS metrics (context recall, entity recall, noise sensitivity)
- ๐ Golden dataset: 12 synthetically generated test queries
- ๐ฅ Platinum dataset: Selected subset of 5 queries, produced by applying a LangChain-based rewriting prompt to the golden dataset, followed by manual selection for evaluation focus and cost control
- โ๏ธ Compared retrievers: Naive, BM25, Multi-query
- ๐ฏ Result: Multi-query retrieval selected based on superior performance
Key findings:
- Multi-query retrieval significantly improved context precision
- Enhanced handling of ambiguous game terminology
- Better retrieval of relevant hints for complex puzzles
See notebook for detailed metrics, comparison tables, and methodology.
Run the comprehensive test suite:
# Run all tests
uv run pytest
# Run tests with the commit script
./check_and_commit.sh "your commit message"
Test coverage includes:
- Data validation (CSV exists & structure)
- Module imports (all components load)
- File organization (required files present)
- Basic functionality verification
Ask about game puzzles:
"How do I get the token from the cup?"
โ "The bus token is in the cup; make sure Thud has it before you hop on the bus."
Get general game help
"When is the shuttle to Karkas 4?"
โ "The shuttle to Karkas 4 departs at 22:50."
thudbot2/
โโโ apps/
โ โโโ backend/ # Python FastAPI backend
โ โ โโโ thudbot_core/ # Core application code
โ โ โ โโโ *_node.py # LangGraph workflow nodes
โ โ โ โโโ api.py # FastAPI backend server
โ โ โ โโโ langgraph_flow.py # Main workflow orchestration
โ โ โ โโโ state.py # Shared state management
โ โ โโโ data/ # CSV hint database
โ โ โโโ tests/ # Backend test suite
โ โ โโโ pyproject.toml # Python dependencies & config
โ โ โโโ Dockerfile # Backend container image
โ โโโ frontend/ # Next.js frontend
โ โโโ app/ # Next.js app directory
โ โโโ public/ # Static assets (PDA interface)
โ โโโ package.json # Node.js dependencies
โโโ infra/
โ โโโ compose.yml # Docker Compose (default)
โ โโโ compose.prod.yml # Production Docker Compose
โโโ docs/ # Project documentation
โโโ notebooks/ # Jupyter notebooks used for prototype development
โโโ .env # Environment variables (not in git)
โโโ README.md # This file
โโโ check_and_commit.sh # Test runner and commit script
- Make sure
.env
is properly configured with a valid OpenAI key. - Restart both frontend and backend if switching API keys or files.
- Backend logs appear in the terminal where you run
uv run python -m thudbot_core
. - For Docker Compose issues, try
docker compose down
thendocker compose up --build
.
This project is copyrighted and all rights are reserved. Leo DaCosta 2025