VirtualKimi commited on
Commit
fb46fcb
Β·
verified Β·
1 Parent(s): 0bc2a8a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +438 -428
README.md CHANGED
@@ -1,428 +1,438 @@
1
- <div align="center">
2
-
3
- <b>Virtual Kimi</b>
4
-
5
- [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
6
- [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
7
-
8
- </div>
9
-
10
- # Virtual Kimi - AI Companion Application πŸ’–
11
-
12
- Web-based AI girlfriend and companion featuring adaptive personalities, intelligent memory systems, and immersive conversational experiences.
13
-
14
- ## Overview
15
-
16
- Virtual Kimi is an advanced virtual companion application that combines modern web technologies with state-of-the-art AI models to create meaningful, evolving relationships between users and AI girlfriend personalities.
17
-
18
- - **Lightweight:** ~600 KB of pure JavaScript, HTML, and CSS (no frameworks)
19
- - **Local-first:** All data is stored in your browser's IndexedDB (managed by Dexie.js)
20
- - **No tracking:** The only external calls are to FontAwesome (for icons) and the OpenRouter API (for AI)
21
-
22
- Built with vanilla JavaScript and modern web APIs, it offers a rich, responsive experience across devices.
23
-
24
- ---
25
-
26
- ## 🌐 Support & Links
27
-
28
- - **Website**: [virtualkimi.com](https://virtualkimi.com)
29
- - **Email**: [ijohn@virtualkimi.com](ijohn@virtualkimi.com)
30
- - **X (Twitter)**: [x.com/virtualkimi](https://x.com/virtualkimi)
31
- - **GitHub**: [github.com/virtualkimi](https://github.com/virtualkimi)
32
- - **HuggingFace**: [huggingface.co/VirtualKimi](https://huggingface.co/VirtualKimi)
33
- - **YouTube**: [YouTube Channel](https://www.youtube.com/@VirtualKimi)
34
-
35
- - **Support the project**: [ko-fi.com/virtualkimi](https://ko-fi.com/virtualkimi)
36
- _If you like this project or want to help me (I'm currently without a permanent job), you can buy me a coffee or make a donation. Every bit helps keep Virtual Kimi alive and evolving!_
37
-
38
- - **ETH Wallet**: 0x836C9D2e605f98Bc7144C62Bef837627b1a9C30c
39
-
40
- ---
41
-
42
- ## Key Features
43
-
44
- ### πŸ€– **Advanced AI Integration**
45
-
46
- Recommended models (IDs and short notes β€” updated Aug 2025):
47
-
48
- - mistralai/mistral-small-3.2-24b-instruct β€” Mistral-small-3.2 (128k context, economical)
49
- - qwen/qwen3-30b-a3b-instruct-2507 β€” Qwen3 30b (131k context)
50
- - nousresearch/hermes-4-70b β€” Nous Hermes 4 70B (131k context)
51
- - x-ai/grok-3-mini β€” Grok 3 mini (131k context)
52
- - cohere/command-r-08-2024 β€” Cohere Command-R (128k context)
53
- - qwen/qwen3-235b-a22b-2507 β€” Qwen3-235b (262k context)
54
- - anthropic/claude-3-haiku β€” Claude 3 Haiku (large context)
55
- - local/ollama β€” Local Model (Ollama, experimental, 4k context)
56
-
57
- Notes: model IDs in the app are authoritative; pricing/context values are indicative and may change with providers.
58
-
59
- ### πŸ‘₯ **Multiple AI Personalities**
60
-
61
- - **Kimi**: Cosmic dreamer and astrophysicist with ethereal sensibilities
62
- - **Bella**: Nurturing botanist who sees people as plants needing care
63
- - **Rosa**: Chaotic prankster thriving on controlled chaos
64
- - **Stella**: Digital artist transforming reality through pixelated vision
65
-
66
- ### Personality Trait Ranges
67
-
68
- All personality traits operate on a 0-100 scale:
69
-
70
- - **Affection**: Emotional warmth and attachment
71
- - **Playfulness**: Fun-loving and spontaneous behavior
72
- - **Intelligence**: Analytical and thoughtful responses
73
- - **Empathy**: Understanding and emotional support
74
- - **Humor**: Wit and lighthearted interactions
75
- - **Romance**: Romantic and intimate expressions
76
-
77
- ### 🧠 **Intelligent Memory System**
78
-
79
- - Automatic extraction and categorization of conversation memories
80
- - Seven memory categories: Personal, Preferences, Relationships, Activities, Goals, Experiences, Events
81
- - Persistent memory across sessions with search and management capabilities
82
- - Character-specific memory isolation
83
-
84
- ### πŸ’« **Dynamic Personality Evolution**
85
-
86
- - Six personality traits that evolve based on interactions:
87
- - Affection, Playfulness, Intelligence, Empathy, Humor, Romance
88
- - Real-time trait adjustments based on conversation tone and content
89
- - Visual personality indicators and progression tracking
90
- - Intelligent model selection and switching
91
- - Real-time emotion detection and analysis
92
- - Contextually-aware responses
93
-
94
- ### 🎬 **Emotion-Driven Visual Experience**
95
-
96
- - Real-time video responses matching detected emotions
97
- - Smooth transitions between emotional states
98
- - Character-specific visual libraries with ~240 video clips (approx. 60 per main character)
99
- - Context-aware video selection system
100
-
101
- ### 🎨 **Customizable Interface**
102
-
103
- - Five professionally designed themes
104
- - Adjustable interface transparency
105
- - Responsive design optimized for desktop, tablet, and mobile
106
- - Accessibility features and keyboard navigation
107
-
108
- ### 🌍 **Multilingual Support**
109
-
110
- - Full localization in 7 languages: English, French, Spanish, German, Italian, Japanese, Chinese
111
- - Automatic language detection from user input
112
- - Culturally-aware responses and emotion keywords
113
-
114
- ### πŸ”Œ **Extensible Plugin System**
115
-
116
- - Theme plugins for visual customization (currently, only the color theme plugin is functional)
117
- - Voice plugins for speech synthesis options (planned)
118
- - Behavior plugins for personality modifications (planned)
119
- - Secure plugin loading with validation
120
-
121
- ### πŸ›‘οΈ **Security & Privacy**
122
-
123
- - Input validation and sanitization
124
- - Secure API key handling
125
- - Local data storage with IndexedDB
126
- - No server dependencies for core functionality
127
-
128
- ## πŸ—οΈ Technical Architecture
129
-
130
- ### 🧩 Core Technologies
131
-
132
- - **Frontend**: Vanilla JavaScript (ES6+), HTML5, CSS3
133
- - **Database**: IndexedDB with Dexie.js
134
- - **AI Integration**: OpenRouter (default), OpenAI-compatible, Cohere, Anthropic, Groq, Together, or local Ollama
135
- - **Speech**: Web Speech API
136
- - **Audio**: Web Audio API
137
-
138
- ---
139
-
140
- ## ✨ Inspiration & Assets
141
-
142
- This project was originally inspired by the [JackyWine GitHub repository](https://github.com/Jackywine).
143
- @Jackywine on X (Twitter)
144
-
145
- The four main characters are visually based on images from four creators on X (Twitter):
146
-
147
- - @JulyFox33 (Kimi)
148
- - @BelisariaNew (Bella)
149
- - @JuliAIkiko (Rosa and Stella)
150
-
151
- All character videos were generated using the image-to-video AI from Kling.ai, specifically with the Kling v2.1 model.
152
-
153
- Get 50% bonus Credits in your first month with this code referral 7BR9GT2WQ6JF - link: [https://klingai.com](https://klingai.com/h5-app/invitation?code=7BR9GT2WQ6JF)
154
-
155
- ---
156
-
157
- ### Project Structure (current)
158
-
159
- Top-level files and main modules:
160
-
161
- - index.html β€” Main application entry
162
- - virtual-kimi (static assets & landing): virtual-kimi\*.html
163
- - kimi-js/
164
- - kimi-script.js β€” App initialization & orchestration
165
- - kimi-database.js β€” IndexedDB persistence (Dexie)
166
- - kimi-config.js β€” Runtime configuration
167
- - kimi-security.js β€” Security utilities
168
- - kimi-llm-manager.js β€” LLM integration and model list
169
- - kimi-emotion-system.js β€” Emotion analysis
170
- - kimi-memory-system.js β€” Memory extraction & storage
171
- - kimi-memory-ui.js β€” Memory management UI
172
- - kimi-appearance.js, kimi-voices.js, kimi-utils.js, kimi-module.js, etc.
173
- - kimi-css/ β€” styles and themes
174
- - kimi-plugins/ β€” local plugins (sample-theme, sample-behavior, sample-voice)
175
- - kimi-locale/ β€” translations and i18n files
176
- - dexie.min.js β€” local DB helper
177
-
178
- ### Data Flow
179
-
180
- 1. **Input Processing**: User input β†’ Security validation β†’ Language detection
181
- 2. **AI Analysis**: Emotion detection β†’ Memory extraction β†’ LLM processing
182
- 3. **Response Generation**: Personality-aware response β†’ Emotion mapping β†’ Visual selection
183
- 4. **Memory Update**: Trait evolution β†’ Memory storage β†’ UI synchronization
184
-
185
- ## Installation & Setup
186
-
187
- ### Prerequisites
188
-
189
- - Modern web browser (Chrome, Edge or recent Firefox recommended). The app is plain HTML/CSS/JS and runs locally in a browser β€” no build step is required.
190
- - (Optional) OpenRouter API key or another compatible provider API key if you want remote LLM access. The app can run without a key using local-only features, but AI responses will be limited.
191
- - HTTPS is required for microphone access and some browser TTS features. For full voice/microphone features, open the app via a local server (see Quick Start). If you only open `index.html` directly, most features still work but microphone may be blocked by the browser.
192
- - Dexie.js is included for IndexedDB persistence (no installation required; file `dexie.min.js` is bundled).
193
-
194
- ### Quick Start
195
-
196
- 1. **Clone the repository**
197
-
198
- ```bash
199
- git clone https://github.com/virtualkimi/virtual-kimi.git
200
- cd virtual-kimi
201
- ```
202
-
203
- 2. **Open the application**
204
-
205
- - Open `index.html` in your web browser
206
- - Or serve via local web server for optimal performance:
207
- ```bash
208
- python -m http.server 8000
209
- # Navigate to http://localhost:8000
210
- ```
211
-
212
- 3. **Configure API access**
213
-
214
- - Open Settings β†’ AI & Models
215
- - Provider: choose the LLM provider to use. Supported options in the app include `openrouter` (recommended), `openai`/OpenAI-compatible endpoints, and `ollama` (local). The selected provider is saved in the app preferences.
216
- - API key: paste your provider API key into the API Key field. Keys are saved locally in your browser's IndexedDB (preferences) so they never leave your machine except when the app sends requests to the selected provider.
217
- - Base URL: if you use a non‑default provider or an OpenAI-compatible endpoint, set the provider base URL (Settings β†’ AI & Models β†’ Base URL). This overrides the built-in default endpoints.
218
- - Model selection: choose a model ID from the list. The app's authoritative model list is defined in `kimi-js/kimi-llm-manager.js`. If the provider does not support the selected model, the app will attempt a best-match fallback or show an error.
219
- - Test API key: use the app's built-in test function (Settings β†’ Test API) to validate your key; this performs a minimal request and reports success or the provider error message.
220
- - Local (Ollama) usage: to use a local model with `ollama`, run your local Ollama-compatible server (the app uses `http://localhost:11434/api/chat`). Select provider `ollama` and set model ID accordingly. Local models are experimental and work only if the local server is running.
221
- - No key behavior: the app runs without an API key for local UI features and stored data, but remote LLM responses require a valid provider/key. If no key is configured the app will return friendly fallback messages for AI features.
222
-
223
- Troubleshooting notes:
224
-
225
- - If you see HTTP 401: verify the API key for the selected provider.
226
- - If you see HTTP 429 or rate-limit errors: wait a moment or choose a different model/provider account.
227
- - If the model is reported as unavailable (422-like errors): verify the model ID and, if needed, refresh the remote model list in Settings.
228
- - For OpenRouter-specific issues: check the Base URL is `https://openrouter.ai/api/v1/chat/completions` (default) unless you use a custom endpoint.
229
-
230
- 4. **Customize your experience**
231
- - Choose your language and preferred voice
232
- - Choose a character in Personality tab
233
- - Enable memory system in Data tab
234
- - Adjust themes and UI opacity in Appearance tab
235
-
236
- ### Production Deployment
237
-
238
- For production deployment, ensure:
239
-
240
- - HTTPS is enabled (required for microphone access)
241
- - Gzip compression for assets
242
- - Proper cache headers
243
- - CSP headers for enhanced security
244
-
245
- ## βš™οΈ Configuration
246
-
247
- ### API Integration
248
-
249
- The application supports multiple AI providers; choose and configure your provider in Settings β†’ AI & Models.
250
-
251
- - Mistral models
252
- - Nous Hermes models
253
- - Qwen3 models
254
- - xAI models
255
- - Open-source alternatives
256
-
257
- ### Memory System Configuration
258
-
259
- ```javascript
260
- // Memory categories can be customized
261
- const memoryCategories = [
262
- "personal", // Personal information
263
- "preferences", // Likes and dislikes
264
- "relationships", // People and connections
265
- "activities", // Hobbies and activities
266
- "goals", // Aspirations and plans
267
- "experiences", // Past events
268
- "important" // Significant moments
269
- ];
270
- ```
271
-
272
- ## πŸ› οΈ Development
273
-
274
- ### Project Structure
275
-
276
- ```
277
- <repo root>
278
- β”œβ”€β”€ index.html
279
- β”œβ”€β”€ README.md
280
- β”œβ”€β”€ LICENSE.md
281
- β”œβ”€β”€ package.json
282
- β”œβ”€β”€ kimi-js/ # core JS modules (kimi-*.js)
283
- β”œβ”€β”€ kimi-locale/ # translations (en.json, fr.json, ...)
284
- β”œβ”€β”€ kimi-plugins/ # plugin examples
285
- β”œβ”€β”€ kimi-videos/ # character video clips
286
- β”œβ”€β”€ kimi-icons/ # image assets and favicons
287
- └── dexie.min.js # IndexedDB helper
288
- ```
289
-
290
- ### Adding New Features
291
-
292
- #### Creating a New Plugin
293
-
294
- ```javascript
295
- // manifest.json
296
- {
297
- "name": "Custom Theme",
298
- "version": "1.0.0",
299
- "type": "theme",
300
- "style": "theme.css",
301
- "main": "theme.js",
302
- "enabled": true
303
- }
304
- ```
305
-
306
- > **Note:** As of version 1.0, only the color theme plugin is fully functional. Voice and behavior plugins are planned for future releases. See `kimi-plugins/sample-theme/` for a working example.
307
-
308
- #### Extending Memory Categories
309
-
310
- ```javascript
311
- // Add to kimi-memory-system.js
312
- const customCategory = {
313
- name: "custom",
314
- icon: "fas fa-star",
315
- keywords: ["keyword1", "keyword2"],
316
- confidence: 0.7
317
- };
318
- ```
319
-
320
- ### Health Check System
321
-
322
- The application includes a comprehensive health check system:
323
-
324
- ```javascript
325
- // Run health check
326
- const healthCheck = new KimiHealthCheck();
327
- const report = await healthCheck.runAllChecks();
328
- console.log(report.status); // 'HEALTHY' or 'NEEDS_ATTENTION'
329
- ```
330
-
331
- ## Browser Compatibility
332
-
333
- | Browser | Voice Recognition | Full Features | Notes |
334
- | ----------- | ----------------- | ------------- | ------------------------- |
335
- | Chrome 90+ | βœ… | βœ… | Recommended |
336
- | Edge 90+ | βœ… | βœ… | Optimal voice performance |
337
- | Firefox 88+ | ⚠️ | βœ… | Limited voice support |
338
- | Safari 14+ | ⚠️ | βœ… | iOS limitations |
339
-
340
- ## Performance
341
-
342
- ### Optimization Features
343
-
344
- - Lazy loading of non-critical modules
345
- - Efficient batch database operations
346
- - Debounced UI interactions
347
- - Memory management with cleanup
348
- - Optimized video preloading
349
-
350
- ### Resource Usage
351
-
352
- - Memory footprint: ~15-30MB active usage
353
- - Storage: Scales with conversation history
354
- - Network: API calls only, no tracking
355
- - CPU: Minimal background processing
356
-
357
- ## Privacy & Security
358
-
359
- ### Data Handling
360
-
361
- - All data stored locally in browser
362
- - No telemetry or analytics
363
- - API keys in your local storage
364
- - User content never sent to external servers (except chosen AI provider)
365
-
366
- ### Security Measures
367
-
368
- - Input validation and sanitization
369
- - XSS protection
370
- - Safe plugin loading
371
- - Secure API communication
372
-
373
- ## Troubleshooting
374
-
375
- ### Common Issues
376
-
377
- - **Microphone not working**: Ensure HTTPS and browser permissions
378
- - **API errors / provider issues**: Verify the API key and selected provider for the chosen model. This app supports multiple providers (OpenRouter, OpenAI-compatible endpoints, Groq, Together, Cohere, Anthropic, local/Ollama, etc.). Make sure the provider-specific base URL, model ID and API key are correctly configured in Settings β†’ AI & Models.
379
- - **Text-to-Speech (TTS) voices**: The app uses the browser Web Speech API for TTS. For best voice support, use modern Chromium-based browsers (Edge or Chrome) which generally provide better built-in voices and compatibility. If voices are missing or sound low quality, try Edge/Chrome or install additional TTS engines on your system.
380
- - **Performance issues**: Clear browser cache, check available memory
381
- - **Memory system not learning**: Ensure system is enabled in Data tab
382
-
383
- ## Contributing
384
-
385
- We welcome contributions! Please see our contributing guidelines:
386
-
387
- 1. Fork the repository
388
- 2. Create a feature branch
389
- 3. Make your changes with appropriate tests
390
- 4. Submit a pull request with detailed description
391
-
392
- ### Development Guidelines
393
-
394
- - Follow existing code style and patterns
395
- - Add comments for complex functionality
396
- - Test across multiple browsers
397
- - Update documentation for new features
398
-
399
- ## πŸ”„ TODO / Roadmap (current priorities)
400
-
401
- - [ ] Full support for local models (Ollama integration β€” currently experimental)
402
- - [ ] Voice plugin system (custom voices, TTS engines) β€” planned
403
- - [ ] Behavior plugin system (custom AI behaviors) β€” planned
404
- - [ ] Improve advanced memory management UI and ranked memory snapshot features (in-progress)
405
- - [ ] More character personalities and backgrounds
406
- - [ ] In-app onboarding and help system
407
- - [ ] Better mobile UI/UX and accessibility improvements
408
- - [ ] More granular privacy controls and explicit user consent flows
409
- - [ ] Automated testing and CI/CD pipeline (unit + basic UI tests)
410
- - [ ] Performance profiling and optimization for large conversation histories
411
- - [ ] Documentation updates to reflect implemented features (models, API handling, plugin validation)
412
-
413
- ## πŸ“œ License
414
-
415
- This project is distributed under a custom license. **Any commercial use, resale, or monetization of this application or its derivatives is strictly prohibited without the explicit written consent of the author.**
416
-
417
- See the [LICENSE](LICENSE) file for details.
418
-
419
- [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
420
- [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
421
-
422
- ---
423
-
424
- **Virtual Kimi** - Creating meaningful connections between humans and AI, one conversation at a time.
425
-
426
- > _"Love is the most powerful code"_ πŸ’•
427
- >
428
- > β€” 2025 Virtual Kimi - Created with πŸ’œ by Jean & Kimi
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: openrail
3
+ title: Virtual Kimi - AI Companion Application πŸ’–
4
+ sdk: static
5
+ emoji: 😻
6
+ colorFrom: indigo
7
+ colorTo: purple
8
+ pinned: true
9
+ short_description: Web-based AI girlfriend and companion
10
+ ---
11
+ <div align="center">
12
+
13
+ <b>Virtual Kimi</b>
14
+
15
+ [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
16
+ [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
17
+
18
+ </div>
19
+
20
+ # Virtual Kimi - AI Companion Application πŸ’–
21
+
22
+ Web-based AI girlfriend and companion featuring adaptive personalities, intelligent memory systems, and immersive conversational experiences.
23
+
24
+ ## Overview
25
+
26
+ Virtual Kimi is an advanced virtual companion application that combines modern web technologies with state-of-the-art AI models to create meaningful, evolving relationships between users and AI girlfriend personalities.
27
+
28
+ - **Lightweight:** ~600 KB of pure JavaScript, HTML, and CSS (no frameworks)
29
+ - **Local-first:** All data is stored in your browser's IndexedDB (managed by Dexie.js)
30
+ - **No tracking:** The only external calls are to FontAwesome (for icons) and the OpenRouter API (for AI)
31
+
32
+ Built with vanilla JavaScript and modern web APIs, it offers a rich, responsive experience across devices.
33
+
34
+ ---
35
+
36
+ ## 🌐 Support & Links
37
+
38
+ - **Website**: [virtualkimi.com](https://virtualkimi.com)
39
+ - **Email**: [ijohn@virtualkimi.com](ijohn@virtualkimi.com)
40
+ - **X (Twitter)**: [x.com/virtualkimi](https://x.com/virtualkimi)
41
+ - **GitHub**: [github.com/virtualkimi](https://github.com/virtualkimi)
42
+ - **HuggingFace**: [huggingface.co/VirtualKimi](https://huggingface.co/VirtualKimi)
43
+ - **YouTube**: [YouTube Channel](https://www.youtube.com/@VirtualKimi)
44
+
45
+ - **Support the project**: [ko-fi.com/virtualkimi](https://ko-fi.com/virtualkimi)
46
+ _If you like this project or want to help me (I'm currently without a permanent job), you can buy me a coffee or make a donation. Every bit helps keep Virtual Kimi alive and evolving!_
47
+
48
+ - **ETH Wallet**: 0x836C9D2e605f98Bc7144C62Bef837627b1a9C30c
49
+
50
+ ---
51
+
52
+ ## Key Features
53
+
54
+ ### πŸ€– **Advanced AI Integration**
55
+
56
+ Recommended models (IDs and short notes β€” updated Aug 2025):
57
+
58
+ - mistralai/mistral-small-3.2-24b-instruct β€” Mistral-small-3.2 (128k context, economical)
59
+ - qwen/qwen3-30b-a3b-instruct-2507 β€” Qwen3 30b (131k context)
60
+ - nousresearch/hermes-4-70b β€” Nous Hermes 4 70B (131k context)
61
+ - x-ai/grok-3-mini β€” Grok 3 mini (131k context)
62
+ - cohere/command-r-08-2024 β€” Cohere Command-R (128k context)
63
+ - qwen/qwen3-235b-a22b-2507 β€” Qwen3-235b (262k context)
64
+ - anthropic/claude-3-haiku β€” Claude 3 Haiku (large context)
65
+ - local/ollama β€” Local Model (Ollama, experimental, 4k context)
66
+
67
+ Notes: model IDs in the app are authoritative; pricing/context values are indicative and may change with providers.
68
+
69
+ ### πŸ‘₯ **Multiple AI Personalities**
70
+
71
+ - **Kimi**: Cosmic dreamer and astrophysicist with ethereal sensibilities
72
+ - **Bella**: Nurturing botanist who sees people as plants needing care
73
+ - **Rosa**: Chaotic prankster thriving on controlled chaos
74
+ - **Stella**: Digital artist transforming reality through pixelated vision
75
+
76
+ ### Personality Trait Ranges
77
+
78
+ All personality traits operate on a 0-100 scale:
79
+
80
+ - **Affection**: Emotional warmth and attachment
81
+ - **Playfulness**: Fun-loving and spontaneous behavior
82
+ - **Intelligence**: Analytical and thoughtful responses
83
+ - **Empathy**: Understanding and emotional support
84
+ - **Humor**: Wit and lighthearted interactions
85
+ - **Romance**: Romantic and intimate expressions
86
+
87
+ ### 🧠 **Intelligent Memory System**
88
+
89
+ - Automatic extraction and categorization of conversation memories
90
+ - Seven memory categories: Personal, Preferences, Relationships, Activities, Goals, Experiences, Events
91
+ - Persistent memory across sessions with search and management capabilities
92
+ - Character-specific memory isolation
93
+
94
+ ### πŸ’« **Dynamic Personality Evolution**
95
+
96
+ - Six personality traits that evolve based on interactions:
97
+ - Affection, Playfulness, Intelligence, Empathy, Humor, Romance
98
+ - Real-time trait adjustments based on conversation tone and content
99
+ - Visual personality indicators and progression tracking
100
+ - Intelligent model selection and switching
101
+ - Real-time emotion detection and analysis
102
+ - Contextually-aware responses
103
+
104
+ ### 🎬 **Emotion-Driven Visual Experience**
105
+
106
+ - Real-time video responses matching detected emotions
107
+ - Smooth transitions between emotional states
108
+ - Character-specific visual libraries with ~240 video clips (approx. 60 per main character)
109
+ - Context-aware video selection system
110
+
111
+ ### 🎨 **Customizable Interface**
112
+
113
+ - Five professionally designed themes
114
+ - Adjustable interface transparency
115
+ - Responsive design optimized for desktop, tablet, and mobile
116
+ - Accessibility features and keyboard navigation
117
+
118
+ ### 🌍 **Multilingual Support**
119
+
120
+ - Full localization in 7 languages: English, French, Spanish, German, Italian, Japanese, Chinese
121
+ - Automatic language detection from user input
122
+ - Culturally-aware responses and emotion keywords
123
+
124
+ ### πŸ”Œ **Extensible Plugin System**
125
+
126
+ - Theme plugins for visual customization (currently, only the color theme plugin is functional)
127
+ - Voice plugins for speech synthesis options (planned)
128
+ - Behavior plugins for personality modifications (planned)
129
+ - Secure plugin loading with validation
130
+
131
+ ### πŸ›‘οΈ **Security & Privacy**
132
+
133
+ - Input validation and sanitization
134
+ - Secure API key handling
135
+ - Local data storage with IndexedDB
136
+ - No server dependencies for core functionality
137
+
138
+ ## πŸ—οΈ Technical Architecture
139
+
140
+ ### 🧩 Core Technologies
141
+
142
+ - **Frontend**: Vanilla JavaScript (ES6+), HTML5, CSS3
143
+ - **Database**: IndexedDB with Dexie.js
144
+ - **AI Integration**: OpenRouter (default), OpenAI-compatible, Cohere, Anthropic, Groq, Together, or local Ollama
145
+ - **Speech**: Web Speech API
146
+ - **Audio**: Web Audio API
147
+
148
+ ---
149
+
150
+ ## ✨ Inspiration & Assets
151
+
152
+ This project was originally inspired by the [JackyWine GitHub repository](https://github.com/Jackywine).
153
+ @Jackywine on X (Twitter)
154
+
155
+ The four main characters are visually based on images from four creators on X (Twitter):
156
+
157
+ - @JulyFox33 (Kimi)
158
+ - @BelisariaNew (Bella)
159
+ - @JuliAIkiko (Rosa and Stella)
160
+
161
+ All character videos were generated using the image-to-video AI from Kling.ai, specifically with the Kling v2.1 model.
162
+
163
+ Get 50% bonus Credits in your first month with this code referral 7BR9GT2WQ6JF - link: [https://klingai.com](https://klingai.com/h5-app/invitation?code=7BR9GT2WQ6JF)
164
+
165
+ ---
166
+
167
+ ### Project Structure (current)
168
+
169
+ Top-level files and main modules:
170
+
171
+ - index.html β€” Main application entry
172
+ - virtual-kimi (static assets & landing): virtual-kimi\*.html
173
+ - kimi-js/
174
+ - kimi-script.js β€” App initialization & orchestration
175
+ - kimi-database.js β€” IndexedDB persistence (Dexie)
176
+ - kimi-config.js β€” Runtime configuration
177
+ - kimi-security.js β€” Security utilities
178
+ - kimi-llm-manager.js β€” LLM integration and model list
179
+ - kimi-emotion-system.js β€” Emotion analysis
180
+ - kimi-memory-system.js β€” Memory extraction & storage
181
+ - kimi-memory-ui.js β€” Memory management UI
182
+ - kimi-appearance.js, kimi-voices.js, kimi-utils.js, kimi-module.js, etc.
183
+ - kimi-css/ β€” styles and themes
184
+ - kimi-plugins/ β€” local plugins (sample-theme, sample-behavior, sample-voice)
185
+ - kimi-locale/ β€” translations and i18n files
186
+ - dexie.min.js β€” local DB helper
187
+
188
+ ### Data Flow
189
+
190
+ 1. **Input Processing**: User input β†’ Security validation β†’ Language detection
191
+ 2. **AI Analysis**: Emotion detection β†’ Memory extraction β†’ LLM processing
192
+ 3. **Response Generation**: Personality-aware response β†’ Emotion mapping β†’ Visual selection
193
+ 4. **Memory Update**: Trait evolution β†’ Memory storage β†’ UI synchronization
194
+
195
+ ## Installation & Setup
196
+
197
+ ### Prerequisites
198
+
199
+ - Modern web browser (Chrome, Edge or recent Firefox recommended). The app is plain HTML/CSS/JS and runs locally in a browser β€” no build step is required.
200
+ - (Optional) OpenRouter API key or another compatible provider API key if you want remote LLM access. The app can run without a key using local-only features, but AI responses will be limited.
201
+ - HTTPS is required for microphone access and some browser TTS features. For full voice/microphone features, open the app via a local server (see Quick Start). If you only open `index.html` directly, most features still work but microphone may be blocked by the browser.
202
+ - Dexie.js is included for IndexedDB persistence (no installation required; file `dexie.min.js` is bundled).
203
+
204
+ ### Quick Start
205
+
206
+ 1. **Clone the repository**
207
+
208
+ ```bash
209
+ git clone https://github.com/virtualkimi/virtual-kimi.git
210
+ cd virtual-kimi
211
+ ```
212
+
213
+ 2. **Open the application**
214
+
215
+ - Open `index.html` in your web browser
216
+ - Or serve via local web server for optimal performance:
217
+ ```bash
218
+ python -m http.server 8000
219
+ # Navigate to http://localhost:8000
220
+ ```
221
+
222
+ 3. **Configure API access**
223
+
224
+ - Open Settings β†’ AI & Models
225
+ - Provider: choose the LLM provider to use. Supported options in the app include `openrouter` (recommended), `openai`/OpenAI-compatible endpoints, and `ollama` (local). The selected provider is saved in the app preferences.
226
+ - API key: paste your provider API key into the API Key field. Keys are saved locally in your browser's IndexedDB (preferences) so they never leave your machine except when the app sends requests to the selected provider.
227
+ - Base URL: if you use a non‑default provider or an OpenAI-compatible endpoint, set the provider base URL (Settings β†’ AI & Models β†’ Base URL). This overrides the built-in default endpoints.
228
+ - Model selection: choose a model ID from the list. The app's authoritative model list is defined in `kimi-js/kimi-llm-manager.js`. If the provider does not support the selected model, the app will attempt a best-match fallback or show an error.
229
+ - Test API key: use the app's built-in test function (Settings β†’ Test API) to validate your key; this performs a minimal request and reports success or the provider error message.
230
+ - Local (Ollama) usage: to use a local model with `ollama`, run your local Ollama-compatible server (the app uses `http://localhost:11434/api/chat`). Select provider `ollama` and set model ID accordingly. Local models are experimental and work only if the local server is running.
231
+ - No key behavior: the app runs without an API key for local UI features and stored data, but remote LLM responses require a valid provider/key. If no key is configured the app will return friendly fallback messages for AI features.
232
+
233
+ Troubleshooting notes:
234
+
235
+ - If you see HTTP 401: verify the API key for the selected provider.
236
+ - If you see HTTP 429 or rate-limit errors: wait a moment or choose a different model/provider account.
237
+ - If the model is reported as unavailable (422-like errors): verify the model ID and, if needed, refresh the remote model list in Settings.
238
+ - For OpenRouter-specific issues: check the Base URL is `https://openrouter.ai/api/v1/chat/completions` (default) unless you use a custom endpoint.
239
+
240
+ 4. **Customize your experience**
241
+ - Choose your language and preferred voice
242
+ - Choose a character in Personality tab
243
+ - Enable memory system in Data tab
244
+ - Adjust themes and UI opacity in Appearance tab
245
+
246
+ ### Production Deployment
247
+
248
+ For production deployment, ensure:
249
+
250
+ - HTTPS is enabled (required for microphone access)
251
+ - Gzip compression for assets
252
+ - Proper cache headers
253
+ - CSP headers for enhanced security
254
+
255
+ ## βš™οΈ Configuration
256
+
257
+ ### API Integration
258
+
259
+ The application supports multiple AI providers; choose and configure your provider in Settings β†’ AI & Models.
260
+
261
+ - Mistral models
262
+ - Nous Hermes models
263
+ - Qwen3 models
264
+ - xAI models
265
+ - Open-source alternatives
266
+
267
+ ### Memory System Configuration
268
+
269
+ ```javascript
270
+ // Memory categories can be customized
271
+ const memoryCategories = [
272
+ "personal", // Personal information
273
+ "preferences", // Likes and dislikes
274
+ "relationships", // People and connections
275
+ "activities", // Hobbies and activities
276
+ "goals", // Aspirations and plans
277
+ "experiences", // Past events
278
+ "important" // Significant moments
279
+ ];
280
+ ```
281
+
282
+ ## πŸ› οΈ Development
283
+
284
+ ### Project Structure
285
+
286
+ ```
287
+ <repo root>
288
+ β”œβ”€β”€ index.html
289
+ β”œβ”€β”€ README.md
290
+ β”œβ”€β”€ LICENSE.md
291
+ β”œβ”€β”€ package.json
292
+ β”œβ”€β”€ kimi-js/ # core JS modules (kimi-*.js)
293
+ β”œβ”€β”€ kimi-locale/ # translations (en.json, fr.json, ...)
294
+ β”œβ”€β”€ kimi-plugins/ # plugin examples
295
+ β”œβ”€β”€ kimi-videos/ # character video clips
296
+ β”œβ”€β”€ kimi-icons/ # image assets and favicons
297
+ └── dexie.min.js # IndexedDB helper
298
+ ```
299
+
300
+ ### Adding New Features
301
+
302
+ #### Creating a New Plugin
303
+
304
+ ```javascript
305
+ // manifest.json
306
+ {
307
+ "name": "Custom Theme",
308
+ "version": "1.0.0",
309
+ "type": "theme",
310
+ "style": "theme.css",
311
+ "main": "theme.js",
312
+ "enabled": true
313
+ }
314
+ ```
315
+
316
+ > **Note:** As of version 1.0, only the color theme plugin is fully functional. Voice and behavior plugins are planned for future releases. See `kimi-plugins/sample-theme/` for a working example.
317
+
318
+ #### Extending Memory Categories
319
+
320
+ ```javascript
321
+ // Add to kimi-memory-system.js
322
+ const customCategory = {
323
+ name: "custom",
324
+ icon: "fas fa-star",
325
+ keywords: ["keyword1", "keyword2"],
326
+ confidence: 0.7
327
+ };
328
+ ```
329
+
330
+ ### Health Check System
331
+
332
+ The application includes a comprehensive health check system:
333
+
334
+ ```javascript
335
+ // Run health check
336
+ const healthCheck = new KimiHealthCheck();
337
+ const report = await healthCheck.runAllChecks();
338
+ console.log(report.status); // 'HEALTHY' or 'NEEDS_ATTENTION'
339
+ ```
340
+
341
+ ## Browser Compatibility
342
+
343
+ | Browser | Voice Recognition | Full Features | Notes |
344
+ | ----------- | ----------------- | ------------- | ------------------------- |
345
+ | Chrome 90+ | βœ… | βœ… | Recommended |
346
+ | Edge 90+ | βœ… | βœ… | Optimal voice performance |
347
+ | Firefox 88+ | ⚠️ | βœ… | Limited voice support |
348
+ | Safari 14+ | ⚠️ | βœ… | iOS limitations |
349
+
350
+ ## Performance
351
+
352
+ ### Optimization Features
353
+
354
+ - Lazy loading of non-critical modules
355
+ - Efficient batch database operations
356
+ - Debounced UI interactions
357
+ - Memory management with cleanup
358
+ - Optimized video preloading
359
+
360
+ ### Resource Usage
361
+
362
+ - Memory footprint: ~15-30MB active usage
363
+ - Storage: Scales with conversation history
364
+ - Network: API calls only, no tracking
365
+ - CPU: Minimal background processing
366
+
367
+ ## Privacy & Security
368
+
369
+ ### Data Handling
370
+
371
+ - All data stored locally in browser
372
+ - No telemetry or analytics
373
+ - API keys in your local storage
374
+ - User content never sent to external servers (except chosen AI provider)
375
+
376
+ ### Security Measures
377
+
378
+ - Input validation and sanitization
379
+ - XSS protection
380
+ - Safe plugin loading
381
+ - Secure API communication
382
+
383
+ ## Troubleshooting
384
+
385
+ ### Common Issues
386
+
387
+ - **Microphone not working**: Ensure HTTPS and browser permissions
388
+ - **API errors / provider issues**: Verify the API key and selected provider for the chosen model. This app supports multiple providers (OpenRouter, OpenAI-compatible endpoints, Groq, Together, Cohere, Anthropic, local/Ollama, etc.). Make sure the provider-specific base URL, model ID and API key are correctly configured in Settings β†’ AI & Models.
389
+ - **Text-to-Speech (TTS) voices**: The app uses the browser Web Speech API for TTS. For best voice support, use modern Chromium-based browsers (Edge or Chrome) which generally provide better built-in voices and compatibility. If voices are missing or sound low quality, try Edge/Chrome or install additional TTS engines on your system.
390
+ - **Performance issues**: Clear browser cache, check available memory
391
+ - **Memory system not learning**: Ensure system is enabled in Data tab
392
+
393
+ ## Contributing
394
+
395
+ We welcome contributions! Please see our contributing guidelines:
396
+
397
+ 1. Fork the repository
398
+ 2. Create a feature branch
399
+ 3. Make your changes with appropriate tests
400
+ 4. Submit a pull request with detailed description
401
+
402
+ ### Development Guidelines
403
+
404
+ - Follow existing code style and patterns
405
+ - Add comments for complex functionality
406
+ - Test across multiple browsers
407
+ - Update documentation for new features
408
+
409
+ ## πŸ”„ TODO / Roadmap (current priorities)
410
+
411
+ - [ ] Full support for local models (Ollama integration β€” currently experimental)
412
+ - [ ] Voice plugin system (custom voices, TTS engines) β€” planned
413
+ - [ ] Behavior plugin system (custom AI behaviors) β€” planned
414
+ - [ ] Improve advanced memory management UI and ranked memory snapshot features (in-progress)
415
+ - [ ] More character personalities and backgrounds
416
+ - [ ] In-app onboarding and help system
417
+ - [ ] Better mobile UI/UX and accessibility improvements
418
+ - [ ] More granular privacy controls and explicit user consent flows
419
+ - [ ] Automated testing and CI/CD pipeline (unit + basic UI tests)
420
+ - [ ] Performance profiling and optimization for large conversation histories
421
+ - [ ] Documentation updates to reflect implemented features (models, API handling, plugin validation)
422
+
423
+ ## πŸ“œ License
424
+
425
+ This project is distributed under a custom license. **Any commercial use, resale, or monetization of this application or its derivatives is strictly prohibited without the explicit written consent of the author.**
426
+
427
+ See the [LICENSE](LICENSE) file for details.
428
+
429
+ [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
430
+ [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
431
+
432
+ ---
433
+
434
+ **Virtual Kimi** - Creating meaningful connections between humans and AI, one conversation at a time.
435
+
436
+ > _"Love is the most powerful code"_ πŸ’•
437
+ >
438
+ > β€” 2025 Virtual Kimi - Created with πŸ’œ by Jean & Kimi