Skip to Main Content

Margaret_Dementia Caretaker

Built at The Persistent Context Sprint Hackathon | Live at MongoDB .Local Build Fest · Aug 13, 2026 · San Francisco, CA

Margaret_Dementia Caretaker — Demo video

Margaret — an external memory for a person living with dementia Eleanor is 82. She taught piano for thirty years. She asks the same question forty times a day, and every time she is corrected — "you already asked me that" — she loses a little more confidence in herself. Her daughter Sarah carries the whole of her mother's life in her own head, and can't be there all day. Margaret is a voice-first agent that holds Eleanor's life and hands it back to her whenever she reaches for it. She talks to it naturally, unlimited times. It answers with infinite patience, shows her the photograph she's asking about, notices when she's distressed before she says a word, and learns what actually settles this particular person. Each evening it writes a clinician-ready record for her family and her GP. Sarah fills in one intake form and drops in photographs. A LangChain vision chain reads each one and writes what it means in Eleanor's life, the caption for the screen, the sentence Margaret should say when showing it, and the muddled ways her mother might ask for it. Voyage embeds all of it. It lands in MongoDB Atlas. Her carers log the day — medication, meals, how she seemed. That's what lets Margaret answer "have I had my tablets?" truthfully instead of guessing. Then Eleanor's day begins. The microphone opens and never closes; she never presses anything. When she speaks: Fireworks classifies intent and agitation, Atlas retrieves the right memory by hybrid vector-plus-keyword search with reranking, Claude decides what someone this fragile should hear, and ElevenLabs says it — slowing and steadying as she becomes more distressed. Her camera is read every few seconds for restlessness, so distress with no words still reaches the agent. Every exchange writes back. Whichever comfort strategy was on screen when her mood recovered gets credit, and its effectiveness is rewritten. The garden works. The boat used to and no longer does. It stops reaching for the boat. MongoDB Atlas — the spine Twelve collections on one cluster, margaret_hackathon. No external vector store, no cache. patients · media · image_context · memories · care_notes · routine_checks · interactions · mood_events · comfort_strategies · alerts · reports · traces Atlas Vector Search — 1024-dim cosine over memories and photo contexts, filtered by patient Atlas Search — typo-tolerant keyword, because a speech recogniser mishears "Whitstable" and "donepezil" Hybrid retrieval — both fused with reciprocal rank fusion, weighted toward exact matches, then reranked through MongoDB's reranking endpoint Change Streams — every insert pushes live to the caregiver dashboard over SSE, with resume-token recovery Aggregation $facet — the clinician report is computed in the database: repetition rate, the questions she asked and how often, agitation episodes, the hourly sundowning curve and medication adherence, in one round trip Voyage AI — voyage-4-large through ai.mongodb.com, MongoDB's own endpoint. Embeds every memory and photo context. Its reranker reads each candidate against the question, which is what makes "did the girl come by?" land on Sarah rather than the garden. Claude via OpenRouter — decides every patient-facing sentence under absolute rules: never state a death, never correct her, never say she already asked. A new question goes to Sonnet 5; a repeat goes to Haiku 4.5 and is not re-reasoned — the already-approved answer is re-voiced. Same warmth, a fifth of the tokens. We don't regenerate, we remember. Fireworks AI — the reflexes. A vision model reads her camera every few seconds for restlessness — braced posture, a hand to the head — and a fast model reads every utterance for agitation. Both feed the comfort ladder and the voice. ElevenLabs — the voice, and it changes with her state. Settled: speed 0.88. Distressed: 0.73 with higher stability. The same sentence renders 25% longer when she is frightened, exactly as a carer slows down. LangChain + LangSmith — the intake pipeline that turns a photograph into memory, every call traced.

Team