How mhentuniverse/mhent-aisa works
AISA is a private AI companion delivered as a browser SPA and Electron desktop app. Its main user journey is to unlock the sanctuary, select or start a chat, send text, image, or audio input, receive Harmony/Echo replies, and optionally hear them spoken alongside Live2D companions. The README also documents long-term memory, calendar/data connectivity, and vision analysis. Desktop IPC and local chat persistence are visible in the sampled code; several README-described integrations are not sampled, so their links are documented rather than source-verified.
Main entry points: app.js Chat controller · ai-engine.js AI conversation engine · voice.js Voice input and output · live2d-stage.js Live2D stage
Components 23
Sanctuary UI
- Sanctuary SPA
index.html - Passcode access
js/auth.js - Chat controller
js/app.js - Markdown rendering
js/markdown.js
Conversation AI
- AI conversation engine
js/ai-engine.js - Vision analysis
js/vision.js - Cloud AI services
- Local Ollama
Companion Media
- Voice input and output
js/voice.js - Live2D stage
js/live2d-stage.js - Cubism runtime
js/live2d/live2dcubismcore.js - Live2D model assets
assets/live2d-models
Memory and Data
- Long-term memory
js/memory.js - Cloudflare D1
- Calendar data bridge
- Supabase REST
- Local chat files
data/chats
Desktop Runtime
- Local web server
server.js - Desktop bridge
js/desktop-bridge.js - Electron preload
desktop/preload.js - Electron main process
desktop/main.js - Gemini voice engine
desktop/gemini-voice-engine.js
Other components
- Sanctuary user
Connections 25
- Sanctuary user → Sanctuary SPA: opens
README.md - Sanctuary SPA → Passcode access: presents access
js/auth.js - Passcode access → Chat controller: notifies unlock
js/auth.js - Sanctuary user → Chat controller: sends chat
README.md - Chat controller → AI conversation engine: requests replies
js/app.js - AI conversation engine → Cloud AI services: calls cloud models
README.md - AI conversation engine → Local Ollama: falls back locally
js/ai-engine.js - AI conversation engine → Vision analysis: routes image analysis
- Chat controller → Markdown rendering: renders messages
- Chat controller → Long-term memory: adds facts
js/app.js - Long-term memory → Cloudflare D1: syncs memory
README.md - Chat controller → Calendar data bridge: uses schedule data
README.md - Calendar data bridge → Supabase REST: accesses REST API
README.md - Sanctuary user → Voice input and output: speaks or listens
README.md - Voice input and output → Chat controller: submits audio prompt
js/voice.js - Voice input and output → Live2D stage: drives lip sync
js/voice.js - Live2D stage → Cubism runtime: uses runtime
- Live2D stage → Live2D model assets: loads models
js/live2d-stage.js - Voice input and output → Desktop bridge: requests desktop speech
js/voice.js - Desktop bridge → Electron preload: invokes IPC
- Electron preload → Electron main process: dispatches IPC
desktop/preload.js - Electron main process → Gemini voice engine: synthesizes speech
desktop/main.js - Electron main process → Local chat files: writes session logs
desktop/main.js - Sanctuary user → Local web server: opens web edition
server.js - Local web server → Sanctuary SPA: serves application
server.js