Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine
Most geography games test how well you recognize a place. A street, a building, a road sign, perhaps a landscape.
I wanted to experiment with a different question.
What if, instead of showing someone a photograph of a place, we showed them something that came from that place?
An ancient textile. A traditional musical instrument. A manuscript. An intricately carved doorway.
Could someone trace its origins simply by looking at the artifact?
That question became Origlyph.
Origlyph is a cultural heritage geo-guessing game where players explore artifacts from around the world and attempt to identify their geographical origins. Players drop a pin on an interactive map, submit their guesses, and receive a score based on how close they are to the actual location.
But getting the location right isn't really the point.
The interesting part begins after the guess.
The reveal is where Origlyph differentiates itself from conventional geography games.
Instead of displaying just the correct answer and distance, it introduces the artifact's provenance graph: a network of relationships connecting the object to its makers, geographical origins, historical context, collections, trade routes, and references.
The idea is to turn a simple guessing interaction into an opportunity for exploration.
An artifact is rarely just an isolated object. It carries traces of the people who created it, the communities that preserved it, and the journeys it made across time.
For Week 4, the challenge revolved around the theme Ghost in the Machine, with an opportunity to interpret it through something spooky or through the remembrance and cultural traditions associated with Día de los Muertos.
I chose to approach it through cultural memory.
The concept of an ofrenda is about remembering people through the objects, traditions, and memories they leave behind.
Origlyph takes inspiration from that idea.
Every artifact has a human story embedded within it. The people who made it might be long gone, but their craftsmanship, traditions, and influence continue to exist through the objects they created.
The provenance reveal is designed to make those connections visible.
The ghost isn't necessarily something supernatural. It is the human story that remains inside an object long after its creator is gone.
From an engineering perspective, I wanted Origlyph to remain relatively lightweight while keeping its different components independent.
The application is built around a React frontend, a FastAPI backend, a persistent artifact database, and an optional AI-powered hint layer.
flowchart TD
A[React + Vite + TypeScript] --> B[FastAPI]
B --> C[Game Engine]
B --> D[Artifact Repository]
B --> E[Hint Generation]
B --> F[Provenance Explorer]
C --> G[Distance Scoring]
D --> H[MongoDB Atlas]
E --> I[Deterministic Hints]
E --> J[Gemma]
F --> H
The frontend uses React, Vite, and TypeScript.
Leaflet, alongside OpenStreetMap tiles, powers the geographical guessing interface. This was a deliberate choice: I wanted an interactive map without introducing unnecessary dependence on paid map APIs.
FastAPI handles the application logic and communication between the frontend and data layer.
One of the core mechanics is geographical distance scoring. Once a player submits a guess, the backend calculates the distance between the predicted coordinates and the artifact's actual location using the Haversine formula.
This provides a consistent basis for evaluating guesses regardless of where on the planet the player is guessing.
The initial version uses locally available JSON seed data to keep the core experience functional without requiring external APIs during gameplay.
The data model draws inspiration from open cultural resources such as:
Artifact records retain their source and licensing information, making attribution and traceability part of the data model rather than an afterthought.
MongoDB Atlas provides persistent storage for artifact and provenance records.
I didn't want AI to become a mandatory dependency for something as fundamental as a game hint.
Instead, I approached it as an enhancement layer.
Origlyph uses structured artifact metadata to generate deterministic hints based on attributes such as geographical region, historical period, and material.
Gemma adds a natural-language layer, turning these structured clues into more engaging hints.
This separation has a practical advantage: the application remains playable without model inference.
It also gives the project room to evolve. The hint-generation interface can support different open-weight models without coupling the rest of the application to a particular provider.
The broader engineering principle here is simple:
AI should improve the experience, not become a single point of failure.
For a project centred on cultural preservation, openness felt like a natural architectural choice.
There are four aspects I particularly wanted to explore.
Model flexibility: Gemma sits behind a separate interface, allowing experimentation with different models and inference environments.
Graceful degradation: Deterministic hints keep the gameplay functional even when AI inference is unavailable.
Cost-conscious inference: Short, contextual hints can be cached per artifact, reducing unnecessary model calls.
Data transparency: Cultural records should retain their sources and licensing information. The provenance of the information itself matters just as much as the provenance of the artifact.
This is where the open-source ecosystem becomes more than a collection of tools. It becomes part of the product philosophy.
| Component | Technology |
|---|---|
| Frontend | React, Vite, TypeScript |
| Maps | Leaflet, OpenStreetMap |
| Backend | FastAPI, Python |
| Database | MongoDB Atlas |
| AI | Gemma |
| Hosting | Render |
| Development workflow | DevRelay |
| Optional narration | ElevenLabs |
The most interesting engineering challenge was thinking about how to represent provenance.
A conventional database record can describe an artifact, but its history is more complicated. An object might have multiple creators, uncertain geographical origins, different ownership records, and connections to several historical events.
Representing these relationships in a way that is both technically manageable and understandable to someone playing a game is an interesting problem.
Another consideration was the boundary between AI-generated information and historical facts.
A model can make a hint more natural, but it shouldn't be treated as an authoritative historical source. Keeping structured metadata as the foundation helps maintain that distinction.
Origlyph is an initial exploration of how games and AI can make cultural heritage more approachable.
There are several directions I'd like to take it:
Ultimately, I'd like Origlyph to become more than a guessing game. It could be a way to explore the connections between geography, history, craftsmanship, and culture.
Technology is usually associated with creating something new. But I think it can also help us rediscover things that already exist.
An artifact can outlive its creator, travel across continents, pass through generations, and eventually find its way into a digital archive.
Its story doesn't end when it enters a database.
With Origlyph, I wanted to make those stories something people could actively discover rather than simply scroll past.