omax404/Project-Aiko

4

stars

162

commits

Python

primary language

Sep 4, 2026

updated

anime
llm
project
waifu

README

Aiko Banner

Aiko Desktop

Aiko Dashboard Showcase

License: MIT Python 3.10 - 3.12 Architecture: Tier-0 Tests: 108 Passed Last Commit Repo Size

Join Discord   Quick Start   Wiki   Star this Repo


Self-hosted, user-owned AI companion with emotional depth, long-term memory, and real agency.
She doesn't just chat — she thinks, feels, remembers, sees, speaks, and acts.


⚡ Quick Start

For Users (Windows, No Setup Required)

  1. Download or clone Project Aiko to your machine.
  2. Double-click LAUNCH_AIKO.bat.
  3. Wait for her to wake up — the application bootstraps the virtual environment and launches the desktop interface automatically.

Once the dashboard appears, click the gear icon (Settings) in the top right:

  • Persona — Customize personality traits, prompts, or dynamic mood baselines.
  • AI Model — Seamlessly switch between local Ollama, OpenRouter, Gemini, OpenAI, Anthropic, or custom endpoints.
  • Voice — Enable local Pocket-TTS speech, customize pitch, or adjust voice cloning profiles.
  • Plugins — Toggle Discord, Telegram, Twitch, or PC Bridge integrations.

Hit Save & Apply — changes take effect instantly.


For Developers

# 1. Clone repository
git clone https://github.com/omax404/Project-Aiko.git
cd Project-Aiko

# 2. Setup Python environment (3.10–3.12)
python -m venv .venv
.\.venv\Scripts\activate  # On Windows (or source .venv/bin/activate on Unix)
pip install -r requirements.txt

# 3. Launch full stack
python launch.py

This starts the Neural Hub (port 8000), connects configured satellites (Discord/Telegram/Twitch), and opens the native Tauri desktop overlay.

To run or build the desktop UI separately:

cd aiko-app
npm install
npm run dev           # Vite web dev server
npm run tauri dev     # Native desktop window with Live2D
npm run build         # Production frontend bundle
npm test              # Run Vitest test suite

💎 What Makes Aiko Different

CapabilityMost AI CompanionsProject Aiko (Tier-0)
EmotionsStatic personality promptNeuromodulator engine (dopamine, serotonin, cortisol, adrenaline) across 22+ emotional attractors
MemoryEphemeral chat bufferUnified Memory — episodic recall, semantic RAG, consolidation cycles, and encrypted file partitions
VoiceCloud API (ElevenLabs)High-fidelity local Pocket-TTS with voice fingerprints, chunked synthesis, and 0 API cost
VisionNoneNon-blocking multimodal vision (moondream:latest, MiniCPM-V) running offloaded at 7.6ms loop latency
AgencyReactive onlyAutonomous proactive loop — decides when to speak, observe, reflect, and consolidate memories
Safety & ControlBlind execution / NoneStrict Zero-Trust Human-in-the-Loop (HITL) permission gate with no admin bypasses
Contracts & TypesLoosely typed / anyUltra-strict TypeScript (noUncheckedIndexedAccess: true), Zod client schemas, Pydantic v2 ingress
GamesNone or static mocksExtensible GameBridge & GameManager architecture for live server integrations (RCON/WebSockets)
Mobile SyncWeb view wrapperNative Android (Kotlin, Jetpack Compose, Room DB, GLES 2.0 Live2D, WebRTC real-time sync)

🧠 Core Systems

🧠 Brain & Reasoning

  • ReAct agent loop with multi-step reasoning, self-correction, and tool execution.
  • Multi-provider streaming across Ollama (gemma4:31b-cloud), OpenRouter, Gemini, OpenAI, Anthropic.
  • Dual-pass generation: factual draft pass followed by personality overlay.
  • Context-aware rolling conversation windows with automated summarization.

👁️ Multimodal Vision

  • Non-blocking screen analysis via asyncio.to_thread — pixel diffing and PNG compression never stall the event loop.
  • Local visual understanding via moondream:latest or MiniCPM-V.
  • Discord image analysis, automated screen inspection, and coordinate grid targeting.

👂 Hearing & Audio

  • Local Moonshine ASR (~200MB) with SpeechRecognition fallback.
  • Client-side voice activity detection (VAD).
  • Discord voice channel transcription.

🎙️ Voice Synthesis

  • Pocket-TTS v2.1.0 (100% local, zero latency, zero cloud API fees).
  • JIT speech stabilization to eliminate hallucinated phonemes.
  • Autonomous action-text (*...*) stripping for natural spoken dialogue.

