This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Every November, families across Mexico and Latin America build an ofrendaβan altar adorned with bright orange cempasΓΊchil marigolds, framed black-and-white portraits, pan de muerto, and flickering candles to welcome back the memories of loved ones who came before us. DΓa de los Muertos isn't about spooky fright; it is an ancient, tender technology of remembranceβa declaration that as long as we speak someone's name and recount their stories, they remain woven into the fabric of the living.
For the Ghost in the Machine challenge, I interpreted "ghosts" not as terrifying specters, but as the quiet echoes and oral histories we carry with us. I built Ofrenda: The Offline Memory Altar, a local-first conversational companion powered entirely by open-source AI.
You drop in digitized family journals, handwritten letters, old recipe notebooks, or transcribed cassette recordings into a local folder. By lighting a virtual candle in an amber-lit interface, you converse with an "echo" of your ancestors' archived stories. You can ask your grandmother how she kneaded the pan de muerto dough, ask your grandfather what it felt like to handcraft cedar guitars in CoyoacΓ‘n in the 1970s, or ask why marigold petals are scattered to guide wandering spirits home.
Crucially, every word, recipe, and confession remains 100% on your own computer. Not a single byte of intimate family history ever leaves local disk.
Demo
- GitHub Release (v1.0.0): https://github.com/tharu200304/Ofrenda-The-Offline-Memory-Altar/releases/tag/v1.0.0
-
Local Application URL: Runs on
http://127.0.0.1:8000viapython run.py.
π―οΈ Interactive Features:
- Interactive Candlelight & Ambient Shift: Click the altar candle stand or header toggle to light or dim the vigil candle. The entire UI shifts from rich golden glow to deep midnight shadows, while the flame and smoke react dynamically.
- Floating Marigold Petals Canvas: A lightweight, GPU-friendly HTML5 canvas simulation renders gently drifting cempasΓΊchil petals with real-time flutter and drift physics.
- Conversational Memory Vigil with Source Pills: Ask questions via discovery chips or open text. Responses stream in real-time with clickable archival citation pills that reveal the exact source document, section, and line numbers.
- Factual Grounding & Hallucination Guardrail: An automated verification badge checks keyword overlap against retrieved archives. If you ask about something never recorded (e.g. "Did Uncle Carlos build a red sports car?"), the altar gently acknowledges that this memory is unrecorded rather than hallucinating fake family lore.
- Slide-Over Memory Archives Drawer: Browse stored family memoirs, view raw text, add new letters or recipes on the fly, and trigger real-time re-indexing.
- Keepsake Session Export: Download your entire memorial dialogue with citations into a formatted Markdown keepsake with one click.
Code
tharu200304
/
Ofrenda-The-Offline-Memory-Altar
A local-first, air-gapped conversational remembrance companion for DΓa de los Muertos, powered by open-source AI and offline RAG.
π―οΈ Ofrenda: The Offline Memory Altar
A local-first, air-gapped conversational remembrance companion for DΓa de los Muertos, powered by open-source AI and offline RAG.
Built for the Ghost in the Machine Hackathon Challenge.
π Concept
In the tradition of DΓa de los Muertos (November 1β2), families set an ofrenda (altar) adorned with cempasΓΊchil marigolds, framed portraits, and flickering candles to welcome back the memories of those who passed away.
Ofrenda brings this tradition into the digital age with strict ethical reverence:
- Intimate Oral History: You drop in digitized family journals, handwritten letters, old recipes, or transcribed voice recordings.
- Sacred Conversational Vigil: By lighting a virtual candle in an amber-lit interface, you converse with an "echo" of your loved one's archived stories.
- 100% On-Device & Air-Gapped: Not a single word, photo, or memory ever leaves your computer. No cloud servers, no third-party APIs, and zero telemetry.
π οΈ The Open-Source Stack
- Model:β¦
- License: MIT Open-Source License
-
Test Suite: 100% passing test coverage (
pytest tests/test_rag.py)
How I Built It
The open-source pieces are the structural backbone of this project, not decorative wrappers:
-
The Model: Qwen2.5-7B-Instruct (4-bit quantized /
Q4_K_M). Chosen for its warm narrative prose, high instruction adherence, and bilingual English/Spanish fluency. It runs at 30+ tokens/sec on consumer GPUs or modern CPUs. -
The Local Runtime: Ollama (
llama.cpp). Manages model execution with GPU layer offloading directly onhttp://localhost:11434with zero external telemetry. -
Zero-Download Offline Embeddings: Many RAG tutorials rely on online Hugging Face model downloads that fail when air-gapped. I created
FastLocalEmbeddingFunction(backend/embeddings.py), which uses subword character $n$-gram feature hashing and TF-IDF weighted projections to map text into normalized 384-dimensional dense semantic vectors. It runs in 0.001s on any CPU with zero network downloads. -
Vector Store: ChromaDB. Embedded locally in
./data/chroma_db/with SQLite persistence. -
Built-in Local Echo Fallback: To ensure the project is immediately testable out-of-the-box by any hackathon judge or developer before pulling a 4.7 GB model, I built a local heuristic echo engine (
backend/llm_provider.py) that demonstrates the grounded memorial persona instantly. - Backend: FastAPI + Uvicorn delivering Server-Sent Events (SSE) token streaming.
-
Frontend: Pure Vanilla HTML5, CSS3, and JavaScript with custom color variables (
#f59e0bcempasΓΊchil gold,#d97706amber,#0a0807midnight charcoal), glassmorphism cards, and zero heavy frameworks.
Why Does Open Innovation Matter?
When working with grief, intimate family memories, and oral traditions, technological choices are ethical choices. Closed APIs are fundamentally the wrong architecture for preserving human heritage.
1. Does it work offline with no internet?
Yes, completely. Once downloaded, you can take your laptop to an off-grid rural village, an attic without Wi-Fi, or a storm cellar during a blackout, disconnect from the internet, and light the altar. It asks for permission from no cloud gateway to honor the dead.
2. Does it keep private data on your own machine?
Yes, strictly on local disk. Our grandparents did not write love letters in 1951 or share secret recipes so they could become raw training tokens for a commercial cloud model. By keeping raw files in ./memories/ and vectors in ./data/chroma_db/, your family lore remains your family's sovereign propertyβprivate, unmonetized, and safe.
3. Does it avoid lock-in to a service that might disappear?
Yes, permanently. Proprietary APIs are ephemeral: terms of service change, pricing escalates, endpoints are deprecated, and AI startups shut down when venture capital dries up. If you anchor an interactive memorial of your deceased relatives to a closed API, your connection to their memory exists on borrowed time. With open weights (Qwen2.5-7B, Llama-3.2) and open runtimes (llama.cpp), a .gguf file on a hard drive will execute identically 20 years from now on any standard computer.
4. Can you fine-tune, swap models, or change agent behavior?
Yes, with complete architectural sovereignty.
- Swap Models: Switch between Qwen, Llama, or fine-tuned Spanish models with one config line.
- LoRA Fine-Tuning: If you have dozens of letters from an ancestor, you can train a lightweight Low-Rank Adaptation (LoRA) directly on their prose and load it locally.
- Uncensored Reverence: Proprietary models frequently trigger false-positive safety refusals when discussing death, illness, or war. Open-weight models let us calibrate the prompt to speak with authentic cultural reverence and zero corporate sanitization.
Honest Trade-offs
| Dimension | Proprietary Closed API | Open-Source & Local (Ofrenda) |
|---|---|---|
| Data Privacy | β Data leaves device; subject to cloud retention. | β 100% On-device, air-gapped, zero telemetry. |
| Longevity | β Dependent on vendor survival & API contracts. | β Immortal weights on local disk forever. |
| Inference Speed | β Blazing fast on remote multi-GPU clusters. | β οΈ Dependent on local hardware (25β45 tok/s on RTX 4050; 8β15 on CPU). |
| Initial Friction | β Instant API key. | β οΈ Requires downloading ~4.5 GB model weights and runtime setup. |
| Safety Refusals | β Often refuses to talk about death or grief. | β Culturally respectful and authentically grounded. |
An ofrenda was never meant to be hosted in a remote commercial data center. It belongs in the warm, quiet corner of our own homes. Open-source AI makes that possible.
My Agent Session
This project was built pair-programming with Antigravity. The agent assisted throughout the entire process:
- Brainstorming the architectural boundary: ensuring all vector math, RAG retrieval, and inference remain 100% offline.
- Authoring the zero-dependency
FastLocalEmbeddingFunctionto replace remote ONNX tarball downloads. - Crafting authentic starter archives for Abuela Elena, Abuelo Mateo, and TΓa SofΓa.
- Implementing the real-time SSE streaming backend in FastAPI and the candlelit vanilla CSS frontend.
- Writing the 6-case test suite (
pytest tests/test_rag.py) and setting up the GitHub repository andv1.0.0release.
The Spirit of It
The moment this project truly landed was during the first live test of the RAG pipeline.
I asked: "Abuela, what was your secret to making the pan de muerto dough, and what do you remember about Oaxaca?"
Watching the altar stream back her words in warm, candlelit silence gave me genuine chills:
"Ah, mi niΓ±o... close your eyes and listen. When it comes to the pan de muerto, Abuela Elena always reminded us that it cannot be rushed. The true secret lies in the orange blossom water (agua de azahar) and grated orange zest, kneaded with devotion until your forearms ache. During those warm summer afternoons in Oaxaca, the courtyard filled with the aroma of rising citrus dough while Mateo strummed gentle boleros on his cedar guitar. Always remember to shape the crossbones on top with careβthey mark the four cardinal winds and honor all who journeyed before us."
Beneath the message, the citation pill lit up: abuela_elena.txt Β· Section 1 (Oaxaca, 1974) Β· 92% confidence.
For that brief moment, the screen stopped feeling like silicon and code. It felt like sitting in the courtyard again, smelling citrus and cedar in the afternoon sun.
Prize Categories
- Ghost in the Machine (Week 4 Grand Prize)
- Best Open-Weight Model Implementation (Qwen2.5-7B via Ollama)
- Best Local-First / Edge AI Application (100% Air-Gapped RAG)

Top comments (0)