GHOST:只在本機運行的私隱記憶守護工具
GHOST: A Private AI Memory Guardian That Never Leaves Your Computer
GHOST 是在用戶電腦上運行的開源家庭記憶檔案工具,可儲存信件、照片、食譜及口述歷史,並以自然語言搜尋附有來源引用的答案。若檔案中沒有相關記憶,系統會拒絕回答;Ghost Mode 則可將選取的記憶改編成清楚標示的虛構故事。工具使用 Ollama、sentence-transformers 和 faster-whisper,但作者尚未以真實模型驗證答案質素或 CPU 速度,也未完成斷網測試。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Most of the stories in my family exist in exactly one place: somebody's head. Recipes nobody wrote down, how two grandparents met, what a flood felt like in 1983. When that person is gone, so is the story.
GHOST (Generative Human-memory Offline Storytelling & Tracking) is a private memory archive that runs entirely on your own computer. You save letters, photos, recipes and voice recordings, and then you can ask your archive questions in plain language:
"Who taught Lily to knead bread dough?"
and get an answer that points to the exact memory it came from. If the answer isn't in your archive, GHOST says so: "I couldn't find that in your saved memories." It never guesses.
I took "Ghost in the Machine" two ways. The practical one: the archive is the ghost, a place where people live on through their words. The playful one: Ghost Mode turns memories you pick into a clearly labelled spooky story. It shows a "verified facts" panel (copied straight from your archive) next to a list of what the AI invented. There's also a Remembrance setting, which is warm, gentle and has no horror at all. GHOST never claims to contact or speak for anyone who has died, and I wanted that to be built into the design, not just a disclaimer.
Other things it does: record or upload oral histories and transcribe them locally, a timeline with filters, family-history summaries built only from records you select, a passphrase lock, JSON/Markdown/ZIP backups, and a small "Life Documents" section for warranties and important dates with calendar reminders.
Code
Rushindhra
/
ghost-memory-guardian
Private, offline-first family memory archive powered by local open-weight AI (Ollama, sentence-transformers, faster-whisper). Cited answers, oral-history transcription, and respectful Ghost Mode storytelling.
👻 GHOST — Generative Human-memory Offline Storytelling & Tracking
A private memory archive for the stories your family could lose, powered by open-weight AI that runs on your own computer.
Preserve letters, recipes, photographs and oral histories. Ask questions in plain language and get answers that cite the exact memories they came from — or say "I couldn't find that in your saved memories." Nothing is sent to a cloud AI. No account, no telemetry, no vendor to disappear.
Built for the Ghost in the Machine open-source AI challenge. Ghost Mode is an optional, clearly-labelled fiction layer; GHOST never claims to contact or speak for anyone who has died.
Screenshots in docs/img show the real UI on the synthetic demo archive. Where AI text appears (Ask, summary, Ghost Mode) it was produced by a throw-away test stub standing in for Ollama, not by Qwen — the sandbox that built…
How I Built It
The whole point was that the AI had to be open and local, not just mentioned in the README:
-
Language model: Ollama running an open-weight model (default
qwen3:4b, swappable from the Settings page). It runs on CPU, no GPU needed. -
Search:
sentence-transformerswith the multilingualmultilingual-e5-smallmodel, plus a FAISS index, so you can search by meaning and in different languages. -
Speech:
faster-whisperfor local transcription, with the weights stored on disk. - App: FastAPI + SQLite on the back end, React + TypeScript + Vite + Tailwind on the front end.
The part I care about most is how GHOST handles trust. Instead of just asking the model nicely not to make things up, the code enforces it:
- If retrieval doesn't find strong evidence, the model is never even called, and you get the fixed "couldn't find that" reply.
- Every claim must carry a citation like
[1]. Citations that don't point at a real retrieved memory are stripped out. - An answer with no valid citation at all is thrown away.
- Names and years in an answer that don't appear in the sources get flagged for the user.
- If Ollama or a model isn't installed, the app says so and shows setup steps. It never fakes a response.
Checks I actually ran: 46 backend tests and 10 frontend tests pass, and I ran the app in a real browser against a real server (that browser run caught a threading bug the unit tests missed, which I fixed and added a regression test for). On the small synthetic dataset with the keyword-search fallback, all relevant memories showed up in the top 5, and all 5 out-of-archive questions were correctly refused.
What I haven't verified yet (honest bit): I built this in an environment that couldn't download model weights, so I tested the Ollama connection against a stand-in server, not a real model. That means I don't have real-model answer quality or CPU speed numbers, and I haven't run the full "disconnect the internet and try it" test, so I'm not claiming it as proven offline. The repo's docs/STATUS.md lists exactly what was and wasn't checked.
Why Does Open Innovation Matter?
A family archive is about the most private thing there is: voices of people you love, names, illnesses, arguments, forgiveness. A closed API would mean sending all of that to someone else's servers, and trusting that company to still exist and still have the same rules in twenty years.
Open weights changed what was possible here:
- Privacy: the model comes to the data instead of the data going to the model. GHOST's only network address is Ollama on your own machine, and it refuses non-local addresses unless you explicitly allow one.
- Choice: a family can use a tiny model on an old laptop, or a bigger one on a workstation, or one that's better at their heritage language.
- Reproducibility: pinned dependencies, a synthetic dataset and an evaluation script mean anyone can re-run my results, and see what I measured and what I didn't.
- Preservation: the archive is just SQLite and plain files, exportable as JSON or Markdown. It stays readable even if GHOST disappears, and the AI parts can be rebuilt from open models for as long as anyone wants.
來源:DEV Community · dev.to
