# astronaut-08/autonomous_agent_design architecture

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

- Interactive diagram: https://gitdiagram.com/astronaut-08/autonomous_agent_design
- Repository: https://github.com/astronaut-08/autonomous_agent_design

## Overview

This repository contains two restaurant-menu agent designs: a ReAct agent that answers menu and ordering questions, and a plan/execute agent that plans multi-step tasks and can pause risky actions for human approval. The primary workflow is request → model decision → tools → formatted response; the second design adds planning, execution, and replanning. The tree and excerpts also show a separate knowledge-search capability. Some subsystem wiring is unsampled, so those relationships are omitted rather than inferred.

Main entry points: [`hw1_react_agent/agent.py`](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/agent.py) (Agent Runtime), [`hw2_plan_execute/plan_execute.py`](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/plan_execute.py) (Plan Execute Graph), [`hw2_plan_execute/tools.py`](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/tools.py) (Task Tools), [`hw1_react_agent/tools.py`](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/tools.py) (Menu Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_react["ReAct Menu Agent"]
  node_react_runtime["Agent Runtime<br/>[agent.py]"]
  node_react_safety["Run Safety<br/>[safety.py]"]
  node_react_logger["Trajectory Logger<br/>[logger.py]"]
  node_react_response["Response Formatter<br/>[agent.py]"]
end

subgraph group_menu["Menu Domain"]
  node_react_tools["Menu Tools<br/>[tools.py]"]
  node_react_menu[("Menu Data<br/>[menu_data.py]")]
  node_plan_menu[("Menu Data<br/>[menu_data.py]")]
end

subgraph group_planner["Plan Execute"]
  node_plan_runtime["Plan Execute Graph<br/>[plan_execute.py]"]
  node_plan_schema["Input Schemas<br/>[schema.py]"]
  node_plan_tools["Task Tools<br/>[tools.py]"]
  node_knowledge[("Knowledge Search<br/>[knowledge.py]")]
  node_hitl["Approval Executor<br/>[hitl.py]"]
end

node_user(("User"))
node_human(("Approving Operator"))

node_user -->|"submits request"| node_react_runtime
node_react_runtime -->|"dispatches calls"| node_react_tools
node_react_tools -->|"reads menu"| node_react_menu
node_react_runtime -->|"checks limits"| node_react_safety
node_react_runtime -->|"logs steps"| node_react_logger
node_react_runtime -->|"routes response"| node_react_response
node_user -->|"submits task"| node_plan_runtime
node_plan_runtime -.->|"uses schemas"| node_plan_schema
node_plan_runtime -->|"invokes tools"| node_plan_tools
node_plan_tools -->|"reads menu"| node_plan_menu
node_human -->|"approves action"| node_hitl
node_hitl -->|"executes approved tool"| node_plan_tools

click node_react_runtime "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/agent.py"
click node_react_safety "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/safety.py"
click node_react_tools "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/tools.py"
click node_react_menu "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/menu_data.py"
click node_react_logger "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/logger.py"
click node_react_response "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/agent.py"
click node_plan_runtime "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/plan_execute.py"
click node_plan_schema "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/schema.py"
click node_plan_tools "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/tools.py"
click node_plan_menu "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/menu_data.py"
click node_knowledge "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/knowledge.py"
click node_hitl "https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/hitl.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_react_runtime,node_react_safety,node_react_logger,node_react_response,node_user toneBlue
class node_react_tools,node_react_menu,node_plan_menu toneAmber
class node_plan_runtime,node_plan_schema,node_plan_tools,node_knowledge,node_hitl toneMint
class node_human toneIndigo
```

## Components

### ReAct Menu Agent

- [Agent Runtime](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/agent.py): `hw1_react_agent/agent.py`
- [Run Safety](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/safety.py): `hw1_react_agent/safety.py`
- [Trajectory Logger](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/logger.py): `hw1_react_agent/logger.py`
- [Response Formatter](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/agent.py): `hw1_react_agent/agent.py`

### Menu Domain

- [Menu Tools](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/tools.py): `hw1_react_agent/tools.py`
- [Menu Data](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw1_react_agent/menu_data.py): `hw1_react_agent/menu_data.py`
- [Menu Data](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/menu_data.py): `hw2_plan_execute/menu_data.py`

### Plan Execute

- [Plan Execute Graph](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/plan_execute.py): `hw2_plan_execute/plan_execute.py`
- [Input Schemas](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/schema.py): `hw2_plan_execute/schema.py`
- [Task Tools](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/tools.py): `hw2_plan_execute/tools.py`
- [Knowledge Search](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/knowledge.py): `hw2_plan_execute/knowledge.py`
- [Approval Executor](https://github.com/astronaut-08/autonomous_agent_design/blob/main/hw2_plan_execute/hitl.py): `hw2_plan_execute/hitl.py`

### Other components

- **User**
- **Approving Operator**

## Connections

- User → Agent Runtime: submits request (evidence: `hw1_react_agent/agent.py`)
- Agent Runtime → Menu Tools: dispatches calls (evidence: `hw1_react_agent/agent.py`)
- Menu Tools → Menu Data: reads menu (evidence: `hw1_react_agent/tools.py`)
- Agent Runtime → Run Safety: checks limits (evidence: `hw1_react_agent/agent.py`)
- Agent Runtime → Trajectory Logger: logs steps (evidence: `hw1_react_agent/agent.py`)
- Agent Runtime → Response Formatter: routes response (evidence: `hw1_react_agent/agent.py`)
- User → Plan Execute Graph: submits task (evidence: `hw2_plan_execute/plan_execute.py`)
- Plan Execute Graph → Input Schemas: uses schemas (evidence: `hw2_plan_execute/schema.py`)
- Plan Execute Graph → Task Tools: invokes tools (evidence: `hw2_plan_execute/plan_execute.py`)
- Task Tools → Menu Data: reads menu (evidence: `hw2_plan_execute/tools.py`)
- Approving Operator → Approval Executor: approves action (evidence: `hw2_plan_execute/hitl.py`)
- Approval Executor → Task Tools: executes approved tool (evidence: `hw2_plan_execute/hitl.py`)