💾 Unified Memory

  • Multi-tier memory architecture: episodic dialogue history + semantic vector RAG.
  • Background consolidation cycles that distill daily conversations into long-term profile knowledge.
  • Multi-process file locking (.lock) preventing concurrent corruption.

❤️ Emotional & Neuromodulator System

  • Biologically inspired neuromodulator model: dopamine, serotonin, cortisol, adrenaline.
  • 22+ emotion states mapped to dynamic Live2D avatar physics, expressions, and voice inflections.
  • Affection and relationship score tracking (0–100%).

🔌 Plugins & Agency

  • ElizaOS-inspired modular plugin manager with dynamic tool discovery.
  • File system tools, clipboard management, process supervision, and system monitoring.
  • Spotify bridge, Obsidian connector, LaTeX rendering, and image generation.
  • Extensible GameBridge base class and GameManager for connecting to external game engines.

🔒 Zero-Trust Security & Tier-0 Architecture

Project Aiko is engineered to Tier-0 Production Grade security standards. Read the full specification in SECURITY.md.

🛡️ Human-in-the-Loop (HITL) Permission Gate

  • Sensitive actions (OPEN, CLICK, TYPE, PRESS, EMAIL_SEND, and sensitive MCP tools) strictly require user confirmation.
  • When triggered, Aiko sends a tool_request to the client dashboard. The action blocks until the user approves or rejects it in a modal dialog.
  • Zero Admin Bypass: Server-side enforcement guarantees no prompt injection can bypass the confirmation gate, even with administrative tokens.

🔑 Local Zero-Trust Token Lifecycle

  • Aiko issues rotating 24-hour HMAC-SHA256 JWT Bearer tokens to loopback clients.
  • Remote IPs requesting tokens are rejected with 403 Forbidden.
  • Sensitive credentials (OPENAI_API_KEY, DISCORD_TOKEN, etc.) are automatically masked (...***) on all settings endpoints.

📐 End-to-End Typed Contracts

  • Client (Zod): Ingress events and WebSocket payloads are validated against strict Zod schemas (schemas.ts).
  • Server (Pydantic v2): API routes and WebSocket frames are checked against Pydantic models (schemas.py).
  • Ultra-Strict TypeScript: Desktop client compiles with "strict": true and "noUncheckedIndexedAccess": true.

⚡ Event-Loop Latency & Re-Render Isolation

  • Backend Non-Blocking I/O: Screen diffing, PNG compression, and SQLite logging run in thread pools via asyncio.to_thread. Event-loop latency averages 7.60ms (15.63ms p95).
  • Frontend Isolation: Message bubbles are wrapped in React.memo with granular Zustand selectors. Top-level window re-renders drop to 0 during voice playback.

📱 Platforms & Satellites

PlatformTypeStatusFeatures
Tauri Desktop AppNative DesktopLive2D avatar, click-through overlay, global hotkey (Ctrl+Alt+A), dashboard stats
Android Mobile AppNative KotlinJetpack Compose, Room DB, GLES 2.0 Live2D, WebRTC real-time sync
Discord BotSatelliteSelf-healing gateway, voice chat transcription, image recognition
Telegram BotSatelliteDirect messaging, Bearer token loopback auth with auto-retry
Twitch BotSatelliteAsynchronous IRC channel integration, stream chat responses
REST & WebSocket APIIngress HubPort 8000, JWT authentication, CORS origin whitelisting, rate limiting

🧪 Testing & Verification

Project Aiko includes a dual-engine automated test suite covering 108 tests with 100% pass rate:

# 1. Run Python Backend Test Suite (98 tests)
pytest tests/

# 2. Run Frontend Vitest Suite (10 tests)
cd aiko-app
npm test

# 3. Verify Ultra-Strict TypeScript Compilation (0 errors)
cd aiko-app
npx tsc --noEmit

# 4. Verify Frontend Production Bundle
cd aiko-app
npm run build

🗂️ Project Structure

