# hauld/astrolix architecture

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

- Interactive diagram: https://gitdiagram.com/hauld/astrolix
- Repository: https://github.com/hauld/astrolix

## Overview

##### Main Components Identification

a) Agent System (Core)
- Represented by `agent.py`
- Handles autonomous behavior and task execution

b) Animation System
- Represented by `animate_flap.py`
- Handles character visualization and animations

c) Studio Environment
- Represented by `studio.py`
- Likely manages the creative environment and story generation

**[External Services Layer]**
- Twitter/X API Integration
- Time Management System

- ↕️

**[Core System Layer]**
- [Agent System (Central)]
- ↙️        ↘️
**[Animation System]  [Studio System]**

- ↕️

**[Storage Layer]**
- Memory Storage
- Image Assets

##### Component Relationships

- Blue: Core agent system
- Green: Animation components
- Purple: Studio/creative components
- Gray: External services
- Orange: Storage systems

##### Specific Elements

a) Agent System (Central):
- Task Scheduler
- Autonomous Decision Making
- Time Awareness Module
- Story Generation Engine

b) Animation System:
- Character Animation Controller
- Visual Asset Manager
- Animation State Machine

c) Studio Environment:
- Story Prompt Manager
- Creative Script Engine
- Interaction Handler

d) External Integrations:
- Social Media Interface (Twitter/X)
- Time Management System
- File System Interface

##### Technical Details to Highlight

Following technical aspects:
- Python-based architecture (as evidenced by .py files)
- Environment configuration (env.sample)
- Dependencies management (requirements.txt)

##### Data Flow Visualization

Following flows:
- Story generation → Animation → Social Media posting
- Time-based task execution
- Memory storage and retrieval
- Asset loading and management

This system design should effectively communicate both the technical architecture and the creative purpose of Astrolix as an autonomous AI character system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef core fill:#a8d1f0,stroke:#1a6ba6,stroke-width:2px
    classDef animation fill:#b7e6c9,stroke:#2d8749,stroke-width:2px
    classDef studio fill:#d4b8e6,stroke:#6b2d87,stroke-width:2px
    classDef external fill:#e0e0e0,stroke:#666666,stroke-width:2px
    classDef storage fill:#ffd4a8,stroke:#b66a1a,stroke-width:2px

    %% External Services Layer
    subgraph ExternalServices
        Twitter["Twitter/X API"]:::external
        TimeSystem["Time Management System"]:::external
        EnvConfig["Environment Config"]:::external
        Dependencies["Dependencies Manager"]:::external
    end

    %% Core System Layer
    subgraph CoreSystem
        Agent["Agent System"]:::core
        TaskScheduler["Task Scheduler"]:::core
        DecisionMaking["Decision Making"]:::core
        TimeAwareness["Time Awareness"]:::core
        StoryEngine["Story Generation"]:::core
    end

    %% Animation System
    subgraph AnimationSystem
        AnimController["Animation Controller"]:::animation
        AssetManager["Visual Asset Manager"]:::animation
        AnimState["Animation State Machine"]:::animation
    end

    %% Studio System
    subgraph StudioSystem
        PromptManager["Story Prompt Manager"]:::studio
        ScriptEngine["Creative Script Engine"]:::studio
        InteractionHandler["Interaction Handler"]:::studio
    end

    %% Storage Layer
    subgraph StorageSystem
        Memory["Memory Storage"]:::storage
        Assets["Image Assets"]:::storage
    end

    %% Relationships
    Agent --> TaskScheduler
    Agent --> DecisionMaking
    Agent --> TimeAwareness
    Agent --> StoryEngine

    TaskScheduler --> AnimController
    StoryEngine --> PromptManager
    DecisionMaking --> InteractionHandler
    TimeAwareness --> TimeSystem

    AnimController --> AssetManager
    AssetManager --> Assets
    AnimController --> AnimState

    PromptManager --> ScriptEngine
    ScriptEngine --> InteractionHandler
    InteractionHandler --> Twitter

    Agent -.-> Memory
    InteractionHandler -.-> Memory

    EnvConfig --> Agent
    Dependencies --> Agent

    %% Click events
    click Agent "https://github.com/hauld/astrolix/blob/main/src/agent.py"
    click AnimController "https://github.com/hauld/astrolix/blob/main/src/animate_flap.py"
    click PromptManager "https://github.com/hauld/astrolix/blob/main/src/studio.py"
    click EnvConfig "https://github.com/hauld/astrolix/blob/main/env.sample"
    click Dependencies "https://github.com/hauld/astrolix/blob/main/src/requirements.txt"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Animation Components"]:::animation
        L3["Studio Components"]:::studio
        L4["External Services"]:::external
        L5["Storage Systems"]:::storage
    end
```
