跳到正文
DEV Community· TININ AGBOROU·· 3 小時前AI 評分50

Mémoire des Anciens 以本機 AI 保存家庭口述記憶

Mémoire des Anciens: The Grimoire of Souls

AI 導讀

TININ AGBOROU 製作 Mémoire des Anciens,一款可錄製或上載家庭回憶音訊、轉錄內容並生成記憶頁面的本機網頁應用程式。它以 faster-whisper 的 small 模型轉錄,再透過 Ollama 在本機執行 Gemma,整理故事摘要、講述者肖像、人物、地點、日期及引句;音訊、轉錄和記憶頁面均留在本機,並可匯出 Markdown。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Some stories disappear without any noise at all. Nobody decides to lose them. They simply stop being told, and one day they are gone. When those voices go quiet, the memories go with them.

Mémoire des Anciens ("Elders' Memory"), with the subtitle Le Grimoire des Âmes (The Grimoire of Souls), is a small web app for keeping those voices. You record a relative telling a memory, either straight from your browser's microphone or by uploading an audio file (mp3, wav, m4a or webm). The app transcribes what was said, then turns the transcription into a page-souvenir, a memory page with:

  • a summary of the story
  • a portrait of the person telling it
  • the people mentioned
  • the places mentioned
  • the dates mentioned
  • quotes worth keeping, in their own words
  • the original audio, so you can still hear them

All the memories are gathered in the Ofrenda, a gallery of every page-souvenir. The name comes from the altars families build for Día de los Muertos, where people place photos, food and favourite things to honour those who came before. This ofrenda is made of stories and voices instead of marigolds. You can also Exporter (export) everything as Markdown, so your family's memories are plain text files that you own.

I am a computer science and AI student in Togo. On our African continent, and in countries like Togo, many of our stories disappear in very insignificant ways: quietly, without anyone noticing. My grandfather championed our culture and the old traditions. So I built Mémoire des Anciens, a grimoire where a voice can be written down and kept.

The theme asks for a ghost in the machine. Mine isn't spooky. It is the gentle kind: a voice that stays in the machine, so it isn't lost.

Demo

