βοΈ Also known as Nicole or Object-10
- β¨ Overview
- π¬ Launching Process
- π Project Structure
- π₯οΈ HTML Pages
- βοΈ Core Scripts
- π¨ Assets
- πΎ Memory System
- π οΈ Settings & Customization
- π Notes
- πΈ Screenshots
DigitalWife is a browser-based virtual companion built around:
- Local LLM (via Ollama API).
- Chat system with memory and logs.
- A layered sprite system (character, clothes, expressions, places).
- Popup-driven customization for character appearance and technical settings.
- Arduino working robotic parts (in process)
- Download Ollama
brew install ollama # macOS
# curl -fsSL https://ollama.com/install.sh | sh # Debian-based Linux
# https://ollama.com/download/windows # Windows (installer link)- Run Ollama
ollama serve- Download an LLM
ollama pull <model name>- Clone repository, install requirements, run app
git clone https://github.com/HenryLoM/DigitalWife.git
cd ./DigitalWife/
pip install -r backend/requirements.txt
python3 launch.py- Inside the app
- Enter chat page
- Click Settings
- Enter your model name
- Click Save, then start using π
π‘ Prefer using your browser?
Instead of doing
python3 launch.pyfrom step 4, do this:
- Run
cd backend & uvicorn main:app --reload- Go to: http://localhost:8000/frontend/pages/homepage.html
DigitalWife/
β
βββ README.md
βββ LICENSE
βββ .gitignore
βββ favicon.ico
β
βββ frontend/
β βββ pages/
β β βββ homepage.html # Landing page
β β βββ chat.html # Main chat interface
β β βββ log.html # Logs / update notes
| |
β βββ styles/ # Styling
β β βββ chat.css
β β βββ homepage.css
β β βββ log.css
β β
β βββ src/
β β βββ *tag-variables.js # Style variables (tags, HTML & CSS-related)
β β βββ *theme-switcher.js # Light/dark mode toggler
β β βββ arduino-switcher.js # UI toggle for Arduino ON/OFF
β β βββ chat.js # Core AI chat logic
β β βββ customization-popup.js # Appearance customization popup
β β βββ emotion-ai.js # Emotion detector
β β βββ vader-sentiment.js # Sentiment analyzer
β β β
β β βββ controllers/ # Scripts for page working
β β β βββ chat.js
β β β βββ homepage.js
β β β βββ log.js
β β β
β β βββ files/ # Static AI memory & persona
β β β βββ avatar.txt # User data
β β β βββ instructions.txt # System prompt / lore
β β β βββ recollection.txt # AI memory
β β β βββ touching-phrases.txt # Prewritten emotional phrases
β β β
β β βββ modules/ # Logic split into focused modules
β β β βββ emotion-ai-handler.js
β β β βββ interaction-handler.js
β β β βββ theme-handler.js
β β β βββ ui-helper.js
β β β
β β βββ utils/ # Generic helpers
β β β βββ frame-utils.js
β β β βββ memory-utils.js
β β β βββ popup-utils.js
β β β βββ settings-utils.js
β β β
β β βββ api/ # Modules to work with backend
β β β βββ backend-api.js
β β β
β β βββ files/ # Static AI memory & persona
β β βββ avatar.txt # User data
β β βββ instructions.txt # System prompt / lore
β β βββ recollection.txt # AI memory
β β βββ touching-phrases.txt # Prewritten emotional phrases
β β
β βββ media/
β βββ screenshots/... # Demo screenshots
β βββ places/... # Backgrounds (street, park, etc.)
β βββ frame/... # Decorative chat frame
β βββ mini-frame/... # Smaller frame
β βββ nicole/ # Character sprites
β βββ bodies/... # Skin tones
β βββ clothes/... # Clothes & uniforms
β βββ expressions/... # Neutral, happy, angry, sad, etc.
β βββ additional/... # Accessories (headphones, blush, etc.)
β
βββ backend/
β βββ requirements.txt
β βββ db.json
β βββ db_utils.py
β βββ main.py
β
βββ arduino/
β βββ arduino-controller.js # Signal transfer for Arduino
β βββ response-parser.js # Parser for turning responses to commands
- Main interface:
- Left: Chat window (messages).
- Right: Wife sprite (layered images).
- Controls:
- Send message.
- Save / Load / Restart chat.
- Edit instructions, avatar, and memo.
- Customize appearance (popup).
- Technical settings (model, port, overlays).
- Introduction and navigation.
- Notes on updates.
Handles all AI interactions and memory.
-
π Ollama integration (
chatWithOllama)- Connects to local Ollama instance.
- Streams responses with abort support.
-
π¬ Chat workflow (
handleAiResponse)- Builds message payload (instructions, avatar, memory, context).
- Appends user + AI messages to localStorage and memory.
-
π§ Memory management
- Add / update / delete / rewind / refresh messages.
- Save & load chat logs (
.txt). - Trim memory to avoid overload.
-
π οΈ Popup editing
- Edit
instructions,avatar,recollection. - Character counter (700 limit).
- Edit
-
β‘ Tech Details Editor (Settings)
- Edit AI name, model, port.
- Export/import JSON setups (appearance, overlays, settings).
-
ποΈ Appearance state
- Save/restore sprite layers (body, hair, clothes, background).
- Auto-update
appearanceContextfor AI input.
-
βοΈ Message controls
- Refresh β», Delete β», Edit β, Copy β§ per message.
Handles emotion inference based on chat text. This script directly affects which expression sprite is displayed and whether the blush overlay is active.
- βοΈ Uses a rewritten local version of VADER sentiment analysis (
vader-sentiment.js). - π Detects blush state if certain keywords appear (e.g. βblushβ, βawkwardβ, βembarrassedβ, etc).
- β©οΈ Returns both:
- Emotion label (happy, smile, annoyed, angry, sad, neutral).
- Blush flag (true/false).
- π Sentiment thresholds:
β₯ 0.8β happy 2β₯ 0.6β happy 1β₯ 0.5β smile 2β₯ 0.3β smile 1β₯ 0.1β neutralβ₯ -0.2β annoyedβ₯ -0.4β angryβ₯ -0.6β sad
Manages character customization popup.
-
π Opens with
Customizebutton. -
π Two-page navigation:
- Page 0: Clothes, Places, Additional.
- Page 1: Skin Tones, Hairstyles.
-
π¨ Assets defined in lists:
bodiesListβ skin tones.hairListβ multiple styles (lob, long, bob, hime, twin).clothesListβ casual, uniforms, swimwear, intimate.placesListβ home, city, misc.additionalListβ flowers, ribbons, headphones, blush.
-
βοΈ Each selection:
- Updates corresponding localStorage overlay (
clothes-overlay,background, etc.). - Updates
selected*globals +appearanceContext. - Saves to localStorage and database.
- Updates corresponding localStorage overlay (
-
π«· Includes close button and smooth transitions.
- Nicole: Body + hair + clothes + expression layers.
- Backgrounds: Living room, park, cafe, cinema, etc.
- UI Frames: Retro decorative frame images.
- Chat stored in array of
{ index, role, content }. - Index ensures sync between localStorage and memory.
- Supports:
- Save to
.txt. - Load from
.txt. - Export/import full setup (
.json).
- Save to
- Trimmed to avoid overload (
trimLimit). - AI gets the whole context each message, so every change affects the chatting.
- Instructions editor β edit AI personality/system prompt.
- Avatar editor β edit user description.
- Memo editor β edit AI recollection memory.
- Tech Editor β manage AI name, Ollama model, port, overlays.
- Appearance popup β select clothes, hair, place, accessories.
- Requires Ollama running locally (
default port is 11434). - Default model:
"NicoleShelterV1". - Uses localStorage to persist appearance, avatar, and AI memory across sessions.
- Chat controls include refresh, edit, delete, copy for fine-grained conversation control.
β€΄οΈ Return to the π Table of Contents ‴οΈ

