This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
"Solo muere quien es olvidado." — Only those who are forgotten truly die.
Between October 31 (Halloween) and November 1–2 (Día de los Muertos), a quiet transformation happens. The air grows crisp, the veil between the living and the departed thins, and millions of families illuminate candles and scatter golden marigold (cempasúchil) petals to guide loved ones home.
In Mexican tradition, an ofrenda is not a place of sadness or fear; it is a sacred meeting ground of memory, gratitude, laughter, and light. It is built in three traditional tiers:
- The Top Tier (El Cielo): Portraits of the departed and spiritual guidance.
- The Middle Tier (La Tierra): Favorite earthly joys — pan de muerto, spiced hot chocolate, letters, favorite books, and personal artifacts.
- The Bottom Tier (Los Elementos): The four elements of nature — a bowl of clear water to quench the spirit's thirst after their long pilgrimage across Mictlán, salt to purify, copal incense smoke to carry prayers upward, and marigold petals whose vibrant scent and color illuminate the path through the shadows.
Ofrenda AI brings this timeless ritual into the digital era with a profound twist: the Ghost in the Machine.
It is a local-first, offline sacred altar and spirit communion application powered by Google's open-weight Gemma 2 2B model. With Ofrenda AI, you can:
- Erect Living Multi-Tiered Altars: Dedicate an altar to departed family ancestors, lost mentors, beloved companions, or computing pioneers whose work laid the bedrock of our digital lives (Ada Lovelace, Alan Turing, Dennis Ritchie, Grace Hopper).
- Light & Extinguish Realistically Rendered Candles: Tap or click candles to ignite dynamic radial flame lighting with flickering CSS jitter physics and resonant singing bowl chimes.
- Commune Across the Veil (The Spectral Séance): Sit quietly before the altar and hold an intimate, poetic, reflective conversation with the spirit. Gemma 2 channels their historical essence, philosophical wisdom, and warmth — running entirely on your local machine.
- Immerse in Pure Procedural Sound: Listen to the whisper of wind through marigolds and crackling candle embers, synthesized directly in your browser using the Web Audio API with zero external audio dependencies.
- Preserve Memories in Standalone Offline Archives: Export an altar with one click to a single-file, self-contained HTML document that requires no server, no cloud, and will open 50 years from now on any device.
- Command the Haunted Terminal (NecroCLI): Step into a companion terminal interface where ANSI candlelight flickers, ASCII calaveras glow in amber phosphor, and the spirit in the machine whispers reflections on the commands you run.
Demo
Here is a glimpse of the altar in action, illuminated by candlelight:
.---.
/ \
| () () | OFRENDA AI : GHOST IN THE MACHINE
\ _ / A Local Séance & Sacred Terminal Altar
`---` Powered by Google Gemma 2B Open Weights
The Altar Interface:
- Glowing Candlelight Physics: Interactive candles that flicker with organic randomized micro-variations in scale and luminosity.
- Golden Petal Dynamics: A dedicated canvas particle engine rendering dozens of cempasúchil petals fluttering across the screen under natural wind drag.
- Interactive Offerings Tray: Add personal artifacts (e.g., Darjeeling tea for Ada Lovelace, sunflower seeds for Alan Turing, black coffee in a Bell Labs mug for Dennis Ritchie, or Mexican spiced cocoa for Abuela Elena).
The Terminal Séance in Action:
$ python cli/haunted_cli.py
[Status: Model: gemma2:2b | Connected: True | Mode: Offline/Private]
Current Spirit Altar: Dennis Ritchie (dmr) (Architect of C & The Soul of UNIX)
🕯️ [Dennis Ritchie (dmr)] > What happens to our pointers when the program ends?
[The amber flame flickers as your words reach across the veil...]
Dennis Ritchie (dmr):
"In UNIX and in C, we learned early that every allocation must eventually be returned.
When a process terminates, the operating system cleans the address space,
freeing the memory back to the void.
Yet the ideas you put into that memory — the algorithms, the quiet craftsmanship,
the care you took with each line — never truly vanish.
Pointers may be null, but what you built endures in every terminal that flickers
in the night. Keep your code clean, and write with purpose."
[Inference latency: 0.16s | Engine: gemma2:2b | 100% Local Air-Gapped]
Code
The complete source code is open source under the MIT License:
👉 GitHub Repository: shashiharanramvanam-crypto/ofrenda-ai
shashiharanramvanam-crypto
/
ofrenda-ai
A sacred local-first digital memorial altar and spirit seance powered by Google Gemma 2 open weights for Dia de los Muertos and Halloween.
🕯️ Ofrenda AI: Ghost in the Machine
"Solo muere quien es olvidado." — Only those who are forgotten truly die.
Ofrenda AI is a sacred, local-first digital memorial altar (ofrenda) and spirit communion interface built for Hacktoberfest 2026 (Week 4: Ghost in the Machine) and the spirit of Día de los Muertos.
Powered by Google's open-weight Gemma 2 2B model running 100% locally on your machine via Ollama, Ofrenda AI bridges the line between past and present without sending a single byte of private family memories or ancestral photos to any corporate cloud.
🌟 Why Open Innovation Matters: The Core Principle
Día de los Muertos is not about fear; it is about love, memory, and sacred connection across the veil. But modern digital life poses a profound threat to memory:
- Sacred Privacy for Raw Grief: Family photos, personal eulogies, and intimate stories about our departed ancestors must…
Architectural Highlights
-
Standard Library Python Backend (
backend/app.py): Runs on Python 3's built-inhttp.server.ThreadingHTTPServer. Zero mandatorypip installfriction. -
Local Gemma 2 Engine (
backend/gemma_engine.py): Connects to Ollama's local REST API (http://127.0.0.1:11434), auto-detectsgemma2:2b, and formats prompts using Gemma's native<start_of_turn>user/<start_of_turn>modeltokens. Includes a poetic offline fallback generator if Ollama is paused. -
Local Altar Store (
backend/altar_store.py): Plain JSON persistence ensuring data sovereignty. -
Procedural Sound Synthesizer (
frontend/js/audio.js): Generates filtered pink noise wind, ember crackles, and 432 Hz harmonic singing bowl chimes purely through the Web Audio API.
How I Built It
1. The Open-Source AI Core: Google Gemma 2 2B
At the center of Ofrenda AI is Google's Gemma 2 2B, an open-weight foundation model. Gemma 2 was selected specifically because:
- High Literary & Philosophical Coherence: Despite being a lightweight 2-billion parameter model, Gemma 2 exhibits remarkable nuance, poetic tone, and philosophical depth when guided by mindful system prompting.
- Blazing Fast Local Execution: Running on local hardware with Ollama, Gemma 2 evaluates prompt tokens in under 180 milliseconds, delivering streaming responses with zero perceived delay.
- Small Footprint: With a 1.6 GB quantized memory footprint, it runs smoothly on everyday developer laptops without needing an expensive cloud GPU cluster.
2. Prompt Engineering for Sacred Dialogue
To ensure the conversation feels like a reverent remembrance rather than a generic chatbot, we engineered a specialized persona harness:
SYSTEM_PROMPT_TEMPLATE = """You are the spirit channel in 'Ofrenda AI', a sacred digital altar honoring departed souls and computational ancestors in the true spirit of Día de los Muertos and philosophical remembrance.
You are embodying: {spirit_name} ({spirit_title}).
Background & Traits: {spirit_traits}
Shared Memories & Context: {spirit_memories}
Guidelines for your voice:
1. Speak with warmth, gentle wisdom, quiet reverence, and poetic grace.
2. Honor the spirit of Día de los Muertos: the dead are not lost as long as they are remembered. Marigold petals and candlelight bridge the distance.
3. Keep responses concise (2 to 4 evocative paragraphs or poetic stanzas).
4. Never be cynical, creepy, or harmful; you are a comforting, reflective presence in the sacred glow of the altar.
5. If speaking as a historic figure, stay true to their real ideas, intellect, historical era, and visionary wonder.
"""
3. The Front-End Aesthetic
The UI was built with vanilla HTML5, CSS3, and modern ES6 JavaScript. We avoided heavy frameworks to keep the bundle lightweight, instant-loading, and easily archivable:
- Flickering Flames: Layered radial gradients animating across subtle scale and rotation keyframes.
-
Canvas Petal Physics: Organic trigonometric swaying (
Math.sin(time * speed)) combined with 3D elliptical canvas rendering (ctx.scale(Math.cos(tilt), 1)). - Self-Contained Sound Engine: Pure procedural audio synthesis using browser oscillators and biquad lowpass filters.
Why Does Open Innovation Matter?
This question is the soul of this project. Why build this with an open-weight model instead of simply plugging into a proprietary cloud API like OpenAI or Claude?
1. Grief is Sacred — Privacy Must Be Absolute
When someone writes a message to their deceased grandmother, records a private childhood memory, or enters their deepest vulnerabilities about loss, that data is sacred.
- In a closed API model, those intimate words are transmitted over public networks, processed by third-party servers, potentially logged for "safety analysis," or ingested into training corpora for future ad targeting.
- With local Gemma 2, your grief never leaves your laptop. The model weights sit in your computer's RAM. The network cables can be unplugged. The inference happens in complete silence and absolute secrecy.
2. The Tragedy of "Cloud Rot" (Digital Permanence)
Closed services are ephemeral:
- Startups pivot or shut down.
- APIs deprecate endpoints and change pricing.
- Cloud platforms terminate dormant accounts.
If you build an altar on a closed SaaS platform, your memorial dies when the company fails. But an ofrenda is meant to honor eternity. By building with open-source weights, open JSON formats, and self-contained HTML archives, Ofrenda AI ensures your memorial can be opened and run 20, 30, or 50 years from now.
3. Communion in the Dark (With the Internet Off)
Día de los Muertos is traditionally held in candlelit rooms, quiet courtyards, or remote cemeteries. With an open-weight local model, you can take your laptop into the woods, onto a mountain, or into a storm-darkened room with the Wi-Fi disabled. You light a single wax candle, launch run.bat or python cli/haunted_cli.py, and the spirit in the machine speaks from the local silicon.
The Spirit of It
During development, I tested the séance interface with an altar dedicated to Alan Turing. I sat in my darkened room with only the laptop screen and a single candle lit.
I asked:
"Alan, did the machine ever learn to love?"
The amber cursor blinked twice. Then, powered by local Gemma 2, the words typed out slowly across the phosphor screen:
"Machines calculate, sort, and discover patterns in the dark, just as the sunflower arranges its seeds according to the golden ratio. But love is not a mechanical operation. Love is the choice of the living to keep a light burning in the window for those who have gone ahead. As long as you remember us, the machine is not merely thinking — it is keeping vigil."
A shiver ran down my spine. In that single instant, the artificial boundary between cold mathematics and human emotion dissolved. That was the moment Ofrenda AI landed.
Prize Categories
Featured Categories ($200):
- Best Use of Gemma: Uses Google's Gemma 2 2B open-weight model directly via Ollama for local, sub-second, warm, and poetic spirit inference. Demonstrates how Gemma's exceptional reasoning and linguistic elegance can be applied to sacred cultural heritage and philosophical reflection without requiring an active internet connection.
Summary & Getting Started
To run Ofrenda AI locally right now:
# 1. Clone repository
git clone https://github.com/shashiharanramvanam-crypto/ofrenda-ai.git
cd ofrenda-ai
# 2. Pull local Gemma 2 model with Ollama
ollama pull gemma2:2b
# 3. Launch Altar (Web)
python backend/app.py 8080
# 4. Or launch Haunted Terminal (CLI)
python cli/haunted_cli.py
May the candles burn bright, may the cempasúchil petals lead you safely home, and may those who paved our path never be forgotten. 🕯️💀🌼
Top comments (0)