You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ff3de90
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: sdk/arch/agent.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: High-level architecture of the reasoning-action loop
5
5
6
6
The **Agent** component implements the core reasoning-action loop that drives autonomous task execution. It orchestrates LLM queries, tool execution, and context management through a stateless, event-driven architecture.
|**[`Agent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/agent/agent.py)**| Main implementation | Stateless reasoning-action loop executor |
62
-
|**[`AgentBase`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/agent/base.py)**| Abstract base class | Defines agent interface and initialization |
63
-
|**[`AgentContext`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/agent_context.py)**| Context container | Manages skills, prompts, and metadata |
64
-
|**[`Condenser`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/)**| History compression | Reduces context when token limits approached |
65
-
|**[`SecurityAnalyzer`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/security/)**| Safety validation | Evaluates action risk before execution |
61
+
|**[`Agent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/agent/agent.py)**| Main implementation | Stateless reasoning-action loop executor |
62
+
|**[`AgentBase`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/agent/base.py)**| Abstract base class | Defines agent interface and initialization |
63
+
|**[`AgentContext`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/agent_context.py)**| Context container | Manages skills, prompts, and metadata |
64
+
|**[`Condenser`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/)**| History compression | Reduces context when token limits approached |
65
+
|**[`SecurityAnalyzer`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/security/)**| Safety validation | Evaluates action risk before execution |
Copy file name to clipboardExpand all lines: sdk/arch/condenser.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: High-level architecture of the conversation history compression sys
5
5
6
6
The **Condenser** system manages conversation history compression to keep agent context within LLM token limits. It reduces long event histories into condensed summaries while preserving critical information for reasoning. For more details, read the [blog here](https://openhands.dev/blog/openhands-context-condensensation-for-more-efficient-ai-agents).
|**[`RollingCondenser`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/base.py)**| Rolling window base | Implements threshold-based triggering |
72
-
|**[`LLMSummarizingCondenser`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/llm_summarizing_condenser.py)**| LLM summarization | Uses LLM to generate summaries |
|**[`View`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/view.py)**| Event view | Represents history for LLM |
76
-
|**[`Condensation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Condensation event | Metadata about compression |
|**[`RollingCondenser`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/base.py)**| Rolling window base | Implements threshold-based triggering |
72
+
|**[`LLMSummarizingCondenser`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/context/condenser/llm_summarizing_condenser.py)**| LLM summarization | Uses LLM to generate summaries |
Copy file name to clipboardExpand all lines: sdk/arch/conversation.mdx
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: High-level architecture of the conversation orchestration system
5
5
6
6
The **Conversation** component orchestrates agent execution through structured message flows and state management. It serves as the primary interface for interacting with agents, managing their lifecycle from initialization to completion.
|**[`Conversation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/conversation.py)**| Unified entrypoint | Returns correct implementation based on workspace type |
65
-
|**[`LocalConversation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py)**| Local execution | Runs agent directly in process |
66
-
|**[`RemoteConversation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/impl/remote_conversation.py)**| Remote execution | Delegates to agent-server via HTTP/WebSocket |
67
-
|**[`ConversationState`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/state.py)**| State container | Pydantic model with validation and serialization |
68
-
|**[`EventLog`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/event_store.py)**| Event storage | Immutable append-only store with efficient queries |
64
+
|**[`Conversation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/conversation.py)**| Unified entrypoint | Returns correct implementation based on workspace type |
65
+
|**[`LocalConversation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py)**| Local execution | Runs agent directly in process |
66
+
|**[`RemoteConversation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/impl/remote_conversation.py)**| Remote execution | Delegates to agent-server via HTTP/WebSocket |
67
+
|**[`ConversationState`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/state.py)**| State container | Pydantic model with validation and serialization |
68
+
|**[`EventLog`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/event_store.py)**| Event storage | Immutable append-only store with efficient queries |
69
69
70
70
## Factory Pattern
71
71
72
-
The [`Conversation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/conversation.py) class automatically selects the correct implementation based on workspace type:
72
+
The [`Conversation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/conversation/conversation.py) class automatically selects the correct implementation based on workspace type:
Copy file name to clipboardExpand all lines: sdk/arch/design.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ V0 relied on mutable Python objects and dynamic typing, which led to silent inco
31
31
**V1 Principle:**
32
32
**Keep everything stateless, with exactly one mutable state.**
33
33
All components (agents, tools, LLMs, and configurations) are immutable Pydantic models validated at construction.
34
-
The only mutable entity is the [conversation state](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/conversation_state.py), a single source of truth that enables deterministic replay and robust persistence across sessions or distributed systems.
34
+
The only mutable entity is the [conversation state](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/conversation_state.py), a single source of truth that enables deterministic replay and robust persistence across sessions or distributed systems.
35
35
36
36
## Clear Boundaries between Agent and Applications
Copy file name to clipboardExpand all lines: sdk/arch/events.mdx
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: High-level architecture of the typed event framework
5
5
6
6
The **Event System** provides an immutable, type-safe event framework that drives agent execution and state management. Events form an append-only log that serves as both the agent's memory and the integration point for auxiliary services.
|**[`Event`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/base.py)**| Base event class | Immutable Pydantic model with ID, timestamp, source |
67
-
|**[`LLMConvertibleEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/base.py)**| LLM-compatible events | Abstract class with `to_llm_message()` method |
68
-
|**[`MessageEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/message.py)**| Text messages | User or assistant conversational messages with skills |
|**[`ObservationBaseEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| Tool response base | Base for all tool call responses |
|**[`UserRejectObservation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| User rejection | User rejected action in confirmation mode |
73
-
|**[`AgentErrorEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| Agent errors | Errors from agent/scaffold (not model output) |
74
-
|**[`SystemPromptEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/system.py)**| System context | System prompt with tool schemas |
75
-
|**[`CondensationSummaryEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Condenser summary | LLM-convertible summary of forgotten events |
76
-
|**[`ConversationStateUpdateEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/conversation_state.py)**| State updates | Key-value conversation state changes |
77
-
|**[`Condensation`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Condensation result | Events being forgotten with optional summary |
78
-
|**[`CondensationRequest`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Request compression | Trigger for conversation history compression |
79
-
|**[`PauseEvent`](https://github.com/All-Hands-AI/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/user_action.py)**| User pause | User requested pause of agent execution |
66
+
|**[`Event`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/base.py)**| Base event class | Immutable Pydantic model with ID, timestamp, source |
67
+
|**[`LLMConvertibleEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/base.py)**| LLM-compatible events | Abstract class with `to_llm_message()` method |
68
+
|**[`MessageEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/message.py)**| Text messages | User or assistant conversational messages with skills |
|**[`ObservationBaseEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| Tool response base | Base for all tool call responses |
|**[`UserRejectObservation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| User rejection | User rejected action in confirmation mode |
73
+
|**[`AgentErrorEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/observation.py)**| Agent errors | Errors from agent/scaffold (not model output) |
74
+
|**[`SystemPromptEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/llm_convertible/system.py)**| System context | System prompt with tool schemas |
75
+
|**[`CondensationSummaryEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Condenser summary | LLM-convertible summary of forgotten events |
76
+
|**[`ConversationStateUpdateEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/conversation_state.py)**| State updates | Key-value conversation state changes |
77
+
|**[`Condensation`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Condensation result | Events being forgotten with optional summary |
78
+
|**[`CondensationRequest`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/condenser.py)**| Request compression | Trigger for conversation history compression |
79
+
|**[`PauseEvent`](https://github.com/OpenHands/agent-sdk/blob/main/openhands-sdk/openhands/sdk/event/user_action.py)**| User pause | User requested pause of agent execution |
0 commit comments