Project-Aiko/
├── core/                  # AI backend & orchestration engine
│   ├── api/               #   REST routes, WebSockets, Pydantic schemas, auth
│   ├── neural_hub.py      #   Master orchestrator server
│   ├── chat_engine.py     #   ReAct agent + multimodal LLM
│   ├── emotion_engine.py  #   Neuromodulator engine
│   ├── unified_memory.py  #   Episodic + semantic memory
│   ├── voice.py           #   Chunked Pocket-TTS engine
│   ├── vision.py          #   Non-blocking multimodal vision analysis
│   ├── hearing.py         #   Moonshine / Whisper STT
│   ├── persona.py         #   Character definitions & mood attractors
│   ├── game_bridge.py     #   Extensible GameBridge & GameManager
│   └── ...                #   Specialized agent subsystems
├── aiko-app/              # Tauri v2 + React 19 desktop client
│   ├── src/               #   React components, Live2D canvas, Zustand stores
│   ├── src/schemas.ts     #   Zod ingress validation contracts
│   ├── src/__tests__/     #   Vitest automated test suite
│   ├── src-tauri/         #   Rust native application backend
│   └── tsconfig.json      #   Ultra-strict TypeScript configuration
├── android/               # Native Android application (Kotlin + Jetpack Compose)
├── tests/                 # Backend automated test suite (Pytest)
├── directives/            # Autonomous agent skills & personas
├── docs/                  # Architecture & developer guides
├── stickers/              # Companion sticker graphic assets
├── launch.py              # Unified cross-platform launcher
├── requirements.txt       # Python dependencies
├── SECURITY.md            # Zero-Trust security specification
├── CONTRIBUTING.md        # Contribution guidelines
└── LICENSE                # MIT License

🛠️ Troubleshooting

IssueResolution
LAUNCH_AIKO.bat crashes on startupVerify Python 3.10–3.12 is installed and checked in Windows PATH. Python 3.13 is currently incompatible with certain compiled wheels.
Failed to build wheel / cl.exe missingInstall Visual C++ Build Tools with the "Desktop development with C++" workload.
Model does not respond ("Brain not ready")Ensure Ollama is running in the background (ollama serve), or configure an active API key in Settings.
Port 8000 or 1422 already in useTerminate stale Python or Node processes via Task Manager or run taskkill /F /IM python.exe.

🤝 Contributing

Contributions are welcomed with open arms! Please review CONTRIBUTING.md for code style, type strictness, and PR requirements.


📄 License

Distributed under the MIT License. Created by the Project Aiko Team.

"I'm always watching over you, Master~"

⭐ Star this repository if Aiko brought a smile to your day!

Contributors

omax404

162 commits

omax404/Project-Aiko

4

stars

162

commits

Python

primary language

Sep 4, 2026

updated

anime
llm
project
waifu

README

Aiko Banner

Aiko Desktop

Aiko Dashboard Showcase

License: MIT Python 3.10 - 3.12 Architecture: Tier-0 Tests: 108 Passed Last Commit Repo Size

Join Discord   Quick Start   Wiki   Star this Repo


Self-hosted, user-owned AI companion with emotional depth, long-term memory, and real agency.
She doesn't just chat — she thinks, feels, remembers, sees, speaks, and acts.


⚡ Quick Start

For Users (Windows, No Setup Required)

  1. Download or clone Project Aiko to your machine.
  2. Double-click LAUNCH_AIKO.bat.
  3. Wait for her to wake up — the application bootstraps the virtual environment and launches the desktop interface automatically.

Once the dashboard appears, click the gear icon (Settings) in the top right:

  • Persona — Customize personality traits, prompts, or dynamic mood baselines.
  • AI Model — Seamlessly switch between local Ollama, OpenRouter, Gemini, OpenAI, Anthropic, or custom endpoints.
  • Voice — Enable local Pocket-TTS speech, customize pitch, or adjust voice cloning profiles.
  • Plugins — Toggle Discord, Telegram, Twitch, or PC Bridge integrations.

Hit Save & Apply — changes take effect instantly.


For Developers

# 1. Clone repository
git clone https://github.com/omax404/Project-Aiko.git
cd Project-Aiko

# 2. Setup Python environment (3.10–3.12)
python -m venv .venv
.\.venv\Scripts\activate  # On Windows (or source .venv/bin/activate on Unix)
pip install -r requirements.txt

# 3. Launch full stack
python launch.py

This starts the Neural Hub (port 8000), connects configured satellites (Discord/Telegram/Twitch), and opens the native Tauri desktop overlay.

To run or build the desktop UI separately:

cd aiko-app
npm install
npm run dev           # Vite web dev server
npm run tauri dev     # Native desktop window with Live2D
npm run build         # Production frontend bundle
npm test              # Run Vitest test suite

💎 What Makes Aiko Different

