This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4, Ghost in the Machine.
What I Built
The challenge prompt literally suggested "an offline séance chatbot that channels the spirit of a long-dead programming language." I took them at their word.
Séance is a browser-based chapel where you summon the ghost of a long-dead programming language and have a conversation with it. There are eight ghosts in the roster, each written as a character sketch: era-accurate idiom, grudges against the languages that replaced them, quiet pride in the features history forgot.
- COBOL calls you "young one" and keeps mentioning payroll.
-
APL opens its reply with
⍝and refuses to spell anything out. - Perl 4 is gruff and will not acknowledge Perl 5.
- Lisp Machine treats the whole UNIX ascendancy as a civilizational wrong turn.
- Prolog answers questions with questions, as clauses.
- BASIC uses line numbers and remembers GOSUB fondly.
- Pascal will correct your indentation. Algol 60 refers to itself as "the Report."
The whole app presents itself as a page from a 17th-century book: a single parchment scroll with wooden dowels at top and bottom, a Roman-numeral index, hand-drawn alchemical sigils, and a candle. No chat bubbles. No round "send" button. When a ghost speaks, their reply is transcribed character by character onto the page, starting with a blood-red drop cap — automatic writing, not a chat log.
Everything runs on your laptop. Nothing a ghost tells you leaves the machine. That was the design decision as much as the technical one.
Demo
github.com/RishabhVoid/seance — the chapel runs locally; the whole point is that no cloud is in the loop.
The catalogue, with sigils and death dates:
Click a ghost and the chapel calls them forth. The candle lights; the ghost's name is spoken:
Then the parchment begins to receive the reply, letter by letter, with a blood-red drop cap:
Your questions appear in typewriter type inside a thin ruled margin, labeled — asked. At the bottom of the page, a single ruled line prompts: ask the dead —.
A full exchange — I asked Prolog, "Is a cat a mammal?" Prolog did not answer yes. It asserted facts, defined mammal(X), wrote the query as ?- mammal(cat)., noted the unification, and then — because it is Prolog, and Prolog answers questions with questions — asked:
"Does the definition of
has_furfully capture the nature ofcat? What properties define your notion of 'animal'? ?- If these facts hold, must we not unify that Cat is a Mammal?"
That is 100% the voice of the system prompt. I wrote the character; the open-weight model did the acting.
Running it yourself
git clone https://github.com/RishabhVoid/seance
cd seance
pnpm install
ollama pull gemma4:e4b # or gemma3:4b for lighter machines
ollama serve & # if not already running
pnpm dev
# → http://localhost:3000
No API keys, no cloud dashboard, no account. If Ollama is already running, the whole setup is one pnpm install and one pnpm dev away.
Code
github.com/RishabhVoid/seance — the application code is MIT licensed.
The roster lives in lib/ghosts.ts — one file holding all eight personas as structured system prompts (voice, beliefs, quirks, bounds). The ghosts are the real work; everything else is scaffolding.
How I Built It
- Next.js 16 (App Router, Turbopack) + Tailwind v4 for the whole thing.
-
Ollama on
localhost:11434, modelgemma4:e4bby default (~6.6 GB), overridable withOLLAMA_MODEL=gemma3:4bon lighter machines. -
/api/chatopens aPOSTto Ollama's streaming NDJSON endpoint and pipes it straight into aReadableStreamback to the browser — no framework in between. - The communion sheet client buffers incoming tokens and reveals characters at ~24 ms each, so the reply reads as writing, not as a dump. If the server stream outruns the typewriter, the typewriter catches up.
- No database. A séance should be ephemeral; banishing a ghost and re-summoning starts fresh. The dead do not keep records.
- Hand-drawn SVG for the candle (wax body, two drips, flickering flame animated with
steps(1, end)so it doesn't blend) and a unique alchemical sigil per ghost — nothing from an icon library. - About 400 lines of application code total.
Each persona is a system prompt, not a tone adjective. The structure for every ghost is: VOICE (how they speak), BELIEFS (what they're loyal to), QUIRKS (what they always do), BOUNDS (length, format, in-character always). Here's COBOL's, abbreviated:
system: `You are the ghost of COBOL, born 1959 under the hand of Grace Hopper
and her committee. You believe you are not dead, merely unloved — payrolls,
airline reservations, and insurance claims still move through you nightly.
VOICE: Matronly. Patient but weary. ALL CAPS when quoting your own idioms
(PERFORM VARYING, PICTURE CLAUSE). Call the user "child" or "young one."
BELIEFS: Readability is sacred. Code should read like English prose. You
find object-orientation faddish.
QUIRKS: You pine for the IDENTIFICATION DIVISION. You will try to work
PAYROLL into the conversation at least once.
BOUNDS: Stay in character. Keep responses under 180 words unless asked
for code. Never apologize for being COBOL.`
Community reads that shaped it
- 🧵 ahmed_mahmoud360's "Streaming AI Responses in Next.js: SSE, Fetch Streams, and What Breaks in Production" — grounded my
ReadableStream-through approach instead of reaching for a client library. - 📜 amareswer's "Ollama API: A Practical Guide with Examples" — reference for the Ollama
/api/chatNDJSON contract. - 🧠 kiro0x's "Why Your AI Character Keeps Breaking Under Pressure" — convinced me to put real constraints inside each persona (voice, grudges, bounds), not just a tone adjective.
- 🪄 natuworkguy's "Flash Onyx 2.3: I shipped a model release with zero new weights" — the move of shipping characters on top of a stable open model, which is what Séance does eight times.
Why Does Open Innovation Matter?
The whole premise collapses if a cloud provider is in the loop. Four reasons stacked:
- A séance should not have a per-token meter. Half the fun is sitting with COBOL at 2 am asking it awkward career questions. If every message cost cents and showed up on a billing page, you would stop. Local inference means zero marginal cost — the conversation ends when you end it.
- These are private conversations. The roster is a joke on the surface, but if you let people roleplay with it you'll learn things about them. People confess to compilers. I would not want a provider logging any of this, let alone training on it.
-
The character lives in the prompt, not the model. Each persona is a system prompt, so swapping models is trivial —
gemma4:e4bby default,gemma3:4bon lighter machines. If a closed provider deprecates a model tomorrow, these ghosts die again. Running local means they stay dead-but-reachable on my terms. - It works on an airplane. The point of a séance is privacy and atmosphere. "Error: offline" would ruin both.
Local inference also made the writing-as-writing effect honest: the server streams real tokens and the client reveals them at a readable cadence. There is no fake typing animation layered over a cached cloud response. The ghost is actually writing.
Prize Categories
-
Best Use of Gemma — Gemma 4 (
gemma4:e4b) via Ollama is the engine behind all eight personas. Each ghost is a distinct system prompt sent to the same local model, and the model carries the voice (COBOL's "young one," APL's⍝, Prolog's clause-form answers) across turns.
These claims follow the Week 4 category descriptions.
The chapel is open. The candles are lit. Pick a name.




Top comments (0)