Skip to content
xtosutosu edited this page Apr 12, 2026 · 2 revisions

๐ŸŽฎ MonikAI - Complete Project Wiki

Welcome to the MonikAI wiki! Here you'll find everything you need to know about the architecture, structure, and operation of this project.

๐Ÿ“‹ Table of Contents

  1. System Overview โ† You are here
  2. Architecture - How everything connects
  3. Backend - Python documentation
  4. Frontend - React documentation
  5. Integrations - Minecraft, Spotify, Telegram, etc.
  6. Progression System - Achievements, quests, personality
  7. API Reference - All endpoints
  8. Setup & Installation - How to run the project
  9. Development Guide - How to contribute
  10. Troubleshooting - Problem solving

๐Ÿš€ Quick Start

What is MonikAI?

MonikAI is an advanced AI system with personality, built around the Gemini 2.5 Live API. It combines:

  • ๐ŸŽ™๏ธ Conversational AI - Natural voice/text conversations
  • ๐Ÿ’ซ Dynamic Personality - Mood, affection, energy changing over time
  • ๐ŸŽฏ Progression System - 9 connected systems (relationships, quests, achievements, unlocks, narrative)
  • ๐ŸŽฎ Game Integrations - Minecraft bot with autonomy
  • ๐ŸŽต Media Integrations - Spotify awareness, Telegram bridge
  • ๐Ÿ  Smart Home - Control TP-Link devices
  • ๐Ÿ“ Advanced Memory - JSONL + SQLite FTS for episodic memories
  • ๐Ÿš€ Multi-Platform - Desktop (Electron), Web, Telegram

Key Features

Feature Description
Personality System Dynamic personality state (mood, affection, energy, comfort, synergy, intimacy)
Progression Track 9 systems: profile, metrics, quests, achievements, unlocks, narrative, activities, briefing, seasonal
Memory Engine Episodic memory with FTS indexing in SQLite, organized into pages and topics
Real-time Communication Socket.IO WebSocket for instant audio/text output
Tool Ecosystem Web automation, skills system, external service integrations
Autonomous Agents Minecraft bot, Spotify, Telegram, Kasa smart home
Local-First Entire operation offline, optional cloud integrations

๐Ÿ—๏ธ Technology Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         ELECTRON DESKTOP APP (React 18 + Vite)  โ”‚
โ”‚  - Socket.IO client                             โ”‚
โ”‚  - MediaPipe (face auth, gestures)              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   PYTHON BACKEND (FastAPI + Socket.IO Server)   โ”‚
โ”‚  - Gemini 2.5 Live API                          โ”‚
โ”‚  - AI engines (personality, memory, etc.)       โ”‚
โ”‚  - Tool execution                               โ”‚
โ”‚  - Service integrations                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   NODE.JS MINECRAFT BOT (Optional subprocess)   โ”‚
โ”‚  - Mineflayer for Minecraft automation          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Frontend Stack:

  • React 18.2, Vite 7.3, Socket.IO, Tailwind CSS, Framer Motion, MediaPipe

Backend Stack:

  • Python 3.10+, FastAPI, Uvicorn, Socket.IO-Python
  • Google Gemini 2.5 API (native audio), PyAudio, OpenCV, Playwright, SQLite

Desktop:

  • Electron 40.1, electron-builder

Mobile Bridge:

  • Telegram Bot API

๐Ÿ“ Folder Structure

monikai/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ core/              # Server, AI engine, session manager
โ”‚   โ”œโ”€โ”€ ai/                # 9 progression engines, memory, personality
โ”‚   โ”œโ”€โ”€ agents/            # External service managers
โ”‚   โ”œโ”€โ”€ integrations/      # Minecraft, Spotify, Telegram
โ”‚   โ”œโ”€โ”€ state/             # State tracking
โ”‚   โ”œโ”€โ”€ tools/             # Tool definitions
โ”‚   โ”œโ”€โ”€ audio/             # Audio I/O
โ”‚   โ””โ”€โ”€ data/              # User data, sessions, memory
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ components/    # React components
โ”‚       โ”œโ”€โ”€ contexts/      # Context providers
โ”‚       โ”œโ”€โ”€ hooks/         # Custom hooks
โ”‚       โ”œโ”€โ”€ layout/        # Layout components
โ”‚       โ”œโ”€โ”€ styles/        # Global styles
โ”‚       โ””โ”€โ”€ config/        # Configuration
โ”‚
โ”œโ”€โ”€ scripts/               # Migration, setup scripts
โ”œโ”€โ”€ skills/                # Integration skills
โ”œโ”€โ”€ .github/wiki/          # Wiki documentation (YOU ARE HERE)
โ”‚
โ””โ”€โ”€ package.json, requirements.txt, vite.config.js, etc.

๐Ÿ”„ How Everything Works

1. Start Conversation

User speaks โ†’ Frontend captures audio โ†’ Socket.IO sends to Backend

2. AI Processing

Backend routes to Gemini 2.5 Live API โ†’ Streaming response received

3. Personality Observation

Personality engine analyzes message โ†’ Progression system observes
โ†’ RelationshipMetrics +XP
โ†’ QuestSystem checks completion
โ†’ AchievementTracker triggers unlocks
โ†’ NarrativeEngine checks story milestones

4. Tool Execution

If tool requested โ†’ Execute (web automation, skills, integrations)

5. Send Response

Audio response โ†’ Socket.IO back to Frontend
State changes โ†’ HTTP updates for progression
Notifications โ†’ For achievements/quests

๐Ÿ“Š Key Components

Component Location Description
Gemini Live Loop backend/core/monikai.py Main AI engine
Personality Engine backend/ai/personality.py Personality state management
Progression Coordinator backend/ai/integrated_progression_system.py Coordinator of 9 systems
Memory Storage backend/ai/memory_engine.py JSONL + SQLite FTS
Session Manager backend/core/session_manager.py Conversation persistence
FastAPI Server backend/core/server.py REST API + WebSocket hub
Frontend Audio src/components/ChatModule.jsx Conversation interface
Minecraft Agent backend/agents/minecraft_agent.py Bot manager
Spotify Manager backend/agents/spotify_manager.py OAuth + API
Telegram Bot backend/agents/telegram_bot.py Mobile bridge

๐Ÿ’พ Data Persistence

Everything is stored locally in the data/ folder:

data/
โ”œโ”€โ”€ sessions/              # Conversation logs (JSONL)
โ”œโ”€โ”€ user_memory/           # Profile, metrics, achievements
โ”œโ”€โ”€ memory/                # Episodic memory entries
โ”œโ”€โ”€ quests/                # Quest templates
โ”œโ”€โ”€ achievements/          # Achievement definitions
โ”œโ”€โ”€ stories/               # Narrative sequences
โ”œโ”€โ”€ unlocks/               # Content unlock requirements
โ””โ”€โ”€ seasonal_events/       # Holiday/calendar events

๐ŸŽฏ Next Steps


๐Ÿ“ž Support

If something is unclear or you need more information, open a GitHub Issue or review this wiki more carefully.

Last Updated: April 2026

Clone this wiki locally