openhands/README.md
This directory contains the core components of OpenHands.
Architecture Documentation with diagrams covering:
System Architecture Overview
Conversation Startup & WebSocket Flow
Agent Execution & LLM Flow
External Architecture Docs - Official documentation (v0 backend architecture)
The key classes in OpenHands are:
Here's the basic loop (in pseudocode) that drives agents.
while True:
prompt = agent.generate_prompt(state)
response = llm.completion(prompt)
action = agent.parse_response(response)
observation = runtime.run(action)
state = state.update(action, observation)
In reality, most of this is achieved through message passing, via the EventStream. The EventStream serves as the backbone for all communication in OpenHands.
flowchart LR
Agent--Actions-->AgentController
AgentController--State-->Agent
AgentController--Actions-->EventStream
EventStream--Observations-->AgentController
Runtime--Observations-->EventStream
EventStream--Actions-->Runtime
Frontend--Actions-->EventStream
Please refer to the documentation to learn more about Runtime.