1. Architecture Diagram
Four-tier design with persistent vector memory. Everything flows through the consensus engine.
2. The Three Layers
Separation of concerns: stateless UI, stateful gateway, emergent engine.
BACKEND • FastAPI
memories (vector[5], text, ts)
conversations
tools
swarm_state
FAISS or sqlite-vec for cosine similarity over 5D memory vectors. Persists across restarts.
ENGINE • 100 Agents
text: str
result: any
timestamp: int
Recursion: improve() retrieves from 6 neighbors, mutates, votes again
FRONTEND • React
3. Knowledge Base Design
It doesn't just store facts. It stores you — your patterns, timing, vocabulary, and logic.
✓ How it becomes 100% like you
Live Triple Store
4. The Conversational Loop
Not ingestion. Dialogue. The swarm switches sides when confidence drops.
You ask → swarm retrieves 6 neighbors, votes (66/100), answers, stores interaction.
Swarm asks you → confidence < 0.4 or command /socratic → you teach → triple stored.
Triggers switch when < 0.4
5. Code Starter Kit
Copy-paste complete. Run with docker-compose up. Built for persistence, recall, and self-improvement.
cd swarm-os
docker-compose up --build
-d '{"q":"what is hold?"}'