[DEMO VIDEO: https://youtu.be/1TPFicEQ2Ls]

Recording a memory, from the microphone or an audio file:

The recording screen

The page-souvenir that Gemma writes from the transcription:

A generated page-souvenir

The gallery, where every memory is kept:

The gallery of memories

Code

🕯️ Mémoire des Anciens

Préservez les histoires orales de famille : enregistrez (ou téléversez) un proche qui raconte un souvenir l'app le transcrit puis génère une page-souvenir. 100 % local : faster-whisper + Gemma via Ollama aucun appel à un service cloud.

Aperçu

Invoquer un souvenir Page-souvenir Le Cimetière des voix
Invoquer un souvenir Page-souvenir Le Cimetière des voix

Installation

Prérequis : Python 3.11+, Ollama, ffmpeg conseillé.

python -m venv .venv && source .venv/bin/activate   # Windows : .venv\Scripts\activate
pip install -r requirements.txt
ollama pull gemma3

Le modèle Whisper « small » (~480 Mo) se télécharge une seule fois au premier usage ; ensuite tout fonctionne hors ligne.

Lancement

ollama serve                      # si Ollama n'est pas déjà lancé
uvicorn main:app --port 8000      # puis ouvrir http://localhost:8000

Variables optionnelles : OLLAMA_MODEL (défaut gemma3), OLLAMA_URL, WHISPER_MODEL (défaut small).

Utilisation

  1. « Nouveau souvenir » : nom du conteur, parenté, langue, puis micro ou fichier (mp3, wav, m4a…

To run it yourself:

pip install -r requirements.txt
ollama pull gemma3
uvicorn main:app --port 8000

Then open http://localhost:8000.

How I Built It

Everything runs on the machine in front of you.

  • Transcription: faster-whisper with the small model. It is a download of about 480 MB, done once. After that it works fully offline.
  • Understanding: Gemma, served locally by Ollama. The transcription goes to Gemma, which returns the structured page-souvenir (summary, portrait, people, places, dates, quotes).
  • Backend: a FastAPI app, started with uvicorn main:app --port 8000.
  • Frontend: a single static page, static/index.html.
  • Storage: no database. Each memory is one JSON file, ./data/<id>.json, next to its audio file. You can back it up by copying a folder.

The code is organised into small pieces:

main.py                    # FastAPI routes
services/transcription.py  # faster-whisper
services/analysis.py       # Gemma via Ollama
services/storage.py        # JSON + audio on disk
static/index.html          # the frontend
tests/test_app.py          # pytest, with the models mocked

Models and endpoints are set with environment variables: OLLAMA_MODEL, OLLAMA_URL and WHISPER_MODEL. Changing the model needs no code change.

When the model fails. Language models don't always return clean, valid JSON. If Ollama is off, or Gemma answers with invalid JSON (after one retry), the app doesn't throw the memory away. It keeps the raw transcription and shows it. A recording of someone's elder should never be lost because a model had a bad moment.

Tests. The tests use pytest with the models mocked. They check the app logic without downloading Whisper or running Gemma.

Limits. I want to be honest about two of them:

  • Whisper doesn't handle Ewe or Kabiyè, two languages of Togo. For those, the app falls back to language autodetection, and the transcription quality is lower.
  • The browser microphone only works on localhost or over HTTPS. Browsers require that. Uploading a file works either way.

Why Does Open Innovation Matter?

For this project, the open pieces are what make it work.

Family voices are private. An elder telling a story is not training data. With cloud transcription, the recording of their voice, their name and their family's names would all go to a server I don't control. Here the audio, the transcription and the memory pages never leave the machine. Open-weight models make that possible.

It works offline. After the one-time Whisper download, nothing needs the internet. That matters wherever the connection is poor or absent. It also means the app works when a family gathers, and those are the moments when stories get told.

It costs nothing to run. There is no API key, no subscription and no per-minute fee. A project about preserving memory shouldn't be something a family can't afford to keep using.

No service can disappear on it. Memories are meant to last decades. A hosted product can shut down, change its pricing or change its terms. Here the memories are JSON, audio files and Markdown exports in a folder that belongs to the family. Whisper and Gemma weights can be kept on disk.

You can swap the models. Because the model is an environment variable, it can be replaced with another Ollama model or a different Whisper size. And the Ewe and Kabiyè limitation is exactly where this openness matters. I can't fix it with a closed API, but with open models it can be improved.

Future direction

Whisper doesn't handle Ewe or Kabiyè, and these are languages spoken in Togo. The next step is to look at open models that handle them better, or to adapt an open model to them. That would be the true goal of this project: that the elders can speak in the language they remember in.

Where open beat closed, concretely. As a student in Togo, a paid speech-to-text API billed per minute, plus an LLM API billed per token, is not something I could keep paying for, and neither could the families I want to record. The internet connection is not always there either. With faster-whisper and Gemma on my own laptop, I recorded, transcribed and generated memory pages with no account, no bill and no connection.

The Spirit of It

The first memory I kept was told by Mama, my great-aunt: "Halloween au Toggo Toggo". Hearing her voice play back next to a page with her words, the people and places she named, and the quotes worth keeping, is exactly what I built this for. Her story now lives in a folder on my machine, not on someone else's server.

Prize Categories

Best Use of Gemma. Gemma is the heart of the project. It reads each transcription and turns it into the page-souvenir: the summary, the portrait, the people, places and dates, and the quotes worth keeping. It runs locally through Ollama, so the stories stay on the family's own computer. The model is configurable through OLLAMA_MODEL, and the app degrades gracefully by keeping the raw transcription if the model is unavailable or returns invalid output.


Thanks for reading. If you have an elder whose voice you want to keep, record them this week.

來源:DEV Community · dev.to