Skip to content

Manuel-Cplusplus/The_Gate_of_Maat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Gate of Maat

Formal Methods Laboratory

This repository contains all files used for the development of a Formal Methods laboratory exercise within the Computer Science degree program at the University of Bari “Aldo Moro”.


Table of Contents

  1. Description
  2. Installation
  3. Running the Project
  4. Notes
  5. License and Author

Description

The Gate of Maat is a Finite State Machine (FSM) integrated with a Large Language Model (LLM) simulating a mythological entity — the Sphinx — whose purpose is to test the user’s worthiness through an interactive dialogue.

During the conversation, the user faces a sequence of conceptual trials designed to evaluate logic, intuition, and humility.
Each response contributes to an internal score; at the end of the dialogue, the Sphinx determines whether the user is worthy to cross the gate or should be rejected.

From a technical perspective, the project demonstrates the integration of:

  • Formal Methods and FSMs, to model deterministic transitions and behaviors.
  • Large Language Models (LLMs), to dynamically generate dialogue and evaluate user's responses.

Installation

  1. Clone the repository:
git clone https://github.com/Manuel-Cplusplus/The_Gate_of_Maat.git
  1. Move into the project folder:
cd The_Gate_of_Maat
  1. Copy the environment file:
cp .env.example .env
  1. Inside the .env file, insert your valid OpenAI API key to enable language model access.

  2. Create a virtual environment

  • Windows:
python -m venv myenv
  • Linux/MacOS:
python3 -m venv venv
  1. Activate the virtual environment
  • Windows:
myenv\Scripts\activate
  • Linux/MacOS:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

If required, also install the custom FSM package:

pip install fsm-llm

Running the Project

To start the simulation:

python src/TheGateOfMaat.py

Once launched, the system initiates an interactive session with the Sphinx. The user must respond to each trial, and the final outcome — Grace or Condemnation — will be revealed based on the accumulated score.


Note

If you add new dependencies, update the requirements.txt file:

pip freeze > requirements.txt

In case of errors, you could try to install the the custom FSM package:

pip install fsm-llm

Custom FSM package reference


License and Author

Author: Manuel Carlucci
Year: 2025
Project: The Gate of Maat

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.


You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

Under the following terms:

  • You must give appropriate credit
  • You may not use the material for commercial purposes
  • Any derivative works must be distributed under the same license

View the full license here

About

This repository contains all files used for the development of a Formal Methods laboratory exercise within the Computer Science degree program at the University of Bari “Aldo Moro”. The main goal is to merge FSMs and LLMs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages