# vedalai/neuro-amongus architecture

> Architecture diagram of the GitHub repository vedalai/neuro-amongus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vedalai/neuro-amongus
- Repository: https://github.com/vedalai/neuro-amongus

## Overview

Neuro is an Among Us plugin that exchanges game-state observations and neural-network actions with an external AI, while also recording gameplay for model training. In play, the plugin sends frames over a WebSocket and applies received movement/action commands; local handlers support navigation, interactions, minigames, and impostor behavior. Recording assembles game-state domains into frames for upload and offline conversion/training. The graph retains documented AI and gameplay capabilities, but several subsystem links are omitted where source was not sampled and the index does not establish their runtime calls.

Main entry points: [`Neuro/Communication/AmongUsAI/CommunicationHandler.cs`](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Communication/AmongUsAI/CommunicationHandler.cs) (AI communication), [`Neuro/Recording/Frame.cs`](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Frame.cs) (Frame assembly), [`Neuro/Movement/MovementHandler.cs`](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Movement/MovementHandler.cs) (Movement control), [`Neuro/Minigames/MinigameHandler.cs`](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Minigames/MinigameHandler.cs) (Minigame handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin runtime"]
  node_plugin["Plugin bootstrap<br/>[NeuroPlugin.cs]"]
  node_communication["AI communication"]
  node_websocket["WebSocket worker<br/>[WebSocketThread.cs]"]
  node_event_manager["Event dispatch<br/>[EventManager.cs]"]
end

subgraph group_gameplay["Gameplay control"]
  node_movement["Movement control<br/>[MovementHandler.cs]"]
  node_pathfinding["Pathfinding"]
  node_console_finder["Console discovery<br/>[ConsoleFinder.cs]"]
  node_interactions["Game interactions"]
  node_minigames["Minigame handler<br/>[MinigameHandler.cs]"]
  node_minigame_solvers["Minigame solvers"]
  node_cursor["In-game cursor<br/>[InGameCursor.cs]"]
  node_impostor["Impostor behavior<br/>[ImpostorHandler.cs]"]
end

subgraph group_recording["Recording"]
  node_recording["Frame assembly<br/>[Frame.cs]"]
  node_local_recorder["Player recording"]
  node_task_recorder["Task recording<br/>[TasksRecorder.cs]"]
  node_domain_recorders["Game-state recorders"]
  node_uploader["Recording uploader<br/>[Uploader.cs]"]
end

subgraph group_ai["AI training"]
  node_converter["Recording conversion<br/>[converter.py]"]
  node_game_data["Game data model<br/>[game.py]"]
  node_dataset["Training dataset<br/>[dataset.py]"]
  node_model["Neural network<br/>[model.py]"]
  node_training["Model training<br/>[train_model.py]"]
  node_fine_tuning["Model fine-tuning<br/>[finetune_model.py]"]
end

node_player(("Among Us player"))
node_ai_service["External AI service"]

node_plugin -->|"initializes"| node_communication
node_communication -->|"starts and uses"| node_websocket
node_communication -->|"exchanges frames"| node_ai_service
node_communication -->|"sets move direction"| node_movement
node_movement -->|"requests paths"| node_pathfinding
node_movement -->|"finds consoles"| node_console_finder
node_interactions -->|"checks and launches"| node_minigames
node_minigames -->|"controls"| node_cursor
node_minigames -->|"dispatches solver"| node_minigame_solvers
node_minigame_solvers -->|"performs inputs"| node_cursor
node_impostor -->|"waits and moves"| node_movement
node_communication -->|"registers handler"| node_event_manager
node_recording -->|"collects frame data"| node_local_recorder
node_recording -->|"collects frame data"| node_task_recorder
node_recording -->|"collects game state"| node_domain_recorders
node_communication -->|"serializes current frame"| node_recording
node_task_recorder -.->|"supplies task observations"| node_game_data
node_uploader -.->|"provides recordings"| node_converter
node_converter -.->|"converts data"| node_game_data
node_game_data -->|"builds examples"| node_dataset
node_dataset -.->|"feeds training"| node_training
node_training -.->|"trains"| node_model
node_model -->|"fine-tunes"| node_fine_tuning

click node_plugin "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/NeuroPlugin.cs"
click node_communication "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Communication/AmongUsAI/CommunicationHandler.cs"
click node_websocket "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Communication/AmongUsAI/WebSocketThread.cs"
click node_movement "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Movement/MovementHandler.cs"
click node_pathfinding "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Pathfinding/PathfindingHandler.cs"
click node_console_finder "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Movement/ConsoleFinder.cs"
click node_interactions "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Interactions/InteractionsHandler.cs"
click node_minigames "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Minigames/MinigameHandler.cs"
click node_minigame_solvers "https://github.com/vedalai/neuro-amongus/tree/main/Neuro/Minigames/Solvers"
click node_cursor "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Cursor/InGameCursor.cs"
click node_impostor "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Impostor/ImpostorHandler.cs"
click node_event_manager "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Events/EventManager.cs"
click node_recording "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Frame.cs"
click node_local_recorder "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/LocalPlayer/LocalPlayerRecorder.cs"
click node_task_recorder "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Tasks/TasksRecorder.cs"
click node_domain_recorders "https://github.com/vedalai/neuro-amongus/tree/main/Neuro/Recording"
click node_uploader "https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Uploader.cs"
click node_converter "https://github.com/vedalai/neuro-amongus/blob/main/AI/data/converter.py"
click node_game_data "https://github.com/vedalai/neuro-amongus/blob/main/AI/data/game.py"
click node_dataset "https://github.com/vedalai/neuro-amongus/blob/main/AI/nn/dataset.py"
click node_model "https://github.com/vedalai/neuro-amongus/blob/main/AI/nn/model.py"
click node_training "https://github.com/vedalai/neuro-amongus/blob/main/AI/train_model.py"
click node_fine_tuning "https://github.com/vedalai/neuro-amongus/blob/main/AI/finetune_model.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_plugin,node_communication,node_websocket,node_event_manager toneBlue
class node_movement,node_pathfinding,node_console_finder,node_interactions,node_minigames,node_minigame_solvers,node_cursor,node_impostor toneAmber
class node_recording,node_local_recorder,node_task_recorder,node_domain_recorders,node_uploader toneMint
class node_converter,node_game_data,node_dataset,node_model,node_training,node_fine_tuning toneRose
class node_player,node_ai_service toneIndigo
```

## Components

### Plugin runtime

- [Plugin bootstrap](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/NeuroPlugin.cs): `Neuro/NeuroPlugin.cs`
- [AI communication](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Communication/AmongUsAI/CommunicationHandler.cs): `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`
- [WebSocket worker](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Communication/AmongUsAI/WebSocketThread.cs): `Neuro/Communication/AmongUsAI/WebSocketThread.cs`
- [Event dispatch](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Events/EventManager.cs): `Neuro/Events/EventManager.cs`

### Gameplay control

- [Movement control](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Movement/MovementHandler.cs): `Neuro/Movement/MovementHandler.cs`
- [Pathfinding](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Pathfinding/PathfindingHandler.cs): `Neuro/Pathfinding/PathfindingHandler.cs`
- [Console discovery](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Movement/ConsoleFinder.cs): `Neuro/Movement/ConsoleFinder.cs`
- [Game interactions](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Interactions/InteractionsHandler.cs): `Neuro/Interactions/InteractionsHandler.cs`
- [Minigame handler](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Minigames/MinigameHandler.cs): `Neuro/Minigames/MinigameHandler.cs`
- [Minigame solvers](https://github.com/vedalai/neuro-amongus/tree/main/Neuro/Minigames/Solvers): `Neuro/Minigames/Solvers`
- [In-game cursor](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Cursor/InGameCursor.cs): `Neuro/Cursor/InGameCursor.cs`
- [Impostor behavior](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Impostor/ImpostorHandler.cs): `Neuro/Impostor/ImpostorHandler.cs`

### Recording

- [Frame assembly](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Frame.cs): `Neuro/Recording/Frame.cs`
- [Player recording](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/LocalPlayer/LocalPlayerRecorder.cs): `Neuro/Recording/LocalPlayer/LocalPlayerRecorder.cs`
- [Task recording](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Tasks/TasksRecorder.cs): `Neuro/Recording/Tasks/TasksRecorder.cs`
- [Game-state recorders](https://github.com/vedalai/neuro-amongus/tree/main/Neuro/Recording): `Neuro/Recording`
- [Recording uploader](https://github.com/vedalai/neuro-amongus/blob/main/Neuro/Recording/Uploader.cs): `Neuro/Recording/Uploader.cs`

### AI training

- [Recording conversion](https://github.com/vedalai/neuro-amongus/blob/main/AI/data/converter.py): `AI/data/converter.py`
- [Game data model](https://github.com/vedalai/neuro-amongus/blob/main/AI/data/game.py): `AI/data/game.py`
- [Training dataset](https://github.com/vedalai/neuro-amongus/blob/main/AI/nn/dataset.py): `AI/nn/dataset.py`
- [Neural network](https://github.com/vedalai/neuro-amongus/blob/main/AI/nn/model.py): `AI/nn/model.py`
- [Model training](https://github.com/vedalai/neuro-amongus/blob/main/AI/train_model.py): `AI/train_model.py`
- [Model fine-tuning](https://github.com/vedalai/neuro-amongus/blob/main/AI/finetune_model.py): `AI/finetune_model.py`

### Other components

- **Among Us player**
- **External AI service**

## Connections

- Plugin bootstrap → AI communication: initializes (evidence: `Neuro/NeuroPlugin.cs`)
- AI communication → WebSocket worker: starts and uses (evidence: `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`)
- AI communication → External AI service: exchanges frames (evidence: `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`)
- AI communication → Movement control: sets move direction (evidence: `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`)
- Movement control → Pathfinding: requests paths (evidence: `Neuro/Movement/MovementHandler.cs`)
- Movement control → Console discovery: finds consoles (evidence: `Neuro/Movement/MovementHandler.cs`)
- Game interactions → Minigame handler: checks and launches (evidence: `Neuro/Interactions/InteractionsHandler.cs`)
- Minigame handler → In-game cursor: controls (evidence: `Neuro/Minigames/MinigameHandler.cs`)
- Minigame handler → Minigame solvers: dispatches solver (evidence: `Neuro/Minigames/MinigameHandler.cs`)
- Minigame solvers → In-game cursor: performs inputs (evidence: `Neuro/Minigames/Solvers/FuelEnginesSolver.cs`)
- Impostor behavior → Movement control: waits and moves (evidence: `Neuro/Impostor/ImpostorHandler.cs`)
- AI communication → Event dispatch: registers handler (evidence: `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`)
- Frame assembly → Player recording: collects frame data (evidence: `Neuro/Recording/Frame.cs`)
- Frame assembly → Task recording: collects frame data (evidence: `Neuro/Recording/Frame.cs`)
- Frame assembly → Game-state recorders: collects game state (evidence: `Neuro/Recording/Frame.cs`)
- AI communication → Frame assembly: serializes current frame (evidence: `Neuro/Communication/AmongUsAI/CommunicationHandler.cs`)
- Task recording → Game data model: supplies task observations
- Recording uploader → Recording conversion: provides recordings
- Recording conversion → Game data model: converts data
- Game data model → Training dataset: builds examples (evidence: `AI/nn/dataset.py`)
- Training dataset → Model training: feeds training
- Model training → Neural network: trains
- Neural network → Model fine-tuning: fine-tunes (evidence: `AI/finetune_model.py`)
