# pradhansmriti/mol_vis_sim architecture

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

- Interactive diagram: https://gitdiagram.com/pradhansmriti/mol_vis_sim
- Repository: https://github.com/pradhansmriti/mol_vis_sim

## Overview

Molvis is a local protein-simulation workspace for preparing or uploading structures, reviewing a workflow, and running bounded readiness checks—not production dynamics. The main user path is structure input → preparation/pair validation → planning → optional solvent/parameter compatibility and readiness run → saved artifacts and live measurements. A separate experimental assistant can inspect structures and propose plans. The graph includes documented capabilities whose implementation details were not fully sampled; uncertain internal wiring is omitted.

Main entry points: [`molvis/__main__.py`](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/__main__.py) (Local HTTP workspace), [`molvis/compatibility.py`](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/compatibility.py) (Solvent compatibility), [`simulation_agent/chat.py`](https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/chat.py) (Assistant sessions), [`molvis/live_runs.py`](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/live_runs.py) (Live runs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace interface"]
  node_server["Local HTTP workspace<br/>[__main__.py]"]
  node_browser["Workspace UI<br/>[app.js]"]
end

subgraph group_structure["Structure preparation"]
  node_preparation["Structure preparation<br/>[preparation.py]"]
  node_psfgen["Standalone psfgen adapter"]
  node_validation["Pair and structure checks<br/>[validation.py]"]
  node_planning["Workflow planning<br/>[planning.py]"]
end

subgraph group_readiness["Readiness checks"]
  node_compatibility["Solvent compatibility<br/>[compatibility.py]"]
  node_waterbox["Water-box preparation<br/>[waterbox.py]"]
  node_openmm["OpenMM readiness"]
  node_worker["Compatibility worker"]
  node_live["Live runs<br/>[live_runs.py]"]
  node_telemetry["Measurements and preview<br/>[telemetry.py]"]
end

subgraph group_assistant["Planning assistant"]
  node_agentchat["Assistant sessions<br/>[chat.py]"]
  node_orchestrator["Tool-loop orchestrator<br/>[orchestrator.py]"]
  node_provider["Model providers<br/>[providers.py]"]
  node_tools["Planning tools<br/>[tools.py]"]
end

subgraph group_runtime["Runtime support"]
  node_environment[("Environment artifacts")]
  node_setup["Setup diagnostics<br/>[setup_check.py]"]
end

node_user(("Workspace user"))
node_model{{"Model provider service"}}

node_user -->|"uses"| node_browser
node_browser -.->|"requests workspace"| node_server
node_server -->|"routes preparation"| node_preparation
node_preparation -->|"delegates generation"| node_psfgen
node_server -->|"routes planning"| node_planning
node_planning -->|"checks supplied pair"| node_validation
node_server -->|"routes compatibility"| node_compatibility
node_compatibility -.->|"starts worker"| node_worker
node_server -.->|"routes runs"| node_live
node_live -.->|"uses compatibility"| node_compatibility
node_compatibility -->|"checks readiness"| node_openmm
node_openmm -->|"emits measurements"| node_telemetry
node_live -.->|"publishes updates"| node_telemetry
node_server -.->|"saves artifacts"| node_environment
node_server -.->|"checks setup"| node_setup
node_user -->|"starts assistant"| node_agentchat
node_server -->|"handles agent routes"| node_agentchat
node_agentchat -->|"probes provider"| node_provider
node_provider -->|"sends requests"| node_model
node_agentchat -->|"runs turns"| node_orchestrator
node_orchestrator -->|"requests responses"| node_provider
node_orchestrator -->|"dispatches tools"| node_tools
node_tools -->|"requests plans"| node_planning
node_compatibility -.->|"prepares solvent"| node_waterbox

click node_server "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/__main__.py"
click node_browser "https://github.com/pradhansmriti/mol_vis_sim/blob/main/web/app.js"
click node_preparation "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/preparation.py"
click node_psfgen "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/standalone_psfgen.py"
click node_validation "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/validation.py"
click node_planning "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/planning.py"
click node_compatibility "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/compatibility.py"
click node_waterbox "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/waterbox.py"
click node_openmm "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/openmm_validation.py"
click node_worker "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/compatibility_worker.py"
click node_live "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/live_runs.py"
click node_telemetry "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/telemetry.py"
click node_environment "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/environment_storage.py"
click node_setup "https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/setup_check.py"
click node_agentchat "https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/chat.py"
click node_orchestrator "https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/orchestrator.py"
click node_provider "https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/providers.py"
click node_tools "https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/tools.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_server,node_browser,node_user toneBlue
class node_preparation,node_psfgen,node_validation,node_planning toneAmber
class node_compatibility,node_waterbox,node_openmm,node_worker,node_live,node_telemetry toneMint
class node_agentchat,node_orchestrator,node_provider,node_tools toneRose
class node_environment,node_setup,node_model toneIndigo
```

## Components

### Workspace interface

- [Local HTTP workspace](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/__main__.py): `molvis/__main__.py`
- [Workspace UI](https://github.com/pradhansmriti/mol_vis_sim/blob/main/web/app.js): `web/app.js`

### Structure preparation

- [Structure preparation](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/preparation.py): `molvis/preparation.py`
- [Standalone psfgen adapter](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/standalone_psfgen.py): `molvis/standalone_psfgen.py`
- [Pair and structure checks](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/validation.py): `molvis/validation.py`
- [Workflow planning](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/planning.py): `molvis/planning.py`

### Readiness checks

- [Solvent compatibility](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/compatibility.py): `molvis/compatibility.py`
- [Water-box preparation](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/waterbox.py): `molvis/waterbox.py`
- [OpenMM readiness](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/openmm_validation.py): `molvis/openmm_validation.py`
- [Compatibility worker](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/compatibility_worker.py): `molvis/compatibility_worker.py`
- [Live runs](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/live_runs.py): `molvis/live_runs.py`
- [Measurements and preview](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/telemetry.py): `molvis/telemetry.py`

### Planning assistant

- [Assistant sessions](https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/chat.py): `simulation_agent/chat.py`
- [Tool-loop orchestrator](https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/orchestrator.py): `simulation_agent/orchestrator.py`
- [Model providers](https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/providers.py): `simulation_agent/providers.py`
- [Planning tools](https://github.com/pradhansmriti/mol_vis_sim/blob/main/simulation_agent/tools.py): `simulation_agent/tools.py`

### Runtime support

- [Environment artifacts](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/environment_storage.py): `molvis/environment_storage.py`
- [Setup diagnostics](https://github.com/pradhansmriti/mol_vis_sim/blob/main/molvis/setup_check.py): `molvis/setup_check.py`

### Other components

- **Workspace user**
- **Model provider service**

## Connections

- Workspace user → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Local HTTP workspace: requests workspace
- Local HTTP workspace → Structure preparation: routes preparation (evidence: `molvis/__main__.py`)
- Structure preparation → Standalone psfgen adapter: delegates generation (evidence: `molvis/preparation.py`)
- Local HTTP workspace → Workflow planning: routes planning (evidence: `molvis/__main__.py`)
- Workflow planning → Pair and structure checks: checks supplied pair (evidence: `molvis/planning.py`)
- Local HTTP workspace → Solvent compatibility: routes compatibility (evidence: `molvis/__main__.py`)
- Solvent compatibility → Compatibility worker: starts worker
- Local HTTP workspace → Live runs: routes runs (evidence: `molvis/__main__.py`)
- Live runs → Solvent compatibility: uses compatibility (evidence: `molvis/live_runs.py`)
- Solvent compatibility → OpenMM readiness: checks readiness (evidence: `molvis/compatibility.py`)
- OpenMM readiness → Measurements and preview: emits measurements (evidence: `molvis/openmm_validation.py`)
- Live runs → Measurements and preview: publishes updates
- Local HTTP workspace → Environment artifacts: saves artifacts (evidence: `molvis/__main__.py`)
- Local HTTP workspace → Setup diagnostics: checks setup (evidence: `molvis/__main__.py`)
- Workspace user → Assistant sessions: starts assistant (evidence: `README.md`)
- Local HTTP workspace → Assistant sessions: handles agent routes (evidence: `molvis/__main__.py`)
- Assistant sessions → Model providers: probes provider (evidence: `simulation_agent/chat.py`)
- Model providers → Model provider service: sends requests (evidence: `simulation_agent/providers.py`)
- Assistant sessions → Tool-loop orchestrator: runs turns (evidence: `simulation_agent/chat.py`)
- Tool-loop orchestrator → Model providers: requests responses (evidence: `simulation_agent/orchestrator.py`)
- Tool-loop orchestrator → Planning tools: dispatches tools (evidence: `simulation_agent/orchestrator.py`)
- Planning tools → Workflow planning: requests plans (evidence: `simulation_agent/tools.py`)
- Solvent compatibility → Water-box preparation: prepares solvent
