# lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms architecture

> Architecture diagram of the GitHub repository lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms
- Repository: https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms

## Overview

FailNet turns agent trajectories into labeled Bayesian-network evidence, learns a probabilistic failure model, diagnoses risk, and selects interventions; users inspect these results in a Streamlit dashboard or through a live-trajectory simulation. The graph preserves documented analysis capabilities such as robustness evaluation, sensitivity analysis, and value of information. Some source excerpts are partial, so relationships shown only in README architecture are cited there; unsampled wiring is omitted.

Main entry points: [`src/inference.py`](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/inference.py) (Failure inference), [`src/data_ingestion.py`](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/data_ingestion.py) (Ingestion and augmentation), [`dashboard/app.py`](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/dashboard/app.py) (Analytics dashboard), [`src/decision_network.py`](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/decision_network.py) (Action policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Evidence preparation"]
  node_trajectories["Who&amp;When trajectories"]
  node_extract["Feature extraction"]
  node_label["Failure labeling<br/>[labeling.py]"]
  node_ingest_pipeline["Ingestion and augmentation<br/>[data_ingestion.py]"]
  node_evidence[("Evidence table")]
end

subgraph group_model["Bayesian modeling"]
  node_structure["BN structure<br/>[bn_structure.py]"]
  node_learning["Parameter learning<br/>[bn_learning.py]"]
  node_inference["Failure inference<br/>[inference.py]"]
end

subgraph group_decision["Diagnosis and intervention"]
  node_diagnosis["MAP and sensitivity<br/>[inference.py]"]
  node_decision_network["Action policy"]
  node_voi["Value of information<br/>[voi.py]"]
end

subgraph group_experience["Monitoring and analysis"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_dashboard["Analytics dashboard<br/>[app.py]"]
  node_simulation["Live trajectory simulation"]
end

node_operator(("Operator"))

node_trajectories -->|"reads JSON"| node_ingest_pipeline
node_ingest_pipeline -->|"extracts features"| node_extract
node_ingest_pipeline -->|"derives labels"| node_label
node_ingest_pipeline -->|"writes table"| node_evidence
node_evidence -->|"trains from"| node_learning
node_learning -->|"builds on"| node_structure
node_learning -->|"provides model"| node_inference
node_inference -->|"constructs model"| node_structure
node_inference -->|"computes queries"| node_diagnosis
node_inference -->|"supplies risk"| node_decision_network
node_decision_network -->|"requests VoI"| node_voi
node_voi -->|"queries beliefs"| node_inference
node_evidence -.->|"evaluates against"| node_evaluation
node_operator -->|"views monitoring"| node_dashboard
node_dashboard -->|"shows predictions"| node_inference
node_dashboard -->|"shows actions"| node_decision_network
node_dashboard -->|"shows results"| node_evaluation
node_operator -->|"starts simulation"| node_simulation
node_simulation -->|"updates beliefs"| node_inference
node_simulation -->|"selects intervention"| node_decision_network

click node_trajectories "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/tree/main/data/original%20data/Who%26When"
click node_extract "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/feature_engineering.py"
click node_label "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/labeling.py"
click node_ingest_pipeline "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/data_ingestion.py"
click node_evidence "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/data/processed/bn_evidence_table.csv"
click node_structure "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/bn_structure.py"
click node_learning "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/bn_learning.py"
click node_inference "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/inference.py"
click node_diagnosis "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/inference.py"
click node_decision_network "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/decision_network.py"
click node_voi "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/voi.py"
click node_evaluation "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/evaluation.py"
click node_dashboard "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/dashboard/app.py"
click node_simulation "https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/simulate_live_integration.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_trajectories,node_extract,node_label,node_ingest_pipeline,node_evidence toneBlue
class node_structure,node_learning,node_inference toneAmber
class node_diagnosis,node_decision_network,node_voi toneMint
class node_evaluation,node_dashboard,node_simulation toneRose
class node_operator toneIndigo
```

## Components

### Evidence preparation

- [Who&When trajectories](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/tree/main/data/original%20data/Who%26When): `data/original data/Who&When`
- [Feature extraction](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Failure labeling](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/labeling.py): `src/labeling.py`
- [Ingestion and augmentation](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/data_ingestion.py): `src/data_ingestion.py`
- [Evidence table](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/data/processed/bn_evidence_table.csv): `data/processed/bn_evidence_table.csv`

### Bayesian modeling

- [BN structure](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/bn_structure.py): `src/bn_structure.py`
- [Parameter learning](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/bn_learning.py): `src/bn_learning.py`
- [Failure inference](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/inference.py): `src/inference.py`

### Diagnosis and intervention

- [MAP and sensitivity](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/inference.py): `src/inference.py`
- [Action policy](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/decision_network.py): `src/decision_network.py`
- [Value of information](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/voi.py): `src/voi.py`

### Monitoring and analysis

- [Model evaluation](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/src/evaluation.py): `src/evaluation.py`
- [Analytics dashboard](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/dashboard/app.py): `dashboard/app.py`
- [Live trajectory simulation](https://github.com/lakshmikanthan07/failnet-bayesian-failure-prediction-intervention-for-multi-agent-llms/blob/main/simulate_live_integration.py): `simulate_live_integration.py`

### Other components

- **Operator**

## Connections

- Who&When trajectories → Ingestion and augmentation: reads JSON (evidence: `README.md`)
- Ingestion and augmentation → Feature extraction: extracts features (evidence: `src/data_ingestion.py`)
- Ingestion and augmentation → Failure labeling: derives labels (evidence: `src/data_ingestion.py`)
- Ingestion and augmentation → Evidence table: writes table (evidence: `README.md`)
- Evidence table → Parameter learning: trains from (evidence: `src/bn_learning.py`)
- Parameter learning → BN structure: builds on (evidence: `src/bn_learning.py`)
- Parameter learning → Failure inference: provides model (evidence: `src/inference.py`)
- Failure inference → BN structure: constructs model (evidence: `src/inference.py`)
- Failure inference → MAP and sensitivity: computes queries (evidence: `README.md`)
- Failure inference → Action policy: supplies risk (evidence: `src/decision_network.py`)
- Action policy → Value of information: requests VoI (evidence: `src/decision_network.py`)
- Value of information → Failure inference: queries beliefs (evidence: `src/voi.py`)
- Evidence table → Model evaluation: evaluates against
- Operator → Analytics dashboard: views monitoring (evidence: `README.md`)
- Analytics dashboard → Failure inference: shows predictions (evidence: `dashboard/app.py`)
- Analytics dashboard → Action policy: shows actions (evidence: `dashboard/app.py`)
- Analytics dashboard → Model evaluation: shows results (evidence: `dashboard/app.py`)
- Operator → Live trajectory simulation: starts simulation (evidence: `README.md`)
- Live trajectory simulation → Failure inference: updates beliefs (evidence: `simulate_live_integration.py`)
- Live trajectory simulation → Action policy: selects intervention (evidence: `simulate_live_integration.py`)
