This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 ("Ghost in the Machine").
What I Built
Old cemeteries have no signal and a lot of names. Tour of the Branches is a web app that turns that into a walk through your family tree.
Before you leave home you build a tour pack from WikiTree, the free collaborative family tree: your ancestors, your relatives within a few degrees, or everyone buried in one cemetery. At the cemetery, GPS picks the nearest one, you tap a name, and a small open model, Gemma, tells that person's story using only what their WikiTree profile says. It also says how they are related to you, links back to their profile, and can read the story aloud.
Everything the story needs is already on the phone, so it works with no signal. Gemma writes the stories with Ollama on a laptop, or in the browser on the phone's own graphics chip. Nothing about your family or your location is sent anywhere to be processed.
The ghosts in this machine are real people with sourced profiles. The machine is a model that has to be taught not to make things up about them.
"Genealogy without sources is mythology." (1)
Walking through a cemetery, or a town, and seeing how you are related to the people who are buried or lived there is powerful. Hearing their stories as you pass their headstones, or walk the paths they traveled, turns names into people and gives you a deeper understanding of your family history.
That quote is also the rule this app follows. A story that drifts away from the record is mythology with a nicer voice, so every story here comes from a sourced WikiTree profile, and anything the record doesn't support is thrown away.
Demo
- Try it: Tour of the Branches. "Load the sample pack" works without a WikiTree login and with fictional people. Building a real pack needs a WikiTree login.
Video:
The example I filmed is Molalla Memorial Cemetery in Oregon. I typed its name and the app came back with:
- 47 profiles found in the category,
- 48 profiles in the pack,
- 45 with biographies,
- 46 stories written for the cemetery, every one checked against the record,
- every person named by how they are related to me, where that can be worked out.
Two stones made good examples. Herman Carl Harris (1922–2000) comes out as "your eighth cousin three times removed, through John Cooper (~1612–1689)", and WikiTree's own Relationship Finder gives the same answer. Quinten Wyland (1919–2005) was married twice. His first wife has a WikiTree profile; the second, Betty Lou, lies beside him and had none, so I made one.
Code
Tour of the Branches
Walk a cemetery with your family tree in your pocket. Before you leave home you build a tour pack from WikiTree; at the cemetery GPS picks the nearest place, you tap a name, and a small open model, Gemma, tells that person's story using only what their WikiTree profile says. It also says how they are related to you, links back to their profile, and can read the story aloud. Everything the tour needs is on the phone, so it works with no signal.
Made for the DEV Hacktoberfest Open-Source AI Challenge, Week 4 ("Ghost in the Machine").
- Write-up: Tour of the Branches: a small open model that tells you who is buried around you, with no signal
- Video: Tour of the Branches at Molalla Memorial Cemetery
- Try it: apps.wikitree.com/apps/robinson27225/branch-tour (the sample pack works without a WikiTree login)
Plain JavaScript modules, no build step…
License: MIT.
It is plain JavaScript modules with no build step. About 2.4 MB zipped, including the bundled WebLLM library. 146 tests.
| File | What it does |
|---|---|
src/builder.js |
Builds a pack from the WikiTree API, WikiTree Plus and the category page |
src/kinship.js |
Names the blood relationship between two people from their ancestor lines |
src/narrate.js |
The prompt, the plain-template fallback, the retries, and the checks on what the model wrote |
src/quality.js |
Tells text from a loop of repeated words, for when a model breaks down |
src/webllm.js |
Runs Gemma in the browser |
src/ollama.js |
Setup help for running Gemma through Ollama instead |
src/stories.js |
Saves stories to a file and loads them on another device |
src/nearby.js |
Keeps only the people who rest within a distance of a place |
src/offline.js |
The "is this ready for no signal?" checklist |
src/sort.js |
Orders the people at a stop |
src/voice.js |
Optional ElevenLabs voice, with clips saved on the device |
How I Built It
1. The pack
WikiTree's API returns at most 1,025 profiles per page, and a page that hits that cap says "Maximum number of profiles (1025) reached." I first read that as a hard stop. It is not: the page still carries its profiles, and asking for the next page carries on. Following the pages, my seven-degree family circle comes back whole: 5, 12, 69, 333, 1,154, 2,281 and 4,126 profiles for one to seven degrees, and the full pack (4,032 people, 2.4 MB) builds in about half a minute. A WikiTree community member (Riel) pointed me at paging after I had wrongly told people the limit was a wall.
A cemetery is a different problem: the API cannot list who is in a category. WikiTree Plus can. Its page address only fills in a form, though, and a script then calls a separate search when you press Get profiles. I found the real request by reading that script. Now the app asks Plus who is in the cemetery, reads those profiles through the API, and checks each one's categories, because Plus matches words and not only categories.
Plus also runs a day or more behind WikiTree. Herman Harris and Betty Lou Wyland were both in the cemetery category on WikiTree and missing from the app. So the build also reads the profile links on the category page, adds a spouse who is already in the category, and takes a typed list of WikiTree IDs for anyone else. None of those are trusted: every profile is checked for the category before it is kept.
2. Getting a small model to tell the truth
This is where most of the work went. Gemma is fast and small, and it makes things up. Real examples from my testing:
- Asked about my father's grave, it wrote "a peaceful place to reflect … he's remembered as a father and a man who is now part of this community." The profile says none of that.
- It wrote "He was a father to one child." I had given it the line "Relationship to the visitor: your father" and it invented a count.
- For Benjamin Franklin Noyer it wrote a story that named a "Mary". Nothing in his record has a Mary.
- On my phone, a wrong window setting made it load without any error and then write "John Cook John Cook John Cook…" down the screen, and a column of dashes. My fact checks passed that, because it contained no false facts. It was not language at all.
So the app does not trust the model. It checks twice. First, every story is checked against the record before you see it:
// condensed from src/narrate.js
const FILLER = ['peaceful', 'remembered as', 'beloved', 'part of this community',
'rest in peace', 'legacy', 'will be remembered'];
// a year, a name or place in mid-sentence, a count of children or siblings,
// or a stock phrase: if the record does not say it, the story is refused
export const isGrounded = (text, person, place) => ungroundedWord(text, person, place) === '';
Second, it checks that the text is a story at all: no word repeated four times in a row, no line repeated three times, no column of fragments.
A refusal is not always right, and I had to fix the checks as often as the model. The check refused "November" because the word was not in the record, which only had "1933-11-13", so dates now go to the model as words. It refused "Let" at the start of a sentence. It refused "one of six children" when the biography said "one of 6 children", until I made number words and digits the same number. Each fix made the check more exact and kept it strict about what the record does not say.
When a story is refused, the model gets two more tries, each a little more careful. If all three fail, the app uses a plain narration built from the record alone, and the screen says why and shows what the model wrote. For Molalla's Margaret Luella Bagby the plain version reads, in part: "In 1860, 4 year old Margaret was one of 6 children living on the family farm at Molalla in Clackamas County, Oregon with parents William and Harriet."
Here is a story Gemma wrote through Ollama for Joanna Aileen Barstow: "Here, beside us, rests Joanna Aileen Barstow. She was born on June 25th, 1863, in Stafford, Oregon. Joanna married William Milton Bird in 1881…"
3. Naming the relationship
WikiTree's "N generations" turned out to be the steps up to a shared ancestor and back down. Me to Herman is 12 steps up on my side and 9 on his, which is 21, and which makes him an eighth cousin three times removed. I built kinship.js on that and checked it against WikiTree's own list: eight relatives at Molalla could be traced, and all eight generation counts matched (14, 20, 20, 21, 22, 22, 23, 23). The rest are further out or related by marriage, and the app says "relationship not traced" for them and does not guess.
4. Working with no signal, and where it broke
The app is a service worker plus a few files. Stories and voice clips are saved the first time they are made, and the model weights are downloaded once (about 1 to 2 GB) and kept by the browser.
Testing it in the field showed me what a demo hides. On Chrome for iPhone the app would not reload with no signal, because that browser cannot keep a web app's files for offline use. Safari with Add to Home Screen can. A weak signal is worse than none, because a request can hang for a minute instead of failing, so the service worker now gives up on the network after three seconds and uses its saved copy. A checklist on the Narrator tab ("Ready for no signal?") says what is and is not saved on the device.
Then Gemma itself. On my iPhone, loading it made the page close and reload, twice in a row. I cannot see inside the phone, and the likely cause is memory. So the app now notes which step Gemma is on, and if the page closes during it, pauses Gemma, says which step it was on, and carries on with plain stories and the voice until I turn it back on.
The fix that mattered more: a laptop running Gemma through Ollama writes better stories than the phone can. A button on each place writes every story, saves them to a file, and the phone loads the file. Each loaded story is checked against the record again before it is used. So the phone tells stories Gemma wrote, with no model running on the phone and no signal.
5. The voice
The voice is optional and uses ElevenLabs with your own key. Only the finished story text leaves the device, and each clip is saved so it plays again with no signal. On an iPhone the browser only lets a page start sound during a tap, and a story takes seconds to write, so the app starts a silent sound inside the tap and plays the real clip through that same player later. Everything else stays local.
Why Does Open Innovation Matter?
It works where the signal doesn't. A hosted model is useless in a cemetery in the hills. An open model that runs on your own laptop, or in a browser tab, is not.
It keeps family data private. A pack holds the names, dates, places and relatives of a family, and the app knows where you are standing. With a local model none of that is sent to anyone to be processed.
It can be moved. The same Gemma runs in a phone's browser or through Ollama on a laptop. When the phone's browser could not hold the model, I moved the writing to the laptop and kept the stories. The pack and the checks stayed the same.
It can be checked. Because I run the model myself, I could put my own checks around every sentence it writes, regenerate freely, and throw away what the record does not support. That is much harder to do when every retry has a price.
Where open did not win. The 1B model writes plainer, less fluent stories than I would expect from a large hosted model, I did not benchmark that, and on my phone it sometimes did not fit at all. Fluency was not the hard part, though. Faithfulness was, and that is where owning the model helped. The nicest-sounding part of the app, the voice, is a closed service, which is why it is optional.
My Agent Session
I built this with Claude Code over several days. Things worth saying honestly: the tests and a real browser caught mistakes the agent made (a field named bio that it read as Bio, so every biography was empty; an edit that deleted the Build button's handler while the syntax check still passed; a "write every story" button that stopped the whole run on one refusal). The reading of WikiTree Plus's script, the choice of what to trust, and what to refuse were mine.
The Spirit of It
Día de los Muertos keeps people present by saying their names. A cemetery does the same thing in stone, and a family tree does it in data. This app puts the two together: it says the names out loud, and it says only what is known.
Betty Lou’s story is a good example. At first glance, the Betty beside Quinten looked like the Betty he married in 1940, already attached to his profile. A closer look showed that the first Betty’s birth and death dates don’t match the headstone, and Find a Grave has her buried in a different cemetery under another surname. So who is the Betty buried with Quinten in Molalla? A little research turned up a 1958 marriage record for Quinten (his second marriage) and a Betty Lou Orem. She now has a profile on WikiTree, and the photo of their shared headstone is linked to both of their profiles.
Another example is Robert Churchill, who lived only a day and is remembered with a profile and ancestry on WikiTree
Prize Categories
- Gemma: the model that writes every story, in the browser and through Ollama.
- ElevenLabs: the optional spoken voice, with clips saved for offline.
(1) Schulze, Lorine McGinnis. "Genealogy without Sources is Mythology." Olive Tree Genealogy. Accessed 3 Aug 2023.



Top comments (2)
What a deeply poetic and technically elegant project! Running an open model like Gemma completely offline via local Ollama or on-device mobile hardware to bring sourced cemetery biographies to life solves the zero-signal reality of historic grounds with great ingenuity. Grounding the generation strictly in verified WikiTree profiles protects genealogy from hallucinated myth.
How do you prompt or constrain Gemma to guarantee that it strictly refuses to embellish historical details when genealogical data is sparse?
Thank you for your review and comment!
Short answer: I can't make the prompt guarantee it, so I don't rely on the prompt alone. There are three layers.
The prompt gives Gemma only the facts in the profile (names, dates, places, parents, spouses, a short biography excerpt) and tells it to use only those. It also bans "peaceful", "loved", "remembered as", and any count of children or siblings the record doesn't state. When data is sparse, it just gets less to work with.
Every story is checked before anyone sees it. A year, a name or place, a count of relatives, or a stock phrase that isn't in the record gets the story refused. So does text that isn't language (repeated words, columns of dashes). Real catches from my testing: "a peaceful place to reflect…", "a father to one child", and a wife called "Mary" who isn't in the record.
A refused story gets two more tries, a little cooler each time. If all three fail, the app shows a plain narration built only from the record, says why, and shows what the model wrote.
It isn't a mathematical guarantee. The checks are tuned to catch years, names, places, counts and stock phrases. A mild embellishment in plain words ("she worked hard all her life") could still slip through, and I've also had the check refuse true statements ("six" vs "6") that I had to fix. The sparse case is where it is most likely to pad, which is why the plain fallback exists. The code for the checks is in src/narrate.js if you'd like to look or poke holes: github.com/robinson27225/branch-to...