A multi-agent AI operating system inspired by the MAGI supercomputer from Neon Genesis Evangelion.
Three AI agents - MELCHIOR (Logic), BALTHASAR (Emotion), and CASPER (Ethics) - debate every user query in real time. Watch them disagree, argue, and vote.
Every query is sent to three AI subsystems simultaneously. Each agent analyses the question through a different lens and streams its response token by token in real time.Once all three have responded, the fourth ARBITER system then synthesises a final verdict.
You can view the full prompts in
/backend/prompts/
| Agent | Designation | Reasoning Style |
|---|---|---|
| MELCHIOR-1 | Logic | Probabilistic, data-driven, outcome focused |
| BALTHASAR-2 | Emotion | Empathetic, intuitive, human centred |
| CASPER-3 | Ethics | Principled, moral, precedent aware |
APPROVE- majority vote in favourOPPOSE- majority vote againstDEADLOCK- no majority reached, further deliberation required
MAGI-PROTOCOL is designed for questions where reasonable perspectives can conflict:
- Decisions - "Should I quit my job?"
- Technical tradeoffs - "Should I use PostgreSQL or MongoDB?"
- Ethical dilemmas - "Is it acceptable to surveil employees?"
- Risk assessment - "Should I go bungee jumping?"
| Layer | Technology |
|---|---|
| Frontend | Next.js |
| Backend | FastAPI |
| Real-time | Websockets |
| Message Broker | Redis |
| LLM Runtime | Ollama or any LLM API |
| Deployment | Docker Compose |
User Query
↓
WebSocket /ws/debate
↓
Stream MELCHIOR-1 → BALTHASAR-2 → CASPER-3
↓
Parse confidence + stance from each response
↓
ARBITER synthesises final verdict
↓
Redis stores session history
↓
Frontend renders live via WebSocket
| Provider | LLM_PROVIDER |
API_BASE_URL |
|---|---|---|
| Ollama (local) | ollama |
— |
| OpenAI | api |
https://api.openai.com/v1 |
| Anthropic | api |
https://api.anthropic.com/v1 |
| Mistral | api |
https://api.mistral.ai/v1 |
| Groq | api |
https://api.groq.com/openai/v1 |
No API key needed for Ollama. For cloud providers, set
API_KEYin your.env.Use
.env.exampleas a master reference for other.envfiles.
- Python 3.14+
- Node.js 26+
- Redis
git clone git@github.com:CosmoJelly/MAGI-PROTOCOL.git
cd MAGI-PROTOCOLollama pull llama3:latestcp .env.example .envdocker compose upThen open http://localhost:3000.
MAGI-PROTOCOL/
├── backend/
│ ├── prompts/
│ │ ├── melchior.md
│ │ ├── balthasar.md
│ │ ├── casper.md
│ │ └── arbiter.md
│ ├── main.py
│ ├── agents.py
│ ├── llm.py
│ ├── arbiter.py
│ ├── parser.py
│ ├── redis_client.py
│ └── requirements.txt
├── frontend/
│ └── app/
│ ├── components/
│ │ ├── MagiTriangle.tsx
│ │ ├── ArbiterVerdict.tsx
│ │ └── QueryTerminal.tsx
│ ├── page.tsx
│ ├── layout.tsx
│ └── globals.css
├── docker-compose.yml
├── .env.example
└── README.md
MAGI-PROTOCOL is an independent fan project and is not affiliated with, endorsed by, or connected to Gainax, Khara, or the Neon Genesis Evangelion franchise in any way.
Neon Genesis Evangelion and all related names, characters, and imagery are the intellectual property of Gainax and Khara. No copyright infringement is intended.
All original code in this repository is released under the MIT License. See LICENSE for details.
