PROXAI (PROvenance for eXplainable AI) is a library capable of capturing provenance in a preprocessing pipeline. PROXAI provides a clear and clean interface for capturing provenance, at various levels of granularity, without the need to invoke additional functions. The data scientist simply needs to implement the pipeline and, after executing it, can analyze the corresponding graph using Neo4j.
- Installation
- Neo4j (Docker)
- Pipeline Assets
- LLM Prompts
- Provenance Exploitation
- Provenance Explanation
- Getting Started
To use the tool, follow these steps:
-
Clone the repository:
git clone https://github.com/pasqualeleonardolazzaro/PROXAI.git -
Navigate to the project directory:
cd PROXAI -
Create and activate a virtual environment (optional but recommended): On Unix or MacOS:
python3 -m venv venv source venv/bin/activateOn Windows:
python -m venv venv .\venv\Scripts\activate -
Install the requirements:
pip install -r requirements.txt
-
Create an account and generate an API key on Groq
Visit Groq Console to create your API key. -
Create a Python file named
KEY.pyin the PROXAI folder
Inside the file, define a variable to store your API key as follows:MY_KEY = "YOUR_NEWLY_CREATED_KEY"
-
Start Neo4j in the background by executing the following command::
cd neo4j docker compose up -d -
To stop Neo4j, run the following command::
cd neo4j docker compose down -v
To access the Neo4j web interface, open the following URL in your web browser:
http://localhost:7474/browser/
- User:
neo4j - Password:
adminadmin
To get started with the tool, follow these simple steps.
The main file for running the tool is prolit_run.py. Below is a description of the arguments you can pass via the command line.
Run PROXAI by specifying the dataset and pipeline you want to use, along with other options:
python prolit_run.py --dataset datasets/car_data.csv --pipeline pipelines/car_pipeline.py --frac 0.1 --granularity_level 3--dataset: Relative path to the dataset file. For example:datasets/car_data.csv--pipeline: Relative path to the pipeline file. For example:pipelines/car_pipeline.py--frac: Fraction of the dataset to use for sampling. Value between0.0and1.0. For example,0.1uses 10% of the dataset.--granularity_level: Granularity level. Can be1,2,3or4with specific meanings for each level of detail.1: Sketch Level2: Derivation Level3: Full Level4: Only Columns Level
- Make sure all dependencies are installed:
pip install -r requirements.txt- Launch the GUI with Streamlit:
streamlit run streamlit_app.py- Once running, your browser should open automatically. If not, you can manually navigate to:
http://localhost:8501
-
The GUI provides five main sections, accessible from the sidebar:
- Provenance Analysis – Select a dataset and a pipeline, choose the granularity level (Sketch, Only Columns, Detailed, Full), and run PROXAI to generate the provenance graph. An advanced editor lets you inspect and modify
extracted_code.pybefore execution. - Graph Chat – Ask questions in natural language about the provenance graph using a RAG-based chatbot connected to Neo4j.
- Provenance Explorer – Open the Neo4j Browser directly to explore and query the provenance graph.
- Global Analysis – Evaluate model behaviour at a global level using SHAP feature importance and influence functions (FirstOrder, TracIn). Results include the most influential training samples (proponents and opponents) with direct links to the provenance graph.
- Local Analysis – Inspect individual predictions: view correct/incorrect classifications (or regression residuals), select a specific sample, and compute its local influence scores (FirstOrder or TracIn) to identify which training points most affected that prediction.
- Provenance Analysis – Select a dataset and a pipeline, choose the granularity level (Sketch, Only Columns, Detailed, Full), and run PROXAI to generate the provenance graph. An advanced editor lets you inspect and modify