# amap-cvlab/abot-claw architecture

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

- Interactive diagram: https://gitdiagram.com/amap-cvlab/abot-claw
- Repository: https://github.com/amap-cvlab/abot-claw

## Overview

ABot-Claw is a layered robotic-agent framework: an OpenClaw-side agent initiates tasks through a Piper robot server, which exposes robot state, execution, and control; separate services provide vision, grasping, task criticism, and persistent spatial memory. The README documents broader multi-robot VLA/WAM collaboration, but this tree contains only a Piper robot implementation and does not expose the OpenClaw runtime or those other robot implementations. Service-to-robot call wiring is not established by the sampled excerpts, so those links are omitted.

Main entry points: [`robot_layer/arm_piper/agent_server/server.py`](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/server.py) (Robot API), [`service_layer/SpatialMemory/app/api/routes.py`](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/api/routes.py) (Memory API), [`robot_layer/arm_piper/agent_server/routes/code_routes.py`](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/code_routes.py) (Code execution API), [`robot_layer/arm_piper/agent_server/routes/lease_routes.py`](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/lease_routes.py) (Lease API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent runtime"]
end

subgraph group_robot["Piper robot"]
  node_piper_api["Robot API<br/>[server.py]"]
  node_code_routes["Code execution API<br/>[code_routes.py]"]
  node_lease_routes["Lease API<br/>[lease_routes.py]"]
  node_state_routes["State API<br/>[state_routes.py]"]
  node_rewind_routes["Rewind API<br/>[rewind_routes.py]"]
  node_display_routes["Display API<br/>[display_routes.py]"]
  node_executor["Code executor<br/>[code_executor.py]"]
  node_lease["Lease manager<br/>[lease.py]"]
  node_state["State aggregator<br/>[state.py]"]
  node_robot_sdk["Piper SDK<br/>[piper_sdk.py]"]
  node_rewind["Rewind orchestrator"]
end

subgraph group_services["Perception services"]
  node_yolo["Object detection<br/>[main.py]"]
  node_vlac["VLAC critic<br/>[main.py]"]
  node_grasp["Grasp detection<br/>[main.py]"]
end

subgraph group_memory["Spatial memory"]
  node_memory_api["Memory API<br/>[routes.py]"]
  node_memory_service["Memory service<br/>[memory_service.py]"]
  node_task_service["Pipeline tasks<br/>[task_service.py]"]
  node_keyframe_pipeline["Offline keyframes"]
  node_sqlite[("Memory database<br/>[storage.py]")]
end

node_agent(("OpenClaw agent"))
node_robot_hardware{{"Piper arm"}}

node_agent -->|"sends tasks"| node_piper_api
node_piper_api -->|"registers routes"| node_code_routes
node_piper_api -->|"registers routes"| node_lease_routes
node_piper_api -->|"registers routes"| node_state_routes
node_piper_api -->|"registers routes"| node_rewind_routes
node_piper_api -->|"registers routes"| node_display_routes
node_code_routes -->|"dispatches code"| node_executor
node_lease_routes -->|"uses manager"| node_lease
node_state_routes -->|"reads state"| node_state
node_state -->|"polls robot"| node_robot_sdk
node_robot_sdk -->|"controls arm"| node_robot_hardware
node_rewind_routes -->|"requests rewind"| node_rewind
node_memory_api -->|"calls memory"| node_memory_service
node_memory_api -->|"creates tasks"| node_task_service
node_memory_service -->|"reads and writes"| node_sqlite
node_task_service -->|"stores task state"| node_sqlite
node_yolo -.->|"returns detections"| node_agent
node_vlac -.->|"returns critique"| node_agent
node_grasp -.->|"returns grasp poses"| node_agent
node_memory_api -.->|"serves memory queries"| node_agent

click node_piper_api "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/server.py"
click node_code_routes "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/code_routes.py"
click node_lease_routes "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/lease_routes.py"
click node_state_routes "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/state_routes.py"
click node_rewind_routes "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/rewind_routes.py"
click node_display_routes "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/display_routes.py"
click node_executor "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/code_executor.py"
click node_lease "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/lease.py"
click node_state "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/state.py"
click node_robot_sdk "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/robot_sdk/piper_sdk.py"
click node_rewind "https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/system_logger/system_logger/rewind_orchestrator.py"
click node_yolo "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/YOLO/main.py"
click node_vlac "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/VLAC/main.py"
click node_grasp "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/GraspAnything/main.py"
click node_memory_api "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/api/routes.py"
click node_memory_service "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/services/memory_service.py"
click node_task_service "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/services/task_service.py"
click node_keyframe_pipeline "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/pipelines/offline_keyframe_pipeline.py"
click node_sqlite "https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/storage.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_piper_api,node_code_routes,node_lease_routes,node_state_routes,node_rewind_routes,node_display_routes,node_executor,node_lease,node_state,node_robot_sdk,node_rewind toneAmber
class node_yolo,node_vlac,node_grasp toneMint
class node_memory_api,node_memory_service,node_task_service,node_keyframe_pipeline,node_sqlite toneRose
class node_agent,node_robot_hardware toneIndigo
```

## Components

### Piper robot

- [Robot API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/server.py): `robot_layer/arm_piper/agent_server/server.py`
- [Code execution API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/code_routes.py): `robot_layer/arm_piper/agent_server/routes/code_routes.py`
- [Lease API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/lease_routes.py): `robot_layer/arm_piper/agent_server/routes/lease_routes.py`
- [State API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/state_routes.py): `robot_layer/arm_piper/agent_server/routes/state_routes.py`
- [Rewind API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/rewind_routes.py): `robot_layer/arm_piper/agent_server/routes/rewind_routes.py`
- [Display API](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/routes/display_routes.py): `robot_layer/arm_piper/agent_server/routes/display_routes.py`
- [Code executor](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/code_executor.py): `robot_layer/arm_piper/agent_server/code_executor.py`
- [Lease manager](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/lease.py): `robot_layer/arm_piper/agent_server/lease.py`
- [State aggregator](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/state.py): `robot_layer/arm_piper/agent_server/state.py`
- [Piper SDK](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/agent_server/robot_sdk/piper_sdk.py): `robot_layer/arm_piper/agent_server/robot_sdk/piper_sdk.py`
- [Rewind orchestrator](https://github.com/amap-cvlab/abot-claw/blob/main/robot_layer/arm_piper/system_logger/system_logger/rewind_orchestrator.py): `robot_layer/arm_piper/system_logger/system_logger/rewind_orchestrator.py`

### Perception services

- [Object detection](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/YOLO/main.py): `service_layer/YOLO/main.py`
- [VLAC critic](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/VLAC/main.py): `service_layer/VLAC/main.py`
- [Grasp detection](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/GraspAnything/main.py): `service_layer/GraspAnything/main.py`

### Spatial memory

- [Memory API](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/api/routes.py): `service_layer/SpatialMemory/app/api/routes.py`
- [Memory service](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/services/memory_service.py): `service_layer/SpatialMemory/app/services/memory_service.py`
- [Pipeline tasks](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/services/task_service.py): `service_layer/SpatialMemory/app/services/task_service.py`
- [Offline keyframes](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/pipelines/offline_keyframe_pipeline.py): `service_layer/SpatialMemory/pipelines/offline_keyframe_pipeline.py`
- [Memory database](https://github.com/amap-cvlab/abot-claw/blob/main/service_layer/SpatialMemory/app/storage.py): `service_layer/SpatialMemory/app/storage.py`

### Other components

- **OpenClaw agent**
- **Piper arm**

## Connections

- OpenClaw agent → Robot API: sends tasks
- Robot API → Code execution API: registers routes
- Robot API → Lease API: registers routes
- Robot API → State API: registers routes
- Robot API → Rewind API: registers routes
- Robot API → Display API: registers routes
- Code execution API → Code executor: dispatches code
- Lease API → Lease manager: uses manager
- State API → State aggregator: reads state
- State aggregator → Piper SDK: polls robot
- Piper SDK → Piper arm: controls arm
- Rewind API → Rewind orchestrator: requests rewind
- Memory API → Memory service: calls memory
- Memory API → Pipeline tasks: creates tasks
- Memory service → Memory database: reads and writes
- Pipeline tasks → Memory database: stores task state
- Object detection → OpenClaw agent: returns detections
- VLAC critic → OpenClaw agent: returns critique
- Grasp detection → OpenClaw agent: returns grasp poses
- Memory API → OpenClaw agent: serves memory queries
