ReActなどのエージェントシステムの大まかな処理はこのようになっている
sequenceDiagram
Agent ->> LLM: プロンプトを送信
LLM -->> Agent: LLMの出力
Agent ->> Tool: Actionの実行
Tool ->> Environment: Toolを実行
Environment -->> Tool: 生の実行結果
Tool -->> Agent: パースした実行結果
Hardpoint
が扱うのは Tool
、Environment
graph TD
A[Agent] -->|" run() "| B[Tool]
B -->|" execute() "| C[Environment]
C -->|ExitStatus| D[Tool Output]
C -->|Stdout| D
C -->|Stderr| D
C -->|Info| E[Environment Info]
D --> F[Observation]
E --> F
F --> B
B --> G[Observation Parser]
G --> A
subgraph Hardpoint Framework
subgraph Environment Interface
C
D
E
end
B
F
G
end
classDiagram
namespace workspace {
class Workspace {
<<interface>>
+create()
+start()
+stop()
+run()
+get_status() WorkspaceStatus
}
class WorkspaceStatus {
<<enumeration>>
CREATED
RESTARTING
RUNNING
REMOVING
PAUSED
EXITED
DEAD
}
class Docker {
image: string
user: string
machine: string
+create()
+start()
+stop()
+run()
+get_status() WorkspaceStatus
}
class Orbstack {
image: string
user: string
machine: string
+create()
+start()
+stop()
+run()
+get_status() WorkspaceStatus
}
}
namespace envs {
class Environment {
-workspace: Workspace
+tools: HashMap[str, Tool]
+step(action: Action) Observation
+boot() Result
+shutdown() Result
}
class Action {
+tool_name: string
+args: string
+work_dir: string
}
class Tool {
+command: string
+run(args: string) ToolOutput
}
class ToolOutput {
+status: ExitStatus
+stdout: Vec[u8]
+stderr: Vec[u8]
}
class EnvironmentInfo {
+info: string
+executor_status: WorkspaceStatus
}
class Observation {
+tool_output: ToolOutput
+env_info: EnvironmentInfo
}
}
Environment "1" *-- "1..*" Tool
Environment "1" *-- "1" Workspace
Environment -- Action
Action ..> Tool
Tool ..> ToolOutput
Observation "1" <|-- "1" ToolOutput
Observation "1" <|-- "1" EnvironmentInfo
Workspace <|.. Docker
Workspace <|.. Orbstack
Workspace o-- WorkspaceStatus
WorkspaceStatus --o EnvironmentInfo
Environment --> Observation: uses
sequenceDiagram
Gateway ->> Environment: bool()
alt Docker
Environment ->> Docker: create()
Docker ->> Docker: Create Container with specified image
Docker -->> Environment: WorkspaceStatus
else Orbstack
Environment ->> Orbstack: Create Orbstack VM
Orbstack ->> Orbstack: create()
Orbstack -->> Environment: WorkspaceStatus
end
Gateway ->> Environment: step()
alt Docker
Environment ->> Docker: Command
Docker ->> Docker: Execute command in created container
Docker -->> Environment: ToolOutput
Docker -->> Environment: EnvironmentInfo
else Orbstack
Environment ->> Orbstack: Create Orbstack VM
end