AFTERLIGHT: Keeping Family Memories Alive with Open-Weight AI
"We spend so much time building technology that remembers everything about us. But somehow, the stories of the people who mattered most are still the easiest things to lose."
This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 4 — Ghost in the Machine (#hf26challenge, #devchallenge).
-
Targeted Prize Categories:
- 🏆 Overall Winner ($250)
- 🌟 Best Use of Gemma ($200)
- 🚀 Best Use of Render ($200)
🌐 Live Website: https://afterlight-memory-garden.onrender.com/
💻 Source Code: https://github.com/Megh-Shah-08/afterlight
1. 🕊️ What I Built
AFTERLIGHT is a digital memory garden designed to preserve family histories, personal oral stories, beloved recipes, and recollections of loved ones using open-weight AI (Google DeepMind's Gemma) and 100% private local browser storage (IndexedDB).
🕯️
( ) AFTERLIGHT
.-'"""""'-. "People leave.
/' '\ Their stories don't have to."
| MARIGOLD |
| & ANISE | Powered by Gemma Open-Weight AI
\ / Zero-Cloud Privacy | IndexedDB Vault
'-.......-'
⚠️ What AFTERLIGHT Is NOT:
This is NOT a "ghost simulator" or an AI chatbot pretending to speak from beyond the grave as a deceased relative. We believe impersonating the deceased or fabricating personal facts dishonors genuine human grief. AFTERLIGHT treats human memories as sacred testimony: faithful, grounded, structured, and permanent.
Core Experience:
-
The Sanctuary Garden: An atmospheric visual sanctuary featuring deep charcoal (
#090a0f), warm candlelight amber (#f59e0b), and marigold accents (#ea580c). Users can toggle between three views:- Sanctuary Grid: Interactive cards displaying relationship badges, era pills, remembrance excerpts, and thematic tags.
- Timeline Journey: A chronological pathway connecting family milestones across generations.
- Ofrenda Altar View: A three-tiered commemorative display inspired by Día de los Muertos traditions, honoring loved ones with glowing digital shrines.
-
Plant a Memory: A guided memory capture workflow capturing who, when, where, and the authentic story—accompanied by an in-browser voice memo recorder (
MediaRecorderAPI) to capture spoken words. -
Gemma AI Memory Portrait: Deep semantic extraction using Gemma into structured portraits:
- Evocative suggested title honoring the person's character.
- Factual 2-sentence summary.
- Poetic, dignified remembrance tribute passage.
- Respectfully rewritten editorial narrative that preserves facts without embellishment.
- Extracted people, places, events, and a chronological milestone timeline.
- Thematic archetypes (Culinary Heritage, Resilience, Oral Tradition).
- Generational inquiry prompts for future family conversations.
- Ask the Garden: A conversational memory synthesis archivist. Family members can ask natural questions like \"What did Abuela Elena say about the dough bones?\" or \"Tell me about Grandpa Arthur's radio in 1974.\" Gemma retrieves relevant stories from the local vault, answers strictly grounded in preserved memories, and cites clickable source cards.
- Data Sovereignty & Export: 1-click Markdown export (with YAML frontmatter) and full JSON archive backup/restore.
2. 📺 Demo
🌐 Live Deployment:
Experience AFTERLIGHT live on Render right now:
👉 https://afterlight-memory-garden.onrender.com/
Screenshots of the Live Application:
Key Links:
- Live Deployed App: https://afterlight-memory-garden.onrender.com/
- GitHub Repository: https://github.com/Megh-Shah-08/afterlight
- 1-Click Render Blueprint: Deploy on Render
- DevRelay Interactive Session: View Agent Session #1348
Judge & Tester Note: You do not need Ollama installed to test AFTERLIGHT on the deployed link! The live app comes pre-populated with three curated benchmark memories (Abuela Elena's Anise Bread, Grandpa Arthur's Shortwave Radio, and The Peat Fire on Inisheer) and instant clickable questions in Ask the Garden. When Ollama is running locally, it seamlessly switches to live open-weight Gemma inference.
3. 💻 Code
The complete source code is open-source under the MIT license:
- Repository: https://github.com/Megh-Shah-08/afterlight
-
Key Modules:
-
src/types/memory.ts: Strict TypeScript interfaces for memories, portraits, and timeline entries. -
src/lib/storage.ts: Client-side IndexedDB persistence engine with JSON import/export and Markdown generation. -
src/lib/ollama.ts: Ollama connectivity detector and model router. -
src/app/api/ollama/status/route.ts: Real-time probe to detect installed Gemma models. -
src/app/api/ollama/portrait/route.ts: Structured JSON extraction prompt enforcing zero-hallucination. -
src/app/api/ollama/ask/route.ts: Retrieval-augmented memory answering strictly grounded in source stories. -
render.yaml: Official Render Blueprint specification for zero-config production deployment.
-
4. 🏗️ How I Built It
flowchart TD
User([User / Family Historian]) -->|Writes story or records voice| Capture[Plant a Memory Experience]
Capture -->|1. Immediate Save| IDB[(IndexedDB Local Vault)]
Capture -->|2. Structured Request| APIRoute[Next.js API: /api/ollama/portrait]
subgraph Local Inference Layer
APIRoute -->|HTTP POST :11434| Ollama[Local Ollama Engine]
Ollama -->|Gemma 3:4b / Gemma 2:2b| GemmaModel[Gemma Open-Weight Weights]
GemmaModel -->|Strict JSON Schema| APIRoute
end
subgraph Fallback / Demo Engine
APIRoute -.->|If Ollama offline| LocalEngine[Local Heuristic Synthesizer]
LocalEngine -.->|Immediate Preview| APIRoute
end
APIRoute -->|Memory Portrait| IDB
IDB -->|Renders| Garden[The Garden Dashboard]
IDB -->|Renders| Detail[Portrait Detail Modal]
User -->|Ask Question| AskGarden[Ask the Garden]
AskGarden -->|Retrieve Relevant Stories| APIRouteAsk[Next.js API: /api/ollama/ask]
APIRouteAsk -->|Strictly Grounded Prompt| Ollama
Ollama -->|Synthesized Answer + Citations| AskGarden
Architectural Decisions:
- Next.js 14 App Router: High performance React server and client components, strict TypeScript compilation, and optimized bundle sizes.
- IndexedDB Local Persistence: Eliminates external database lock-in. Stories are permanently saved in the user's browser, surviving refreshes without any cloud database credentials.
-
Structured Open-Weight Inference: Gemma is invoked via Ollama with strict instruction parameters (
temperature: 0.2,format: \"json\"). The prompt explicitly forbids inventing biographical details, dates, or quotations not present in the authentic story. - Retrieval-Augmented Grounding: In Ask the Garden, queries are matched against local memory tokens. Only candidate memories are passed into the context window. The system prompt instructs Gemma to respond with explicit honesty if a detail was never recorded.
5. 🧠 Why Does Open Innovation Matter?
DEV Hacktoberfest Week 4 asks: \"Why does open innovation matter for what you built?\"
1. Privacy for Sacred Human Stories
Family histories contain sensitive vulnerabilities: illnesses, historical hardships, regional dialects, and personal grief. Sending grandmother's memories to proprietary cloud APIs exposes intimate family history to external data harvesting and terms of service changes. Running Gemma locally via Ollama ensures your family memories never leave your machine.
2. Dignity & Anti-Hallucination
Generic commercial LLMs are often tuned to be sycophantic or creative to a fault, happily inventing biographical facts. Gemma's strong instruction-following capability allows AFTERLIGHT to enforce strict system boundaries:
- Never invent dates.
- Never invent people.
- Unknown information must remain unknown.
3. Permanence: Working with the Lights and Internet Off
If a proprietary AI company goes out of business, your memory companion vanishes. With open-weight Gemma running on local hardware, AFTERLIGHT works on an airplane, in a remote cabin, or thirty years from now when current cloud companies no longer exist.
6. 🤖 My Agent Session
This project was designed, built, tested, and shipped using Google Antigravity and DevRelay:
(Interactive session: dev.to/agent_sessions/building-afterlight-open-weight-ai-memory-garden-for-hacktoberfest-week-4-l7e3el)
7. 🕯️ The Spirit of It
Week 4 of Hacktoberfest brings together Halloween (October 31) and Día de los Muertos (November 1 & 2).
In traditional Mexican culture, the Day of the Dead is not a somber or frightening occasion. It is an act of joyful, tender remembrance. Families build ofrendas, scatter marigold petals (cempasúchil) whose scent guides the spirits home, and lay out the favorite foods, songs, and laughter of those who walked ahead of us.
AFTERLIGHT was born from this exact spirit. We do not need AI to simulate the voices of the dead or generate eerie synthetic illusions. What we need is technology that helps us slow down, honor the stories we were trusted with, and ensure that when people leave, their wisdom and love remain glowing in the afterlight.
8. 🏆 Prize Categories
- Overall Winner ($250): An end-to-end, emotionally resonant, highly original application embodying the \"Ghost in the Machine\" prompt through memory preservation and Día de los Muertos remembrance.
- Best Use of Gemma ($200): Deep open-weight integration using Gemma (3:4b / 2:2b) for structured entity extraction, editorial remembrance generation, and strictly grounded conversational search.
-
Best Use of Render ($200): Production-ready Next.js application with an official
render.yamlBlueprint specification, automated health checks, and live cloud deployment on Render at https://afterlight-memory-garden.onrender.com/.


Top comments (1)
For a family-memory system, provenance is part of the product, not just a backend concern. Every generated recollection should distinguish quoted source material, inferred connections, and unknowns—and let the family correct or hide each one. That protects against a warm interface turning uncertain reconstruction into false family history.