CapabilityMost AI CompanionsProject Aiko (Tier-0)
EmotionsStatic personality promptNeuromodulator engine (dopamine, serotonin, cortisol, adrenaline) across 22+ emotional attractors
MemoryEphemeral chat bufferUnified Memory — episodic recall, semantic RAG, consolidation cycles, and encrypted file partitions
VoiceCloud API (ElevenLabs)High-fidelity local Pocket-TTS with voice fingerprints, chunked synthesis, and 0 API cost
VisionNoneNon-blocking multimodal vision (moondream:latest, MiniCPM-V) running offloaded at 7.6ms loop latency
AgencyReactive onlyAutonomous proactive loop — decides when to speak, observe, reflect, and consolidate memories
Safety & ControlBlind execution / NoneStrict Zero-Trust Human-in-the-Loop (HITL) permission gate with no admin bypasses
Contracts & TypesLoosely typed / anyUltra-strict TypeScript (noUncheckedIndexedAccess: true), Zod client schemas, Pydantic v2 ingress
GamesNone or static mocksExtensible GameBridge & GameManager architecture for live server integrations (RCON/WebSockets)
Mobile SyncWeb view wrapperNative Android (Kotlin, Jetpack Compose, Room DB, GLES 2.0 Live2D, WebRTC real-time sync)

🧠 Core Systems

🧠 Brain & Reasoning

  • ReAct agent loop with multi-step reasoning, self-correction, and tool execution.
  • Multi-provider streaming across Ollama (gemma4:31b-cloud), OpenRouter, Gemini, OpenAI, Anthropic.
  • Dual-pass generation: factual draft pass followed by personality overlay.
  • Context-aware rolling conversation windows with automated summarization.

👁️ Multimodal Vision

  • Non-blocking screen analysis via asyncio.to_thread — pixel diffing and PNG compression never stall the event loop.
  • Local visual understanding via moondream:latest or MiniCPM-V.
  • Discord image analysis, automated screen inspection, and coordinate grid targeting.

👂 Hearing & Audio

  • Local Moonshine ASR (~200MB) with SpeechRecognition fallback.
  • Client-side voice activity detection (VAD).
  • Discord voice channel transcription.

🎙️ Voice Synthesis

  • Pocket-TTS v2.1.0 (100% local, zero latency, zero cloud API fees).
  • JIT speech stabilization to eliminate hallucinated phonemes.
  • Autonomous action-text (*...*) stripping for natural spoken dialogue.

💾 Unified Memory

  • Multi-tier memory architecture: episodic dialogue history + semantic vector RAG.
  • Background consolidation cycles that distill daily conversations into long-term profile knowledge.
  • Multi-process file locking (.lock) preventing concurrent corruption.

❤️ Emotional & Neuromodulator System

  • Biologically inspired neuromodulator model: dopamine, serotonin, cortisol, adrenaline.
  • 22+ emotion states mapped to dynamic Live2D avatar physics, expressions, and voice inflections.
  • Affection and relationship score tracking (0–100%).

🔌 Plugins & Agency

  • ElizaOS-inspired modular plugin manager with dynamic tool discovery.
  • File system tools, clipboard management, process supervision, and system monitoring.
  • Spotify bridge, Obsidian connector, LaTeX rendering, and image generation.
  • Extensible GameBridge base class and GameManager for connecting to external game engines.

🔒 Zero-Trust Security & Tier-0 Architecture

Project Aiko is engineered to Tier-0 Production Grade security standards. Read the full specification in SECURITY.md.

🛡️ Human-in-the-Loop (HITL) Permission Gate

  • Sensitive actions (OPEN, CLICK, TYPE, PRESS, EMAIL_SEND, and sensitive MCP tools) strictly require user confirmation.
  • When triggered, Aiko sends a tool_request to the client dashboard. The action blocks until the user approves or rejects it in a modal dialog.
  • Zero Admin Bypass: Server-side enforcement guarantees no prompt injection can bypass the confirmation gate, even with administrative tokens.

🔑 Local Zero-Trust Token Lifecycle

  • Aiko issues rotating 24-hour HMAC-SHA256 JWT Bearer tokens to loopback clients.
  • Remote IPs requesting tokens are rejected with 403 Forbidden.
  • Sensitive credentials (OPENAI_API_KEY, DISCORD_TOKEN, etc.) are automatically masked (...***) on all settings endpoints.

📐 End-to-End Typed Contracts

  • Client (Zod): Ingress events and WebSocket payloads are validated against strict Zod schemas (schemas.ts).
  • Server (Pydantic v2): API routes and WebSocket frames are checked against Pydantic models (schemas.py).
  • Ultra-Strict TypeScript: Desktop client compiles with "strict": true and "noUncheckedIndexedAccess": true.

