Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

225 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mio

Emotional Companion Agent
Local-first · Multi-axis emotion · Knowledge-graph memory · Plugin architecture

Version Node License Tests

English | 中文


Mio is a privacy-first emotional AI companion that runs entirely on your machine — no cloud, no telemetry, no accounts. It ships with boyfriend/girlfriend personas, a PAD 3D emotional model, OCEAN personality traits that evolve through conversation, and a 3-phase nightly memory consolidation pipeline.

Features

  • PAD 3D Emotion + OCEAN Personality — dimensional emotion model with exponential decay; Big Five traits evolve via experience-to-trait micro-shifts
  • 5-Axis Affinity — warmth, trust, intimacy, patience, tension each tracked independently with frustration streak detection
  • ID-RAG Knowledge Graph — persona defined by a single soul.md; context-aware subgraph retrieval (~800 tokens vs ~1500 full soul)
  • 3-Phase Memory Consolidation — nightly Light→Deep→REM pipeline with ACE quality reflection
  • Plugin Architecture — lifecycle hooks with dependency resolution; 5 built-in emotion plugins
  • 9 LLM Backends — Anthropic, OpenAI, DeepSeek, Moonshot, GLM, MiniMax, Qwen, Doubao, SiliconFlow with auto-detection and fallback chain
  • Crisis Detection — two-tier keyword system (yellow/red) with automatic escalation
  • Zero-Framework Web UI — Canvas emotion-driven avatar, SPA router, WebSocket full-duplex chat
  • Voice — STT (Whisper) + TTS (edge-tts)
  • Notifications — Telegram, Discord, Slack, Webhook

Quick Start

git clone https://github.com/AnxForever/mio.git
cd mio && npm install
MINIMAX_API_KEY="sk-cp-..." MIO_PROVIDER=minimax npm run dev

How It Works

User message → classify intent → update PAD 3D state → update affinity axes
  → retrieve persona context (ID-RAG) → build prompt → LLM inference
  → analyze response signals → update emotion → check ghost/crisis → reply

Nightly: bookmarks scored → top 30% deep-processed → entities written → patterns extracted → memory curated.

Project Structure

src/
├── emotion/      PAD 3D, OCEAN traits, 5-axis affinity, ghost, frustration
├── memory/       3-phase consolidation, ACE reflector, hybrid compression
├── persona/      ID-RAG knowledge graph, dual-mode switching
├── plugins/      Registry + 5 built-in emotion plugins
├── providers/    9 LLM backends + fallback chain
├── server/       Express + WebSocket, auth, analytics, search
├── scheduler/    Nightly pipeline, Poisson-based proactive messaging
└── web/          Zero-framework Canvas SPA

packages/
├── emotion/      @mio/emotion — standalone emotion engine package
└── idrag/        @mio/idrag — standalone knowledge graph package

Providers

Env Variable Provider Model
ANTHROPIC_API_KEY Claude claude-sonnet-4-20250514
OPENAI_API_KEY OpenAI gpt-4o
DEEPSEEK_API_KEY DeepSeek deepseek-chat
MOONSHOT_API_KEY Moonshot / Kimi moonshot-v1-8k
ZHIPU_API_KEY GLM glm-4-flash
MINIMAX_API_KEY MiniMax MiniMax-M3
DASHSCOPE_API_KEY Qwen qwen-plus
DOUBAO_API_KEY Doubao doubao-pro-32k
SILICONFLOW_API_KEY SiliconFlow deepseek-ai/DeepSeek-V3

Commands

npm run build        # tsc + workspace packages
npm run typecheck    # root + workspace typecheck
npm run dev          # REPL
npm test             # 184 checks (core + web view-models)
npm run test:e2e     # Playwright E2E tests

Documentation

Requirements

Node.js ≥ 22 · ESM · One LLM API key

License

MIT © AnxForever

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages