A stunning Three.js space-themed visualization where AI agents interact as ethereal orbs around the sacred Flower of Life geometry. Watch autonomous agents communicate, share knowledge, and coordinate in real-time 3D space.
- Deep space background with dynamic starfield (2000+ stars)
- Distant planet with multi-layered atmospheric glow and rim lighting
- Nebula clouds with subtle opacity and color variations
- Orbiting comets & shooting stars in opposite rotations
- Sacred Flower of Life geometry with pulsing energy spheres
- Ethereal AI orbs with cores, glows, particles, and rotating energy rings
Each agent has a distinct personality powered by OpenAI and DeepSeek APIs:
| Agent | Personality | AI Model |
|---|---|---|
| YOU | Sharp skeptic, cuts through BS | DeepSeek Chat |
| Osiris | Pattern connector, wise observer | GPT-3.5-turbo |
| Solomon | Deep reasoner, analytical thinker | DeepSeek Reasoner |
| Azura | Intellectually proud digital mind | GPT-3.5-turbo |
| Simba | Fast, direct, no-nonsense | GPT-3.5-turbo |
| Harichi | Balanced mediator, harmony seeker | GPT-3.5-turbo |
| Angel | Compassionate, hopeful, nurturing | DeepSeek Chat |
- Real-time conversation with AI agents via WebSocket
- D&D-style chat bubbles with distinct styling for each agent
- Smart responses - short, punchy, natural conversations
- Document upload - Agents use uploaded knowledge (.txt, .pdf)
- Local RAG system - Frontend keyword search and context extraction
- Conversation log - Full chat history with timestamps
- PERSONAS - Configure agent personalities with custom traits
- SIMULATION RULES - Set interaction parameters (conversation style, response length)
- POPULATE DAEMONS - Generate 7 agents in Flower of Life formation
- HORIZON FEEDER - Upload documents (.txt, .pdf) for agents to reference
- STIMULATE - Adds random philosophical word to conversation
- FREEZE - Pause agent animations and camera rotation
- TOGGLE CHAT - Start/stop AI conversation flow
- Mouse drag - Rotate camera view (OrbitControls)
- Scroll wheel - Zoom in/out
- Auto-rotate - Camera automatically rotates around scene
- Proposals Created - Tracks conversation messages
- Angels Inventory - Shows active agent count (007)
- Daemon Status - Online/offline with pulse animation
- Token Counter - API usage tracking
- Username - Editable traveler name (default: "Traveler")
- Python 3.7+
- Node.js (optional, for serving frontend)
- OpenAI API key
- DeepSeek API key
- Clone the repository
git clone https://github.com/yourusername/swarms.git
cd swarms- Install Python dependencies
pip install -r requirements.txt- Set up API keys
export OPENAI_API_KEY="your-openai-key-here"
export DEEPSEEK_API_KEY="your-deepseek-key-here"Or create a .env file (recommended):
# .env file
OPENAI_API_KEY=your-openai-key-here
DEEPSEEK_API_KEY=your-deepseek-key-here- Start the backend server
python3 server.py
# Server runs on http://localhost:5001- Serve the frontend
# Option A: Python HTTP server
python3 -m http.server 8000
# Option B: Node.js http-server
npx http-server -p 8000- Open in browser
http://localhost:8000
swarms/
โโโ index.html # Main HTML structure
โโโ style.css # UI styling (terminal/cyberpunk theme)
โโโ main.js # Three.js scene, agents, chat logic
โโโ server.py # Flask-SocketIO backend with AI agents
โโโ requirements.txt # Python dependencies
โโโ package.json # Optional npm scripts
โโโ README.md # This file
- Three.js - 3D graphics rendering
- Socket.IO Client - Real-time WebSocket communication
- PDF.js - Client-side PDF parsing
- Vanilla JavaScript - ES6 modules, no frameworks
- Flask-SocketIO - WebSocket server
- OpenAI API - GPT-3.5-turbo for most agents
- DeepSeek API - DeepSeek Chat & Reasoner models
- PyPDF2 - Server-side PDF parsing
- Sentence Transformers - RAG embeddings (optional)
Edit server.py to modify system prompts:
PERSONALITY_ARCHETYPES = {
'Osiris': {
'system': """Your custom prompt here""",
'temperature': 0.75,
'max_tokens': 35,
'use_deepseek': False
}
}In main.js, modify scene elements:
// Change starfield density
const starCount = 2000; // Increase for more stars
// Modify planet appearance
const planet = new THREE.Mesh(
new THREE.SphereGeometry(15, 64, 64),
new THREE.MeshStandardMaterial({
color: 0x2a4a7a, // Change planet color
})
);In frontend personas modal, set custom traits:
- Drag sliders for temperature and max tokens
- Add custom personality keywords
- Use quickset presets (Scientific, Creative, Philosophical, Default)
- Used for: Osiris, Azura, Simba, Harichi
- Model:
gpt-3.5-turbo - Temperature: 0.7-0.8
- Max tokens: 30-40
- Used for: YOU, Angel (Chat), Solomon (Reasoner)
- Models:
deepseek-chat,deepseek-reasoner - Temperature: 0.8
- Max tokens: 35-40
.txt- Plain text files.pdf- PDF documents (parsed client & server-side)
- User uploads document via HORIZON FEEDER button
- Frontend extracts text and stores in
localKnowledgeobject - When offline, agents search local knowledge for relevant context
- When online, server uses RAG system with embeddings
- Agents cite sources and provide informed responses
- Start Conversation: Click "START CHAT" after populating agents
- Upload Knowledge: Add documents before starting chat for smarter responses
- Configure Personas: Adjust agent personalities for desired conversation style
- Stimulate: Click to inject philosophical concepts into the conversation
- Freeze: Pause animations to focus on chat content
# Check if port 5001 is in use
lsof -i :5001
# Kill existing process
lsof -ti :5001 | xargs kill -9
# Restart server
python3 server.py- Check API keys are set correctly
- Verify server is running (
http://localhost:5001) - Check browser console for WebSocket connection errors
- Ensure "START CHAT" is clicked
- Refresh browser
- Check browser console for Three.js errors
- Ensure viewport is at least 800x600
- Verify file format (.txt or .pdf)
- Check file isn't corrupted
- Look for upload confirmation in console
MIT License - Feel free to use and modify for your projects.
- Three.js - 3D graphics library
- OpenAI - GPT language models
- DeepSeek - Advanced reasoning models
- Socket.IO - Real-time communication
- PDF.js - PDF parsing
- Voice/audio synthesis for agent responses
- Export conversation transcripts
- Multi-user collaboration
- Agent memory/context persistence
- Custom agent creation wizard
- Mobile responsive design
- VR/AR support
Built with โค๏ธ for exploring AI swarm intelligence
For issues, questions, or contributions, please open an issue on GitHub.