⚡ Event-Loop Latency & Re-Render Isolation

  • Backend Non-Blocking I/O: Screen diffing, PNG compression, and SQLite logging run in thread pools via asyncio.to_thread. Event-loop latency averages 7.60ms (15.63ms p95).
  • Frontend Isolation: Message bubbles are wrapped in React.memo with granular Zustand selectors. Top-level window re-renders drop to 0 during voice playback.

📱 Platforms & Satellites

PlatformTypeStatusFeatures
Tauri Desktop AppNative DesktopLive2D avatar, click-through overlay, global hotkey (Ctrl+Alt+A), dashboard stats
Android Mobile AppNative KotlinJetpack Compose, Room DB, GLES 2.0 Live2D, WebRTC real-time sync
Discord BotSatelliteSelf-healing gateway, voice chat transcription, image recognition
Telegram BotSatelliteDirect messaging, Bearer token loopback auth with auto-retry
Twitch BotSatelliteAsynchronous IRC channel integration, stream chat responses
REST & WebSocket APIIngress HubPort 8000, JWT authentication, CORS origin whitelisting, rate limiting

🧪 Testing & Verification

Project Aiko includes a dual-engine automated test suite covering 108 tests with 100% pass rate:

# 1. Run Python Backend Test Suite (98 tests)
pytest tests/

# 2. Run Frontend Vitest Suite (10 tests)
cd aiko-app
npm test

# 3. Verify Ultra-Strict TypeScript Compilation (0 errors)
cd aiko-app
npx tsc --noEmit

# 4. Verify Frontend Production Bundle
cd aiko-app
npm run build

🗂️ Project Structure

Project-Aiko/
├── core/                  # AI backend & orchestration engine
│   ├── api/               #   REST routes, WebSockets, Pydantic schemas, auth
│   ├── neural_hub.py      #   Master orchestrator server
│   ├── chat_engine.py     #   ReAct agent + multimodal LLM
│   ├── emotion_engine.py  #   Neuromodulator engine
│   ├── unified_memory.py  #   Episodic + semantic memory
│   ├── voice.py           #   Chunked Pocket-TTS engine
│   ├── vision.py          #   Non-blocking multimodal vision analysis
│   ├── hearing.py         #   Moonshine / Whisper STT
│   ├── persona.py         #   Character definitions & mood attractors
│   ├── game_bridge.py     #   Extensible GameBridge & GameManager
│   └── ...                #   Specialized agent subsystems
├── aiko-app/              # Tauri v2 + React 19 desktop client
│   ├── src/               #   React components, Live2D canvas, Zustand stores
│   ├── src/schemas.ts     #   Zod ingress validation contracts
│   ├── src/__tests__/     #   Vitest automated test suite
│   ├── src-tauri/         #   Rust native application backend
│   └── tsconfig.json      #   Ultra-strict TypeScript configuration
├── android/               # Native Android application (Kotlin + Jetpack Compose)
├── tests/                 # Backend automated test suite (Pytest)
├── directives/            # Autonomous agent skills & personas
├── docs/                  # Architecture & developer guides
├── stickers/              # Companion sticker graphic assets
├── launch.py              # Unified cross-platform launcher
├── requirements.txt       # Python dependencies
├── SECURITY.md            # Zero-Trust security specification
├── CONTRIBUTING.md        # Contribution guidelines
└── LICENSE                # MIT License

🛠️ Troubleshooting

IssueResolution
LAUNCH_AIKO.bat crashes on startupVerify Python 3.10–3.12 is installed and checked in Windows PATH. Python 3.13 is currently incompatible with certain compiled wheels.
Failed to build wheel / cl.exe missingInstall Visual C++ Build Tools with the "Desktop development with C++" workload.
Model does not respond ("Brain not ready")Ensure Ollama is running in the background (ollama serve), or configure an active API key in Settings.
Port 8000 or 1422 already in useTerminate stale Python or Node processes via Task Manager or run taskkill /F /IM python.exe.

🤝 Contributing

Contributions are welcomed with open arms! Please review CONTRIBUTING.md for code style, type strictness, and PR requirements.


📄 License

Distributed under the MIT License. Created by the Project Aiko Team.

"I'm always watching over you, Master~"

⭐ Star this repository if Aiko brought a smile to your day!

Contributors

omax404

162 commits

Languages

Python

46.1%

TypeScript

26.9%

Kotlin

19.0%

PowerShell

2.9%

Rust

2.1%

CSS

1.7%

HTML

1.1%