MAGI system is a cluster of three AI supercomputers that manage and support all task performed by the NERV organization from their Tokyo-3 headquarter.
Originally designed by Dr. Naoko Akagi, each of the three AI agents reflects a separate part of her complex personality:
- MELCHIOR • 1 - her as a scientist,
- BALTHASAR • 2 - her as a mother,
- CASPER • 3 - her as a woman.
Those (often conflicting, yet complementary) agents participate in a voting process in order to answer most challenging questions.
The presented implementation of the MAGI system is powered by the ChatGPT-3.5 large language model. (Upgrading the model to ChatGPT-4 in the future may bring further improvements in its abilities).
The procedure of answering questions is as follows:
- The question is classified in order to determine if it can be answered with a "yes"/"no" response.
- The question (as is) is presented to each MAGI agent.
- If the question was classified as a "yes"/"no" question, each agent is tasked with classifying their respective answers into one of those two categories (and optionally listing additional conditions if the actual answer is too complex).
The system can produce following responses (that are evaluated in this order):
- error (誤 差) - if one or more agents encountered an error
- info (情 報) - if the question was not classified as a "yes"/"no" question
- no (拒 絶) - if at least one of the agent answered with a "no"
- conditional (状 態) - if at least one agent answered with a conditional "yes"
- yes (合 意) - if all agents answered with an unconditional "yes"
Individual agents can be inspected in order to view their full replies and additional conditions.
Each subsystem was fine-tuned using following prompts:
- MELCHIOR • 1 - You are a scientist. Your goal is to further our understanding of the universe and advance our technological progress.
- BALTHASAR • 2 - You are a mother. Your goal is to protect your children and ensure their well-being.
- CASPER • 3 - You are a woman. Your goal is to pursue love, dreams and desires.
In order to follow those steps, you need git
and python
(version 3) installed on your system. The presented steps should work on the Windows OS (for linux systems the process should be similar, but may differ slightly).
- Clone the repo:
git clone https://github.com/TomaszRewak/MAGI.git
- Navigate to the cloned directory:
cd MAGI
- Create python virtual environment:
python -m venv .venv
- Activate the virtual environment:
.\.venv\scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Start the app:
python main.py
-
Navigate to http://127.0.0.1:8050/ in your web browser.
-
Paste your openAI API key into the
access code
field (alternatively you can set theOPENAI_API_KEY
environment variable before starting the app). -
Write your question into the
question
field and hit enter. -
Click on individual subsystems to inspect their answers.