VirtualKimi commited on
Commit
cf5994e
Β·
verified Β·
1 Parent(s): cca63cc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +436 -6
README.md CHANGED
@@ -1,10 +1,440 @@
1
  ---
2
- title: Test2
3
- emoji: πŸ“‰
4
- colorFrom: gray
5
- colorTo: pink
6
  sdk: static
7
- pinned: false
 
 
 
 
8
  ---
 
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: openrail
 
 
 
3
  sdk: static
4
+ emoji: 😻
5
+ colorFrom: indigo
6
+ colorTo: purple
7
+ pinned: true
8
+ short_description: Virtual Kimi - AI Companion Application πŸ’–
9
  ---
10
+ <div align="center">
11
 
12
+ <b>Virtual Kimi</b>
13
+
14
+ [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
15
+ [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
16
+
17
+ </div>
18
+
19
+ # Virtual Kimi - AI Companion Application πŸ’–
20
+
21
+ A web-based AI companion featuring adaptive personalities, intelligent memory systems, and immersive conversational experiences.
22
+
23
+ ## Overview
24
+
25
+ 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 personalities.
26
+
27
+ - **Lightweight:** ~600 KB of pure JavaScript, HTML, and CSS (no frameworks)
28
+ - **Local-first:** All data is stored in your browser's IndexedDB (managed by Dexie.js)
29
+ - **No tracking:** The only external calls are to FontAwesome (for icons) and the OpenRouter API (for AI)
30
+
31
+ Built with vanilla JavaScript and modern web APIs, it offers a rich, responsive experience across devices.
32
+
33
+ ---
34
+
35
+ ## 🌐 Support & Links
36
+
37
+ - **Website**: [virtualkimi.com](https://virtualkimi.com)
38
+ - **Email**: [ijohn@virtualkimi.com](ijohn@virtualkimi.com)
39
+ - **X (Twitter)**: [x.com/virtualkimi](https://x.com/virtualkimi)
40
+ - **GitHub**: [github.com/virtualkimi](https://github.com/virtualkimi)
41
+ - **HuggingFace**: [huggingface.co/VirtualKimi](https://huggingface.co/VirtualKimi)
42
+ - **YouTube**: [YouTube Channel](https://www.youtube.com/@VirtualKimi)
43
+
44
+ - **Support the project**: [ko-fi.com/virtualkimi](https://ko-fi.com/virtualkimi)
45
+ _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!_
46
+
47
+ - **ETH Wallet**: 0x836C9D2e605f98Bc7144C62Bef837627b1a9C30c
48
+
49
+ ---
50
+
51
+ ## Key Features
52
+
53
+ ### πŸ€– **Advanced AI Integration**
54
+
55
+ - Support for affordable, less-censored LLM models via OpenRouter (see below for available models)
56
+ - Version 1.0.4 added support for some LLMs providers
57
+
58
+ **Available models and pricing (per 1M tokens):**
59
+
60
+ - **Mistral-small-3.2**: 0.05$ input, 0.1$ output (128k context)
61
+ - **Nous Hermes Llama 3.1 70B**: 0.1$ input, 0.28$ output (131k context)
62
+ - **Cohere Command-R-08-2024**: 0.15$ input, 0.6$ output (131k context)
63
+ - **Qwen3-235b-a22b-think**: 0.13$ input, 0.6$ output (262k context)
64
+ - **Nous Hermes Llama 3.1 405B**: 0.7$ input, 0.8$ output (131k context)
65
+ - **Anthropic Claude 3 Haiku**: 0.25$ input, 1.25$ output (131k context)
66
+ - **Local Model (Ollama)**: 0$ input, 0$ output (4k context, runs offline β€” _experimental, not fully functional yet_)
67
+
68
+ ### πŸ‘₯ **Multiple AI Personalities**
69
+
70
+ - **Kimi**: Cosmic dreamer and astrophysicist with ethereal sensibilities
71
+ - **Bella**: Nurturing botanist who sees people as plants needing care
72
+ - **Rosa**: Chaotic prankster thriving on controlled chaos
73
+ - **Stella**: Digital artist transforming reality through pixelated vision
74
+
75
+ ### Personality Trait Ranges
76
+
77
+ All personality traits operate on a 0-100 scale:
78
+
79
+ - **Affection**: Emotional warmth and attachment
80
+ - **Playfulness**: Fun-loving and spontaneous behavior
81
+ - **Intelligence**: Analytical and thoughtful responses
82
+ - **Empathy**: Understanding and emotional support
83
+ - **Humor**: Wit and lighthearted interactions
84
+ - **Romance**: Romantic and intimate expressions
85
+
86
+ ### 🧠 **Intelligent Memory System**
87
+
88
+ - Automatic extraction and categorization of conversation memories
89
+ - Seven memory categories: Personal, Preferences, Relationships, Activities, Goals, Experiences, Events
90
+ - Persistent memory across sessions with search and management capabilities
91
+ - Character-specific memory isolation
92
+
93
+ ### πŸ’« **Dynamic Personality Evolution**
94
+
95
+ - Six personality traits that evolve based on interactions:
96
+ - Affection, Playfulness, Intelligence, Empathy, Humor, Romance
97
+ - Real-time trait adjustments based on conversation tone and content
98
+ - Visual personality indicators and progression tracking
99
+ - Intelligent model selection and switching
100
+ - Real-time emotion detection and analysis
101
+ - Contextually-aware responses
102
+
103
+ ### 🎬 **Emotion-Driven Visual Experience**
104
+
105
+ - Real-time video responses matching detected emotions
106
+ - Smooth transitions between emotional states
107
+ - Character-specific visual libraries with 50+ video clips
108
+ - Context-aware video selection system
109
+
110
+ ### 🎨 **Customizable Interface**
111
+
112
+ - Five professionally designed themes
113
+ - Adjustable interface transparency
114
+ - Responsive design optimized for desktop, tablet, and mobile
115
+ - Accessibility features and keyboard navigation
116
+
117
+ ### 🌍 **Multilingual Support**
118
+
119
+ - Full localization in 7 languages: English, French, Spanish, German, Italian, Japanese, Chinese
120
+ - Automatic language detection from user input
121
+ - Culturally-aware responses and emotion keywords
122
+
123
+ ### πŸ”Œ **Extensible Plugin System**
124
+
125
+ - Theme plugins for visual customization (currently, only the color theme plugin is functional)
126
+ - Voice plugins for speech synthesis options (planned)
127
+ - Behavior plugins for personality modifications (planned)
128
+ - Secure plugin loading with validation
129
+
130
+ ### πŸ›‘οΈ **Security & Privacy**
131
+
132
+ - Input validation and sanitization
133
+ - Secure API key handling
134
+ - Local data storage with IndexedDB
135
+ - No server dependencies for core functionality
136
+
137
+ ## πŸ—οΈ Technical Architecture
138
+
139
+ ### 🧩 Core Technologies
140
+
141
+ - **Frontend**: Vanilla JavaScript (ES6+), HTML5, CSS3
142
+ - **Database**: IndexedDB with Dexie.js
143
+ - **AI Integration**: OpenRouter API
144
+ - **Speech**: Web Speech API
145
+ - **Audio**: Web Audio API
146
+
147
+ ---
148
+
149
+ ## ✨ Inspiration & Assets
150
+
151
+ This project was originally inspired by the [JackyWine GitHub repository](https://github.com/Jackywine).
152
+ @Jackywine on X (Twitter)
153
+
154
+ The four main characters are visually based on images from four creators on X (Twitter):
155
+
156
+ - @JulyFox33 (Kimi)
157
+ - @BelisariaNew (Bella)
158
+ - @JuliAIkiko (Rosa and Stella)
159
+
160
+ All character videos were generated using the image-to-video AI from Kling.ai, specifically with the Kling v2.1 model.
161
+
162
+ 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)
163
+
164
+ ---
165
+
166
+ ### πŸ—‚οΈ Module Structure
167
+
168
+ ```
169
+
170
+ β”œβ”€β”€ Core System
171
+ β”‚ β”œβ”€β”€ kimi-script.js # Main initialization
172
+ β”‚ β”œβ”€β”€ kimi-database.js # Data persistence layer
173
+ β”‚ β”œβ”€β”€ kimi-config.js # Configuration management
174
+ β”‚ └── kimi-security.js # Security utilities
175
+ β”œβ”€β”€ AI & Memory
176
+ β”‚ β”œβ”€β”€ kimi-llm-manager.js # LLM integration
177
+ β”‚ β”œβ”€β”€ kimi-emotion-system.js # Emotion analysis
178
+ β”‚ β”œβ”€β”€ kimi-memory-system.js # Intelligent memory
179
+ β”‚ └── kimi-memory-ui.js # Memory interface
180
+ β”œβ”€β”€ Interface & Media
181
+ β”‚ β”œβ”€β”€ kimi-appearance.js # Theme management
182
+ β”‚ β”œβ”€β”€ kimi-voices.js # Speech synthesis
183
+ β”‚ β”œβ”€β”€ kimi-utils.js # Utility classes
184
+ β”‚ └── kimi-module.js # Core functions
185
+ β”œβ”€β”€ Localization
186
+ β”‚ └── kimi-locale/ # Translation files
187
+ └── Extensions
188
+ └── kimi-plugins/ # Plugin system
189
+
190
+ ```
191
+
192
+ ### Data Flow
193
+
194
+ 1. **Input Processing**: User input β†’ Security validation β†’ Language detection
195
+ 2. **AI Analysis**: Emotion detection β†’ Memory extraction β†’ LLM processing
196
+ 3. **Response Generation**: Personality-aware response β†’ Emotion mapping β†’ Visual selection
197
+ 4. **Memory Update**: Trait evolution β†’ Memory storage β†’ UI synchronization
198
+
199
+ ## Installation & Setup
200
+
201
+ ### Prerequisites
202
+
203
+ - Modern web browser (Chrome, Edge, Firefox recommended)
204
+ - OpenRouter API key (optional but recommended for full functionality)
205
+
206
+ ### Quick Start
207
+
208
+ 1. **Clone the repository**
209
+
210
+ ```bash
211
+ git clone https://github.com/virtualkimi/virtual-kimi.git
212
+ cd virtual-kimi
213
+ ```
214
+
215
+ 2. **Open the application**
216
+
217
+ - Open `index.html` in your web browser
218
+ - Or serve via local web server for optimal performance:
219
+ ```bash
220
+ python -m http.server 8000
221
+ # Navigate to http://localhost:8000
222
+ ```
223
+
224
+ 3. **Configure API access**
225
+
226
+ - Open Settings β†’ AI & Models
227
+ - Add your OpenRouter API key
228
+ - Select preferred AI model
229
+
230
+ 4. **Customize your experience**
231
+ - Choose a character in Personality tab
232
+ - Enable memory system in Data tab
233
+ - Adjust themes in Appearance tab
234
+
235
+ ### Production Deployment
236
+
237
+ For production deployment, ensure:
238
+
239
+ - HTTPS is enabled (required for microphone access)
240
+ - Gzip compression for assets
241
+ - Proper cache headers
242
+ - CSP headers for enhanced security
243
+
244
+ ## βš™οΈ Configuration
245
+
246
+ ### API Integration
247
+
248
+ The application supports multiple AI providers through OpenRouter:
249
+
250
+ - Mistral models
251
+ - Nous Hermes models
252
+ - Qwen3 models
253
+ - Open-source alternatives
254
+
255
+ ### Memory System Configuration
256
+
257
+ ```javascript
258
+ // Memory categories can be customized
259
+ const memoryCategories = [
260
+ "personal", // Personal information
261
+ "preferences", // Likes and dislikes
262
+ "relationships", // People and connections
263
+ "activities", // Hobbies and activities
264
+ "goals", // Aspirations and plans
265
+ "experiences", // Past events
266
+ "important" // Significant moments
267
+ ];
268
+ ```
269
+
270
+ ## πŸ› οΈ Development
271
+
272
+ ### Project Structure
273
+
274
+ ```
275
+ virtual-kimi/
276
+ β”œβ”€β”€ index.html # Main application
277
+ β”œβ”€β”€ virtualkimi.html # Landing page
278
+ β”œβ”€β”€ kimi-*.js # Core modules
279
+ β”œβ”€β”€ kimi-locale/ # Localization
280
+ β”œβ”€β”€ kimi-plugins/ # Plugin examples
281
+ β”œβ”€β”€ kimi-videos/ # Character videos
282
+ β”œβ”€β”€ kimi-icons/ # Character assets
283
+ └── docs/ # Documentation
284
+ ```
285
+
286
+ ### Adding New Features
287
+
288
+ #### Creating a New Plugin
289
+
290
+ ```javascript
291
+ // manifest.json
292
+ {
293
+ "name": "Custom Theme",
294
+ "version": "1.0.0",
295
+ "type": "theme",
296
+ "style": "theme.css",
297
+ "main": "theme.js",
298
+ "enabled": true
299
+ }
300
+ ```
301
+
302
+ > **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.
303
+
304
+ #### Extending Memory Categories
305
+
306
+ ```javascript
307
+ // Add to kimi-memory-system.js
308
+ const customCategory = {
309
+ name: "custom",
310
+ icon: "fas fa-star",
311
+ keywords: ["keyword1", "keyword2"],
312
+ confidence: 0.7
313
+ };
314
+ ```
315
+
316
+ ### Health Check System
317
+
318
+ The application includes a comprehensive health check system:
319
+
320
+ ```javascript
321
+ // Run health check
322
+ const healthCheck = new KimiHealthCheck();
323
+ const report = await healthCheck.runAllChecks();
324
+ console.log(report.status); // 'HEALTHY' or 'NEEDS_ATTENTION'
325
+ ```
326
+
327
+ ## Browser Compatibility
328
+
329
+ | Browser | Voice Recognition | Full Features | Notes |
330
+ | ----------- | ----------------- | ------------- | ------------------------- |
331
+ | Chrome 90+ | βœ… | βœ… | Recommended |
332
+ | Edge 90+ | βœ… | βœ… | Optimal voice performance |
333
+ | Firefox 88+ | ⚠️ | βœ… | Limited voice support |
334
+ | Safari 14+ | ⚠️ | βœ… | iOS limitations |
335
+
336
+ ## Performance
337
+
338
+ ### Optimization Features
339
+
340
+ - Lazy loading of non-critical modules
341
+ - Efficient batch database operations
342
+ - Debounced UI interactions
343
+ - Memory management with cleanup
344
+ - Optimized video preloading
345
+
346
+ ### Resource Usage
347
+
348
+ - Memory footprint: ~15-30MB active usage
349
+ - Storage: Scales with conversation history
350
+ - Network: API calls only, no tracking
351
+ - CPU: Minimal background processing
352
+
353
+ ## Privacy & Security
354
+
355
+ ### Data Handling
356
+
357
+ - All data stored locally in browser
358
+ - No telemetry or analytics
359
+ - API keys encrypted in local storage
360
+ - User content never sent to external servers (except chosen AI provider)
361
+
362
+ ### Security Measures
363
+
364
+ - Input validation and sanitization
365
+ - XSS protection
366
+ - Safe plugin loading
367
+ - Secure API communication
368
+
369
+ ## Troubleshooting
370
+
371
+ ### Common Issues
372
+
373
+ - **Microphone not working**: Ensure HTTPS and browser permissions
374
+ - **API errors**: Verify OpenRouter key and model availability
375
+ - **Performance issues**: Clear browser cache, check available memory
376
+ - **Memory system not learning**: Ensure system is enabled in Data tab
377
+
378
+ ### Debug Mode
379
+
380
+ Enable debug logging in browser console:
381
+
382
+ ```javascript
383
+ window.KIMI_DEBUG = true;
384
+ ```
385
+
386
+ ## Contributing
387
+
388
+ We welcome contributions! Please see our contributing guidelines:
389
+
390
+ 1. Fork the repository
391
+ 2. Create a feature branch
392
+ 3. Make your changes with appropriate tests
393
+ 4. Submit a pull request with detailed description
394
+
395
+ ### Development Guidelines
396
+
397
+ - Follow existing code style and patterns
398
+ - Add comments for complex functionality
399
+ - Test across multiple browsers
400
+ - Update documentation for new features
401
+
402
+ ## πŸ”„ TODO / Roadmap
403
+
404
+ - [ ] Full support for local models (Ollama integration, offline mode)
405
+ - [ ] Voice plugin system (custom voices, TTS engines)
406
+ - [ ] Behavior plugin system (custom AI behaviors)
407
+ - [ ] Better advanced memory management UI
408
+ - [ ] More character personalities and backgrounds
409
+ - [ ] In-app onboarding and help system
410
+ - [ ] Enhanced mobile experience (UI/UX)
411
+ - [ ] More granular privacy controls
412
+ - [ ] User profile and persistent settings sync (optional)
413
+ - [ ] Community plugin/theme sharing platform
414
+ - [ ] Improved error reporting and diagnostics
415
+ - [ ] Accessibility improvements (screen reader, contrast, etc.)
416
+ - [ ] Automated testing and CI/CD pipeline
417
+ - [ ] Documentation in multiple languages
418
+ - [ ] Performance profiling and optimization for large histories
419
+ - [ ] Create new character videos better matching specific contexts
420
+ - [ ] Improve emotion and context logic
421
+ - [ ] Enhance memory management and logic
422
+
423
+ ---
424
+
425
+ ## πŸ“œ License
426
+
427
+ 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.**
428
+
429
+ See the [LICENSE](LICENSE) file for details.
430
+
431
+ [![Open Source](https://img.shields.io/badge/Open%20Source-GitHub-brightgreen?style=flat-square&logo=github)](https://github.com/virtualkimi)
432
+ [![No Commercial Use](https://img.shields.io/badge/No%20Commercial%20Use-%F0%9F%9A%AB-red?style=flat-square)](#license)
433
+
434
+ ---
435
+
436
+ **Virtual Kimi** - Creating meaningful connections between humans and AI, one conversation at a time.
437
+
438
+ > _"Love is the most powerful code"_ πŸ’•
439
+ >
440
+ > β€” 2025 Virtual Kimi - Created with πŸ’œ by Jean & Kimi