# adipat/humanoid architecture

> Architecture diagram of the GitHub repository adipat/humanoid, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adipat/humanoid
- Repository: https://github.com/adipat/humanoid

## Overview

##### Main Components
- Client/Interface Layer: Represented by the example script (examples/basic_run.py) which prompts the user for input.
- Core Application Logic: The main functionality is in the “humanoid” package. Outline the primary module, humanoid/humanoid.py, which likely houses the main agent management and orchestration logic.
- Tooling/Utilities: The humanoid/tooling.py file likely contains helper functions or configuration management used by the main application.
- External Services:
- OpenAI API (as noted in the README for summoning agents)
- Potentially CrewAI (referenced as the agent and task management framework)

##### Out Relationships and Interactions
- That the core module interacts with tooling (humanoid/tooling.py) for configuration, error handling, or other utility operations.

##### Architectural Patterns & Design Principles
- Modularity: Emphasize the separation of concerns between the CLI, core logic, and utilities.
- External Integration: Clearly mark the integration point with external APIs.
- Configurability & Error Handling: Recognize built-in error handling and configuration management as depicted in the project's features.

##### Relevant Technologies and Frameworks
- Python (v3.8+ as indicated)
- OpenAI API (for autonomous agent processing)
- Mentioning CrewAI can be illustrated as part of the broader ecosystem if necessary.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client/Interface Layer
    subgraph "Client/Interface Layer"
        CLI["CLI: User Prompt<br/>(examples/basic_run.py)"]:::client
    end

    %% Core Application Logic
    subgraph "Core Application Logic"
        CORE["Core Module<br/>(humanoid/humanoid.py)"]:::core
        UTILS["Tooling/Utilities<br/>(humanoid/tooling.py)"]:::utilities
    end

    %% Configuration/Environment
    CONFIG["Configuration<br/>(.env settings)"]:::config

    %% External Services
    subgraph "External Services"
        OPENAI["OpenAI API"]:::external
        CREWAI["CrewAI Integration"]:::external
    end

    %% Data Flow
    CLI -->|"sends prompt"| CORE
    CORE -->|"invokes utilities"| UTILS
    CORE -->|"fetches response"| OPENAI
    CORE -->|"optionally triggers"| CREWAI
    CORE -->|"loads config"| CONFIG
    UTILS -->|"reads config"| CONFIG

    %% Click Events
    click CLI "https://github.com/adipat/humanoid/blob/main/examples/basic_run.py"
    click CORE "https://github.com/adipat/humanoid/blob/main/humanoid/humanoid.py"
    click UTILS "https://github.com/adipat/humanoid/blob/main/humanoid/tooling.py"

    %% Styles
    classDef client fill:#fef3c7,stroke:#f59e0b,stroke-width:2px;
    classDef core fill:#dbeafe,stroke:#3b82f6,stroke-width:2px;
    classDef utilities fill:#d1fae5,stroke:#10b981,stroke-width:2px;
    classDef config fill:#e0e7ff,stroke:#6366f1,stroke-width:2px,stroke-dasharray: 5 5;
    classDef external fill:#fee2e2,stroke:#ef4444,stroke-width:2px;
    
    %% Legend Annotation
    style CLI fill:#fef3c7,stroke:#f59e0b,stroke-width:2px
    style CORE fill:#dbeafe,stroke:#3b82f6,stroke-width:2px
    style UTILS fill:#d1fae5,stroke:#10b981,stroke-width:2px
    style CONFIG fill:#e0e7ff,stroke:#6366f1,stroke-width:2px,stroke-dasharray: 5 5
    style OPENAI fill:#fee2e2,stroke:#ef4444,stroke-width:2px
    style CREWAI fill:#fee2e2,stroke:#ef4444,stroke-width:2px
```
