# ramrohitaws99/openhands architecture

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

- Interactive diagram: https://gitdiagram.com/ramrohitaws99/openhands
- Repository: https://github.com/ramrohitaws99/openhands

## Overview

OpenHands is a platform for AI software-development agents, exposed through an interactive web app and documented headless and CLI modes. The main workflow is a user task entering a session, being advanced by the agent controller and an agent/LLM, then executed in a sandbox runtime that can run commands, edit files, and browse. Results return as observations for the agent and user. The graph includes documented product capabilities and major runtime layers; links without direct source evidence are marked dashed, and some backend wiring is inferred from the README rather than inspected source.

Main entry points: [`openhands/controller/agent_controller.py`](https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/agent_controller.py) (Agent controller), [`frontend/src/App.tsx`](https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/App.tsx) (Web application), [`openhands/runtime/client/client.py`](https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/client/client.py) (Runtime client), [`openhands/server/session/manager.py`](https://github.com/ramrohitaws99/openhands/blob/main/openhands/server/session/manager.py) (Session manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_web["Web application<br/>[App.tsx]"]
  node_chat["Chat interface<br/>[ChatInterface.tsx]"]
  node_fileui["Workspace and files<br/>[Workspace.tsx]"]
  node_fileapi["File service<br/>[fileService.ts]"]
  node_cli["CLI entry point<br/>[cli.py]"]
end

subgraph group_sessions["Sessions and control"]
  node_sessionmgr["Session manager<br/>[manager.py]"]
  node_session["Agent session<br/>[session.py]"]
  node_controller["Agent controller"]
  node_state["Task state<br/>[state.py]"]
end

subgraph group_agents["Agents and models"]
  node_agent["Agent implementations"]
  node_parser["Action parsing<br/>[action_parser.py]"]
  node_llm["LLM provider layer<br/>[llm.py]"]
  node_events["Actions and observations"]
end

subgraph group_runtime["Execution runtime"]
  node_runtime["Sandbox runtime<br/>[runtime.py]"]
  node_client["Runtime client<br/>[client.py]"]
  node_browser["Browser environment<br/>[browser_env.py]"]
  node_plugins["Runtime plugins"]
end

subgraph group_platform["Platform services"]
  node_storage[("File storage<br/>[files.py]")]
  node_security["Security analysis<br/>[analyzer.py]"]
end

node_user(("Developer"))

node_user -->|"uses"| node_web
node_web -->|"renders"| node_chat
node_web -->|"renders"| node_fileui
node_fileui -.->|"requests files"| node_fileapi
node_web -.->|"sends tasks"| node_sessionmgr
node_sessionmgr -->|"creates"| node_session
node_session -.->|"runs agent"| node_controller
node_controller -->|"steps"| node_agent
node_controller -->|"updates"| node_state
node_controller -->|"creates for delegate"| node_llm
node_controller -->|"handles events"| node_events
node_agent -.->|"parses responses"| node_parser
node_parser -->|"produces actions"| node_events
node_agent -.->|"requests completions"| node_llm
node_controller -.->|"dispatches actions"| node_runtime
node_runtime -.->|"hosts"| node_client
node_client -->|"uses"| node_browser
node_client -->|"loads plugins"| node_plugins
node_client -.->|"executes actions"| node_events
node_sessionmgr -->|"receives store"| node_storage
node_user -->|"runs headless or interactive"| node_cli
node_web -.->|"offers security view"| node_security

click node_web "https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/App.tsx"
click node_chat "https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/components/chat/ChatInterface.tsx"
click node_fileui "https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/components/Workspace.tsx"
click node_fileapi "https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/services/fileService.ts"
click node_sessionmgr "https://github.com/ramrohitaws99/openhands/blob/main/openhands/server/session/manager.py"
click node_session "https://github.com/ramrohitaws99/openhands/blob/main/openhands/server/session/session.py"
click node_controller "https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/agent_controller.py"
click node_state "https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/state/state.py"
click node_agent "https://github.com/ramrohitaws99/openhands/tree/main/agenthub"
click node_parser "https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/action_parser.py"
click node_llm "https://github.com/ramrohitaws99/openhands/blob/main/openhands/llm/llm.py"
click node_events "https://github.com/ramrohitaws99/openhands/tree/main/openhands/events"
click node_runtime "https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/runtime.py"
click node_client "https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/client/client.py"
click node_browser "https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/browser/browser_env.py"
click node_plugins "https://github.com/ramrohitaws99/openhands/tree/main/openhands/runtime/plugins"
click node_storage "https://github.com/ramrohitaws99/openhands/blob/main/openhands/storage/files.py"
click node_security "https://github.com/ramrohitaws99/openhands/blob/main/openhands/security/analyzer.py"
click node_cli "https://github.com/ramrohitaws99/openhands/blob/main/openhands/core/cli.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_web,node_chat,node_fileui,node_fileapi,node_cli toneBlue
class node_sessionmgr,node_session,node_controller,node_state toneAmber
class node_agent,node_parser,node_llm,node_events toneMint
class node_runtime,node_client,node_browser,node_plugins toneRose
class node_storage,node_security,node_user toneIndigo
```

## Components

### User interfaces

- [Web application](https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Chat interface](https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/components/chat/ChatInterface.tsx): `frontend/src/components/chat/ChatInterface.tsx`
- [Workspace and files](https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/components/Workspace.tsx): `frontend/src/components/Workspace.tsx`
- [File service](https://github.com/ramrohitaws99/openhands/blob/main/frontend/src/services/fileService.ts): `frontend/src/services/fileService.ts`
- [CLI entry point](https://github.com/ramrohitaws99/openhands/blob/main/openhands/core/cli.py): `openhands/core/cli.py`

### Sessions and control

- [Session manager](https://github.com/ramrohitaws99/openhands/blob/main/openhands/server/session/manager.py): `openhands/server/session/manager.py`
- [Agent session](https://github.com/ramrohitaws99/openhands/blob/main/openhands/server/session/session.py): `openhands/server/session/session.py`
- [Agent controller](https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/agent_controller.py): `openhands/controller/agent_controller.py`
- [Task state](https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/state/state.py): `openhands/controller/state/state.py`

### Agents and models

- [Agent implementations](https://github.com/ramrohitaws99/openhands/tree/main/agenthub): `agenthub`
- [Action parsing](https://github.com/ramrohitaws99/openhands/blob/main/openhands/controller/action_parser.py): `openhands/controller/action_parser.py`
- [LLM provider layer](https://github.com/ramrohitaws99/openhands/blob/main/openhands/llm/llm.py): `openhands/llm/llm.py`
- [Actions and observations](https://github.com/ramrohitaws99/openhands/tree/main/openhands/events): `openhands/events`

### Execution runtime

- [Sandbox runtime](https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/runtime.py): `openhands/runtime/runtime.py`
- [Runtime client](https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/client/client.py): `openhands/runtime/client/client.py`
- [Browser environment](https://github.com/ramrohitaws99/openhands/blob/main/openhands/runtime/browser/browser_env.py): `openhands/runtime/browser/browser_env.py`
- [Runtime plugins](https://github.com/ramrohitaws99/openhands/tree/main/openhands/runtime/plugins): `openhands/runtime/plugins`

### Platform services

- [File storage](https://github.com/ramrohitaws99/openhands/blob/main/openhands/storage/files.py): `openhands/storage/files.py`
- [Security analysis](https://github.com/ramrohitaws99/openhands/blob/main/openhands/security/analyzer.py): `openhands/security/analyzer.py`

### Other components

- **Developer**

## Connections

- Developer → Web application: uses (evidence: `README.md`)
- Web application → Chat interface: renders (evidence: `frontend/src/App.tsx`)
- Web application → Workspace and files: renders (evidence: `frontend/src/App.tsx`)
- Workspace and files → File service: requests files
- Web application → Session manager: sends tasks
- Session manager → Agent session: creates (evidence: `openhands/server/session/manager.py`)
- Agent session → Agent controller: runs agent
- Agent controller → Agent implementations: steps (evidence: `openhands/controller/agent_controller.py`)
- Agent controller → Task state: updates (evidence: `openhands/controller/agent_controller.py`)
- Agent controller → LLM provider layer: creates for delegate (evidence: `openhands/controller/agent_controller.py`)
- Agent controller → Actions and observations: handles events (evidence: `openhands/controller/agent_controller.py`)
- Agent implementations → Action parsing: parses responses (evidence: `agenthub/codeact_agent/action_parser.py`)
- Action parsing → Actions and observations: produces actions (evidence: `agenthub/codeact_agent/action_parser.py`)
- Agent implementations → LLM provider layer: requests completions
- Agent controller → Sandbox runtime: dispatches actions
- Sandbox runtime → Runtime client: hosts
- Runtime client → Browser environment: uses (evidence: `openhands/runtime/client/client.py`)
- Runtime client → Runtime plugins: loads plugins (evidence: `openhands/runtime/client/client.py`)
- Runtime client → Actions and observations: executes actions (evidence: `openhands/runtime/client/client.py`)
- Session manager → File storage: receives store (evidence: `openhands/server/session/manager.py`)
- Developer → CLI entry point: runs headless or interactive (evidence: `README.md`)
- Web application → Security analysis: offers security view
