Architecture
How this site is built, thinks, and plays, in three diagrams.
This site is three systems wearing one documentation skin: a set of static pages, a retrieval-grounded chatbot, and a reinforcement-learning game. All of it runs on free tiers.
The whole system
The pages are static MDX, built and served by Next.js on Vercel. The AI twin is a Node serverless function on the same deployment; it reads a search index that is built once at deploy time and bundled into the function, so there is no database to run. The game talks to a separate FastAPI service on a Hugging Face Space. Only two calls ever leave your browser: the twin, to Gemini, and the game, to the Space.
How the twin thinks
The twin is hybrid retrieval, not a fine-tuned model. At deploy time the corpus is chunked, indexed for keyword search with BM25, and embedded into vectors. For each question it runs both retrievers, fuses their rankings with Reciprocal Rank Fusion, and hands only the top chunks to Gemini with an instruction to answer from them or decline. Those same chunks are shown to you as a retrieval trace, so every answer is auditable rather than a black box.
How the game plays
The board is a native React component, not an iframe. Each move posts to the FastAPI service, which advances the game engine and asks a PPO policy, one per difficulty tier, where the Wumpus should move. The policy was trained offline with Stable-Baselines3; the Space only runs inference, on CPU.
For the training itself, the reward shaping, and the scent-memory observation, read the Hunter Wumpus deep-dive.