Project Info
Inspiration
The summer before my senior year of high school, I took care of my grandmother before she passed away. She had late stage dementia, so she didn't remember who I was, or much of anything for the fact of the matter. Seeing how that frustrated and scared her led me to this idea. There's so tens of millions of seniors developing alzheimer's and dementia around the world, and as all the money has gone to medication to slow the progress of the illness, not enough thought has been put into how to help them live everyday life.
What it does
Memoria is an agentic AI companion for Alzheimer's patients featuring: Realistic Avatar Interaction - A lifelike avatar that is always on and that patients can talk to naturally, powered by HeyGen and WebRTC streaming Realistic Avatar Interaction - A lifelike avatar that is always on and that patients can talk to naturally, powered by HeyGen and WebRTC streaming Perfect Semantic Memory - Every conversation is analyzed by multiple AI agents. These agents can extract meaningful facts, store them, retrieve similar facts, contact emergency contacts, search for medical advice, etc. Has functionally infinite memory, filters and stores facts worth storing in a database and uses elastic search to access relevant context during live conversations has in built timers that allow Memoria to proactively reach out with reminders (if you tell Memoria you usually take meds at 7pm in normal conversation, it will start reminding you so you don't forget) Perfect Semantic Memory - Every conversation is analyzed by multiple AI agents. These agents can extract meaningful facts, store them, retrieve similar facts, contact emergency contacts, search for medical advice, etc. Has functionally infinite memory, filters and stores facts worth storing in a database and uses elastic search to access relevant context during live conversations has in built timers that allow Memoria to proactively reach out with reminders (if you tell Memoria you usually take meds at 7pm in normal conversation, it will start reminding you so you don't forget) Proactive Safety System - Automatically warns about medication interactions and allergy risks Proactive Safety System - Automatically warns about medication interactions and allergy risks Voice-First Design - No typing or complex apps to navigate—just talk Voice-First Design - No typing or complex apps to navigate—just talk
How we built it
Lots of AI help lol :) Multi-Agent Architecture: Classifier Agent - Determines if information is worth remembering Extraction Agent - Pulls out key facts (names, relationships, medications) Medical Safety Agent - Cross-references allergies and drug interactions Response Agent - Generates warm, patient-centered replies Tech Stack: Frontend: Next.js 15, React 19, TypeScript, TailwindCSS Backend: FastAPI, Python, LangGraph for agentic orchestration AI: GPT-4o-mini, OpenAI TTS, semantic embeddings Memory: Elasticsearch with vector search Avatar: HeyGen LiveAvatar SDK, LiveKit WebRTC
Challenges we ran into
Integrating real-time avatar lip-syncing with custom TTS audio Building a semantic memory system that retrieves relevant context without keyword matching Designing agent coordination so safety checks happen automatically without slowing responses
Accomplishments we're proud of
The avatar feels genuinely present—patients respond to faces better than text Our safety agent caught a simulated allergy interaction in testing Memory retrieval works semantically ("Where does my daughter live?" matches "Sarah moved to Seattle") Our safety agent caught a simulated allergy interaction in testing Memory retrieval works semantically ("Where does my daughter live?" matches "Sarah moved to Seattle")
What we learned
Agentic AI isn't just about calling tools—it's about orchestrating multiple specialized systems Voice interfaces need careful latency optimization Designing for vulnerable users requires extra care around tone and safety
What's next
Proactive check-ins via SMS when patients haven't interacted Caregiver dashboard with conversation summaries and alerts Integration with smart home devices for ambient reminders HIPAA compliance for healthcare deployment
Memoria - Alzheimer's Digital Companion
An intelligent, proactive digital companion for Alzheimer's patients with perfect memory retrieval, medical safety checks, and natural conversational AI through an avatar interface.
🎯 Project Overview
Memoria combines cutting-edge AI technologies to create a compassionate companion that:
- Remembers Everything: Semantic memory storage with Elasticsearch + JINA v3 embeddings
- Conversational Avatar: Natural interaction via HeyGen Streaming Avatar + LiveKit
- Intelligent Reasoning: Multi-turn conversations powered by LangGraph + GPT-4
- Medical Safety: Basic allergy detection and health disclaimer system
🏗 Architecture
┌─────────────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ • HeyGen Streaming Avatar (WebRTC via LiveKit) │
│ • Real-time voice/video interaction │
└─────────────────────┬───────────────────────────────────────┘
│
┌─────────────────────┴───────────────────────────────────────┐
│ Backend API (FastAPI) │
│ • LangGraph orchestrator (multi-turn reasoning) │
│ • WebSocket for streaming responses │
└─────────┬─────────────────┬───────────────────────────────┘
│ │
┌─────▼────┐ ┌────▼─────┐
│Elasticsearch│ │ OpenAI │
│ + JINA v3 │ │ GPT-4 │
│ (Memory) │ │(Reasoning)│
└─────────────┘ └──────────┘
🚀 Quick Start
Prerequisites
- API Keys Required (see
.env.example):- OpenAI API key ($10 credit recommended)
- Elastic Cloud (14-day free trial)
- HeyGen Streaming Avatar ($30/month or trial)
- LiveKit Cloud (50 GB/month free)
Installation
# 1. Clone the repository
git clone <your-repo-url>
cd memoria
# 2. Set up backend
cd server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# 3. Set up frontend
cd ../web
npm install
# 4. Configure environment
cp .env.example .env
# Edit .env with your API keys
# 5. Verify API connectivity
cd ../server
python doctor.py
# Should show: ✓ OpenAI, ✓ Elasticsearch, ✓ HeyGen, ✓ LiveKit
Running Locally
# Terminal 1: Start backend
cd server
uvicorn main:app --reload
# Backend runs on http://localhost:8000
# Terminal 2: Start frontend
cd web
npm run dev
# Frontend runs on http://localhost:3000
Seed Demo Data
cd scripts
python seed_demo_data.py
# Pre-loads demo memories and user profile
📦 Project Structure
memoria/
├── server/ # Python FastAPI backend
│ ├── main.py # FastAPI app entry point
│ ├── doctor.py # API health check
│ ├── orchestrator.py # LangGraph orchestrator
│ ├── services/ # Memory, embeddings services
│ ├── graph/ # LangGraph nodes & state machine
│ ├── models/ # Pydantic models
│ ├── tools/ # LangChain tools
│ └── api/ # Chat & WebSocket endpoints
├── web/ # Next.js frontend
│ ├── pages/ # Next.js pages
│ ├── components/ # React components (Avatar, VoiceInput)
│ ├── hooks/ # Custom hooks (useAvatar, useChat)
│ └── lib/ # API client, WebSocket
├── scripts/ # Utility scripts
├── docs/ # Documentation
└── .env.example # Environment template
🧪 Testing
# Backend tests
cd server
pytest
# Specific test
pytest server/tests/test_memory.py -v
# Frontend type check
cd web
npm run type-check
🎬 Demo Scenarios
1. Memory Retrieval
- You: "What's my daughter's name?"
- Avatar: "Your daughter is Sarah. She lives in Seattle."
2. Learning New Information
- You: "My favorite color is blue"
- Avatar: "Got it! I've noted that your favorite color is blue."
3. Medical Safety
- You: "I have a headache. What should I take?"
- Avatar: "I see you're allergic to aspirin. Please consult your doctor for safe alternatives."
🚢 Deployment
Frontend (Vercel)
cd web
vercel --prod
# Configure environment variables in Vercel dashboard
Backend (Railway/Render)
- Connect GitHub repo to Railway/Render
- Set environment variables (OpenAI, Elastic, etc.)
- Deploy with auto-scaling enabled
See docs/DEPLOYMENT.md for detailed instructions.
📚 Documentation
- ARCHITECTURE.md - System design and components
- API.md - API endpoints and WebSocket protocol
- DEPLOYMENT.md - Production deployment guide
- DEMO_SCRIPT.md - 5-minute demo walkthrough
🛠 Technology Stack
| Category | Technology |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript, TailwindCSS |
| Backend | FastAPI, Python 3.11+ |
| Memory | Elasticsearch Serverless, JINA v3 embeddings |
| Avatar | HeyGen Streaming SDK v2, LiveKit WebRTC |
| AI | LangChain, LangGraph, OpenAI GPT-4o-mini |
| Deployment | Vercel (frontend), Railway/Render (backend) |
🔮 Future Roadmap
- Phase 2: Proactive messaging via SMS/iMessage (Poke integration)
- Phase 4: Web automation for email monitoring and appointment booking
- Phase 6: Monetization with Fetch.ai uAgents and micro-payments
- Production: HIPAA compliance, caregiver dashboard, mobile app
🤝 Contributing
This is a demo project. For production use, additional security, HIPAA compliance, and medical validation are required.
⚠️ Disclaimer
Memoria is a demo application for educational and research purposes. It is NOT a medical device and should not be used for actual medical advice. Always consult healthcare professionals for medical decisions.
📄 License
MIT License - See LICENSE file for details
Built with ❤️ for those affected by Alzheimer's disease
Analysis
View
Metric
No commits on this project resolved to a GitHub account.
Technology
- CSSIn code
- FastAPIIn code
- JavaScriptIn code
- LangChainIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
10 of 10 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
177 KB
Source files
36
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
jason-zhxn/memoria
48 files · 507 KB · @ d006724
Structure
Interface
9 files · 19%Screens, components and styles rendered to the user.
API & routing
10 files · 21%Request entry points: routes, handlers and controllers.
Application logic
7 files · 15%Domain rules, services and shared utilities.
Data & schema
1 file · 2%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript39%
- Python37%
- Markdown16%
- JavaScript7%
- CSS0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
web/package.json
npm · 17- @heygen/liveavatar-web-sdk
- @heygen/streaming-avatar
- axios
- clsx
- livekit-client
- lucide-react
- next
- react
- react-dom
- +8 more
server/requirements.txt
pypi · 16- aiohttp
- elasticsearch
- fastapi
- httpx
- langchain
- langchain-openai
- langgraph
- openai
- pydantic
- pydantic-settings
- pytest
- pytest-asyncio
- python-dotenv
- python-multipart
- uvicorn[standard]
- websockets
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.