- General Questions
- Installation & Setup
- API Keys & Providers
- Personalities
- Text-to-Speech (TTS)
- Conversations
- Gang System
- Drug Economy
- Weapons System
- Performance & Optimization
- Troubleshooting
- Advanced Features
The Criminal Minds Framework is an advanced AI personality simulation platform that allows you to create, manage, and interact with multiple AI personalities. It includes unique features like autonomous conversations, prison gang dynamics, drug economy simulation, and voice cloning.
- Researchers: Study multi-agent AI interactions and social dynamics
- Developers: Build AI-powered applications and experiments
- Creatives: Generate dialogue and narratives
- Educators: Create interactive learning experiences
- Enthusiasts: Explore advanced AI capabilities
The framework itself is free and open-source. However, you'll need API keys for AI providers (Google Gemini, OpenAI, or Claude), which have their own costs:
- Google Gemini: Free tier available, then pay-as-you-go
- OpenAI: Pay-as-you-go (~$0.002-0.03 per 1K tokens)
- Local Models: Completely free if you have the hardware
- Multiple Personalities: Load and manage 8+ AI personalities simultaneously
- Autonomous Conversations: AI personalities talk to each other without your input
- Social Dynamics: Gangs, relationships, loyalty, violence simulation
- Voice Cloning: Free self-hosted or premium cloud TTS
- Experimental Psychology: Research-grade gang simulation features
- Full Control: Customize every aspect of personality behavior
Minimum:
- Node.js v18+
- 4GB RAM
- 1GB storage
- Internet connection
Recommended:
- Node.js v20+
- 8GB RAM
- 5GB storage
- Broadband internet
No GPU is required for basic usage. A GPU is only beneficial for:
- Self-hosted TTS (significantly faster voice generation)
- Local AI models (faster inference)
Yes! Use local AI models with llama.cpp and self-hosted TTS (CPU-based). You'll need to download models once with internet, then you can run offline.
- Basic Setup: 5-10 minutes
- With Self-Hosted TTS: 15-20 minutes (first-time model download)
- With Local AI Models: 20-30 minutes (model download)
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm installGoogle Gemini (Recommended):
- ✅ Free tier available
- ✅ High quality
- ✅ Fast responses
- ✅ 60 requests/minute free
OpenAI:
- ✅ Very consistent quality
- ✅ Good for JSON responses
- ❌ More expensive
Local Models:
- ✅ Completely free
- ✅ No internet needed
- ✅ Complete privacy
- ❌ Requires powerful hardware
Google Gemini:
- Visit https://ai.google.dev/
- Click "Get API Key"
- Create project and copy key
OpenAI:
- Visit https://platform.openai.com/api-keys
- Create new secret key
- Copy immediately (can't view again)
ElevenLabs:
- Visit https://elevenlabs.io/
- Sign up
- Profile → API Keys
api-keys.jsonis in.gitignoreand never committed- Keys are stored locally only
- For production, use environment variables
- Never share your
api-keys.jsonfile
Yes! Each personality can use a different provider if configured. The default provider is set globally but can be overridden per personality.
Typical Usage (1 hour conversation):
- Google Gemini: $0.01 - $0.10
- OpenAI GPT-4: $0.50 - $2.00
- OpenAI GPT-3.5: $0.05 - $0.20
- Local Models: $0.00 (free)
Track usage with: api usage command
The framework supports up to 8 personalities simultaneously for optimal performance. You can load more, but performance may degrade.
Built-in: The framework includes several pre-made personalities in public/personalities/
Create Your Own: Use the personality creator in the UI or create manually
Import: Load ZIP files containing personality data
Method 1: UI (Easiest)
- Click "+" button in Personality Panel
- Fill in name, knowledge, prompt
- Assign voice ID
- Click Save
Method 2: CLI
personality create "Name" "background info" "You are..."Method 3: Manual (Advanced)
- Create folder:
personalities/Name/ - Add
personality.jsonwith configuration - Add
profile.png(optional) - Zip the folder
- Place in
public/personalities/
✅ Good:
You are Tony Blair, former UK Prime Minister (1997-2007).
You are charismatic, articulate, and defensive about the Iraq War.
You speak with confidence and occasionally deflect criticism with rhetoric.
Key traits: persuasive, controversial, polarizing.
❌ Bad:
You are Tony.
Tips:
- Include historical context
- Define speaking style
- List key personality traits
- Mention notable events/controversies
- Add behavioral patterns
Yes! Conversation history is maintained for each personality. You can also enable:
- Cross-Conversation Context: Share memory across different chat windows
- Long-Term Memory: Weighted influence from older conversations
Enable in: Settings → Experimental
personality delete tony_blairOr manually delete the ZIP file from public/personalities/ and reload.
| Provider | Best For | Cost |
|---|---|---|
| Browser TTS | Quick testing | Free |
| Self-Hosted | Best quality & free | Free (hardware only) |
| ElevenLabs | Premium quality, no setup | $22-330/month |
| OpenAI TTS | Good balance | $15/million chars |
Recommendation: Self-hosted for best value (excellent quality, zero cost)
# 1. Install dependencies
pip install -r scripts/requirements-tts.txt
# 2. Start server
python scripts/coqui-xtts-server.py
# 3. Configure in app
Settings → TTS → Self-Hosted → API URL: http://localhost:8000Full guide: SELF-HOSTED-TTS-QUICKSTART.md
Requirements:
- 10-30 second audio sample (WAV format)
- Clear voice with minimal background noise
- Single speaker only
Method 1: Web Interface
- Open http://localhost:8000/docs
- POST /clone endpoint
- Upload audio file
- Enter name (e.g.,
tony_blair)
Method 2: Command Line
curl -X POST "http://localhost:8000/clone?name=tony_blair" \
-F "audio=@voice_sample.wav"Possible causes:
- Running on CPU instead of GPU (30-60 seconds per generation)
- Large text chunks (break into smaller pieces)
- Server overload (too many concurrent requests)
Solutions:
- Install CUDA + PyTorch with GPU support
- Use ElevenLabs or OpenAI TTS (cloud, faster)
- Reduce text length
Yes! Assign voice IDs per personality:
tts voice tony_blair "Tony Blair Voice"
tts voice jimmy_savile "Jimmy Savile Voice"Or set in personality configuration:
{
"config": {
"voiceId": "tony_blair"
}
}Manual Conversation:
- Load personalities
- Click on a personality
- Type message and press Enter
Autonomous Conversation:
auto start tony_blair jimmy_savile katie_price
auto topic "Discuss your biggest regrets"Manual:
- You control the conversation
- Type messages yourself
- AI responds to you
Autonomous:
- AI personalities talk to each other
- No user input needed
- You observe and can set topics
conversation length short # 5-8 exchanges
conversation length medium # 10-15 exchanges
conversation length long # 20-30 exchangesPersonalities must be linked to see each other:
# Link two personalities
link tony_blair jimmy_savile
# Link all (group conversation)
link allThis simulates "knowing" each other. Unlinked personalities can't interact.
# Pause (can resume later)
auto pause
# Skip current speaker
auto skip
# Stop completely
auto stopYes! Use Forced Topic Mode:
# Set topic
topic force "Discuss prison reform policies"
# Or when starting conversation
auto start tony_blair jimmy_savile
auto topic "Debate Brexit outcomes"In Settings → Experimental, you can also set a global forced topic.
A research-grade simulation of prison gang dynamics including:
- Gang formation and hierarchies
- Territory control
- Violence and solitary confinement
- Loyalty and respect systems
- Drug economy
- Weapons and guard bribery
- Settings → Experimental
- Enable "Prison Gangs Simulation"
- Configure number of gangs (2-6)
- Set gang names and colors
- Assign leaders and members
- Click Save
2 Gangs: Best for studying rivalry and conflict
3-4 Gangs: Good balance of dynamics
5-6 Gangs: Complex politics but can be chaotic
Start with 2-3 for your first simulation.
Gang-Level:
- Territory: % of prison controlled (affects resources)
- Resources: Gang power/wealth (0-100)
- Reputation: Fear/respect factor (0-100)
- Violence: Aggression tendency (0-100)
- Loyalty: Member cohesion (0-100)
Member-Level:
- Loyalty: Dedication to gang (0-100)
- Respect: Standing among peers (0-100)
- Violence: Individual aggression (0-100)
- Hits: Violence actions taken
- Status: Active or in solitary
Triggers:
- Hostile language between rival gang members
- Random violence events (based on violence frequency)
- Territory wars
- Drug deals gone wrong
- Weapon theft attempts
Consequences:
- Victim loses respect
- Aggressor gains respect
- Gang reputation changes
- 3+ hits → solitary confinement
- If death enabled → potential death
Yes, if you enable the death system:
- Settings → Experimental → Prison Gangs
- Enable "Death Enabled"
- Set Death Probability (0.0-1.0)
Death probability increases with:
- High violence frequency
- Weapon usage
- Multiple hits taken
- Low gang protection
When a member dies, they are removed from conversations and marked as [KILLED].
Active Recruitment (conversation-based):
- Positive interactions between gang members and independents
- Sentiment analysis detects recruitment opportunities
- 15% chance per positive interaction
Random Recruitment (background):
- 5% chance every 5 seconds if enabled
- Based on gang reputation
- Relationship affinity
- Current gang loyalty
Punishment for violent behavior:
- Triggered after 3+ hits
- Duration: 30-120 seconds (configurable)
- Member can't participate while imprisoned
- Shown with
[SOLITARY]badge and lock icon - Auto-released after timeout
Gangs can:
- Smuggle drugs into prison (10-50 grams)
- Deal drugs for money ($20-50 per gram)
- Buy items with drug money ($80-500)
- Steal items from rival gangs
All activities have detection risks by guards.
- Enable Prison Gangs first
- Settings → Experimental → Prison Gangs
- Scroll to Drug Economy
- Enable "Drug Economy System"
- Set frequencies (0.0-1.0)
- Click Save
Smuggling (caught):
- Drugs confiscated
- Gang reputation -10
- 60% chance of solitary (1 minute)
- Sentence extended
Dealing (caught):
- Drugs confiscated
- 30% chance of solitary (45 seconds)
- No money earned
| Item | Cost | Benefits |
|---|---|---|
| Prostitute Visit | $500 | +20 loyalty, +10 respect |
| Beer Case | $200 | +15 loyalty, +5 respect |
| Cigarettes | $100 | +10 loyalty |
| Phone Time | $150 | +8 loyalty |
| Luxury Food | $80 | +5 loyalty |
Items boost gang morale and loyalty.
Yes! If item stealing is enabled:
- 70% chance of being detected
- If detected → violence breaks out
- If successful → +10 respect to thief
- High-risk, high-reward mechanic
PersonalityPanel (gang leaders):
- 💰 Current money
- 💊 Drug stash
- 📦 Number of items
Gang Debug Window → Gangs Tab:
- Money, earnings, drugs per gang
Gang Debug Window → Members Tab:
- Individual drug activity
- Times caught
- Sentence extensions
Members can:
- Bribe guards for weapons ($500-1000)
- Craft weapons from materials
- Steal weapons from rivals after violence
- Use weapons in violence (increased damage)
- Enable Prison Gangs first
- Settings → Experimental → Prison Gangs
- Scroll to Weapons System
- Enable "Weapons System"
- Enable sub-options (bribery, stealing, crafting)
- Click Save
| Type | Damage | Concealment | Acquisition |
|---|---|---|---|
| Gun 🔫 | 80-100 | Low (0.2) | Bribe guard |
| Shank 🔪 | 40-60 | High (0.8) | Craft |
| Chain ⛓️ | 30-50 | Medium (0.5) | Steal |
Guards have different corruptibility levels:
- Honest: 10% corruptible (very hard)
- Neutral: 40% corruptible (moderate)
- Corrupt: 80% corruptible (easy)
- Dangerous: Unpredictable (may report you)
Bribe attempts are automatic based on gang resources and member status.
Yes! Detection chance:
Detection = Guard Alertness × (1 - Weapon Concealment)
Example:
- 0.7 alertness × (1 - 0.8 shank concealment) = 14% detection
If detected:
- Weapon confiscated
- Solitary confinement (1-2 minutes)
- Gang reputation -15
Yes! Weapons have durability:
- Decreases with each use
- 0 durability = weapon breaks
- Can be repaired with resources (future feature)
Quick Fixes:
- Unload unused personalities
- Use smaller AI models (e.g.,
gemini-1.5-flash) - Disable StarField background
- Reduce number of loaded personalities (4 max)
- Lower gang update frequency
- Disable autonomous conversations temporarily
Settings:
Settings → Appearance → Disable StarField
Settings → Experimental → Reduce gang update interval
- Use Google Gemini (cheapest, high quality)
- Use local models (completely free)
- Lower maxOutputTokens (500-1000 instead of 2000+)
- Reduce conversation length (
shortinstead oflong) - Monitor usage:
api usage - Use GPT-3.5 instead of GPT-4 if using OpenAI
Recommended:
- 2-4 personalities: Optimal performance
- 5-6 personalities: Good performance
- 7-8 personalities: Acceptable performance
- 9+ personalities: Performance issues likely
Technically yes, but performance will be poor. Minimum recommendation: Raspberry Pi 4 with 8GB RAM. You'll need to:
- Use local models (avoid API calls)
- Disable TTS or use browser TTS
- Disable gang system
- Load 1-2 personalities max
Solutions:
- Check
api-keys.jsonexists in project root - Verify JSON is valid (use JSONLint.com)
- Ensure file has correct format:
{ "geminiApiKey": "your-key" } - Restart dev server
Solutions:
- Check
public/personalities/folder exists - Verify ZIP files are valid (can extract manually)
- Check
personality.jsonis inside ZIP - Run
personality reloadin CLI - Check browser console for errors (F12)
Solutions:
- Enable global TTS:
tts enable - Check TTS provider is set:
tts provider browser - Test TTS:
tts test "Hello world" - Verify browser audio isn't muted
- Check personality has voice ID assigned
Solutions:
- Verify server is running:
curl http://localhost:8000/health
- Check URL in settings:
http://localhost:8000(no trailing slash) - Restart server:
python scripts/coqui-xtts-server.py
- Check firewall isn't blocking port 8000
Solutions:
- Ensure llama.cpp server is running
- Check
.env.local:VITE_USE_LLAMA_SERVER=true VITE_LLAMA_BASE_URL=http://127.0.0.1:8080 - Restart dev server after changing
.env.local - Test:
local test
Solutions:
- Enable gangs: Settings → Experimental → Enable Prison Gangs
- Configure at least 2 gangs
- Assign gang leaders
- Assign members to gangs
- Refresh page
- Check Gang Debug Window
Solutions:
# Skip current speaker
auto skip
# Restart conversation
auto stop
auto start tony_blair jimmy_savileIf persistent:
- Unload and reload personalities
- Clear conversation history
- Check API provider is responding
- Check browser console for errors
Solutions:
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm cache clean --force
npm install
# Try different Node version
nvm install 18
nvm use 18
npm install
npm run buildTracks two metrics between personalities:
- Affinity: -1.0 (antagonistic) to 1.0 (friendly)
- Familiarity: 0.0 (strangers) to 1.0 (close friends)
Changes based on:
- Conversation sentiment
- Gang affiliations
- Violence events
- Shared experiences
Enable: Settings → Experimental → Enable Relationship Tracking
Personalities develop moods that affect behavior:
happy: More positive, energetic responsesfrustrated: More critical, shorter responsescurious: Asks more questionsbored: Brief, disengaged responsesneutral: Default balanced behavior
Moods change based on:
- Conversation quality
- Gang events
- Violence exposure
- Social energy levels
Enable: Settings → Experimental → Enable Mood System
A "social battery" mechanic:
- Energy depletes with conversation
- Recharges during silence
- Low energy = shorter responses, less initiative
- High energy = more proactive, longer responses
Simulates realistic social fatigue.
Enable: Settings → Experimental → Enable Social Energy Model
Per-personality customization of behavior:
{
"tony_blair": {
"initiativeProbability": 0.8, // Very proactive
"baseVerbosity": 1.5, // Talks more
"assertiveness": 0.9, // Dominates conversations
"temperatureBoost": 0.2 // More creative
}
}Set in: Settings → Experimental → Per-Personality Overrides
Export:
# Set export path
export path set "C:/Users/YourName/Personalities"
# Export personality
personality export tony_blairImport:
personality import /path/to/personality.zipOr manually place ZIP file in public/personalities/ and reload.
Check the LICENSE file for specific terms. Generally, if MIT licensed, yes with attribution.
- Fork the repository
- Create feature branch
- Make your changes
- Test thoroughly
- Submit pull request
- Respond to code review
See CONTRIBUTING.md (if exists) for detailed guidelines.
📖 Read the Complete Guide: USER-GUIDE.md
🔍 Check Troubleshooting: GANGS-TROUBLESHOOTING.md
💬 Join Discord: [Community Server]
🐛 Report Bug: GitHub Issues
📧 Email Support: your-email@example.com
Last Updated: 2025-10-23
Version: 21.0.0