Inspiration
This project was heavily inspired by the fictional MAGI supercomputer from the anime Neon Genesis Evangelion. I wanted to build a system where different personas genuinely debate (Data vs. Empathy vs. Speed), but I faced a critical architectural question: When AI agents disagree, how do we programmatically break the tie without hallucinating? The answer was observability. I realized I could use the Model Context Protocol (MCP) to allow a Meta-Auditor agent to read its own runtime telemetry and mathematically prove which agent was the most confident.
What it does
The MAGI System is a self-auditing, multi-agent decision-making engine. A user inputs a strategic dilemma, and three distinct AI personas evaluate it concurrently:
Melchior: Prioritizes raw data and efficiency.
Balthasar: Prioritizes human empathy and psychological safety.
Caspar: Prioritizes speed and pragmatic action.
If the agents clash, the Meta-Auditor is triggered. Instead of guessing who is right, it uses an MCP tool to query the Arize Phoenix server for the exact OpenTelemetry traces of the agents' thought processes. By calculating the Processing Density (Tokens Per Second) of each span, the Auditor identifies which model generated its logic with the highest confidence and least server hesitation, synthesizing a final master solution based on that empirical data.
How we built it
I built the backend using Python 3.13 and FastAPI, creating a highly asynchronous orchestrator. The AI brains are powered by Gemini 3.1 Flash Lite using the official google-genai SDK.
For the observability pipeline, I integrated OpenTelemetry and Arize Phoenix. I configured a local @arizeai/phoenix-mcp Node server that our Python backend communicates with via stdio.
The frontend is a dark-themed, highly responsive React + Vite application. For deployment, I containerized the complex Python/Node backend using Docker and hosted it on Render, while the frontend is deployed to Vercel.
Challenges we ran into
- LLM Cognitive Dissonance: Initially, when I fed raw, unparsed OpenTelemetry JSON data via the MCP tool, the LLM frequently entered an infinite loop. The data density caused it to panic and repeatedly call the tool. I had to implement strict Python-level data slicing and exception-based circuit breakers to stabilize the agentic loop.
- Finding the Right Metric: Standard telemetry does not capture token probabilities (logprobs). To derive a proxy for "agent confidence," I engineered a pipeline to calculate Processing Density(Tokens per second).
- Cross-Environment Deployment: Getting a Python FastAPI server and a Node-based MCP server to run simultaneously on Render's free tier required writing a custom Dockerfile to bridge the two environments.
Accomplishments that we're proud of
I am incredibly proud of proving that observability tools are not just for human developers. By successfully linking Arize Phoenix to an active agent workflow via MCP, I turned static trace data into a dynamic, runtime input for agentic reasoning. I successfully built an AI system that mathematically audits its own neurological firing rate to resolve logic deadlocks.
What we learned
I learned that stateless, telemetry-driven synthesis is significantly more stable than trying to correct LLM behavior by appending rules to a shared context window (which inevitably leads to context bloat and persona drift). I also gained a deep understanding of the Model Context Protocol (MCP) and how it serves as a universal bridge between foundational models and enterprise infrastructure.
What's next for magi-system
Advanced Trace Visualizations: I plan to parse the OpenTelemetry spans directly into the React frontend, rendering a live waterfall graph of the agents' thought processes for the user.
Expanded Personas: Introducing domain-specific sub-agents (e.g., Legal, Financial, PR) that can be dynamically swapped into the core processing slots based on the query type.
Logprob Integration: Upgrading the telemetry pipeline to capture and evaluate actual token log probabilities if standard APIs begin supporting it.
Log in or sign up for Devpost to join the conversation.