# saiprasaad2002/d2c-agent architecture

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

- Interactive diagram: https://gitdiagram.com/saiprasaad2002/d2c-agent
- Repository: https://github.com/saiprasaad2002/d2c-agent

## Overview

##### Main Components
- Input Module: Represents the high-level natural language description users supply.
- Agents:
- Task Management Layer:
- UML Task (in tasks.py): Invokes the uml_generator.
- Code Task (in tasks.py): Relies on the context output from uml_task to drive code generation.
- Crew Workflow Manager:
- Crew (in crew.py): Orchestrates the execution order (sequentially) by defining and managing the tasks and agents using CrewAI’s workflow.
- Supporting Tools/Utilities:
- Tools (in tools.py): Although the file content is not detailed, it likely contains helper functions or classes to support the above modules.

##### Relationships and Interactions
- The process starts by receiving a natural language feature description.
- The Crew Workflow Manager ensures that the UML Task is executed first, then passes its output as the context to the Code Task.

##### Architectural Patterns and Design Principles
- Agent-Based Orchestration: The design leverages CrewAI’s multi-agent model, where dedicated agents handle distinct responsibilities.
- Sequential Task Dependency: Tasks are chained (uml_task → code_task) ensuring that output from one step is the input for the next.

##### Technologies and Frameworks
- CrewAI for agent orchestration.
- Gemini (LLM) for interpreting input and generating UML.
- Python (as the implementation language).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "CrewAI Workflow"
        Inp["Natural Language Input"]:::input
        Agent1["UML Generator Agent"]:::agent
        UMLTask["UML Task"]:::task
        CodeTask["Code Task"]:::task
        Agent2["Code Generator Agent"]:::agent
        Parser["PlantUML Parser (plantuml)"]:::parser

        Inp -->|"feeds"| Agent1
        Agent1 -->|"generates_UML"| UMLTask
        UMLTask -->|"passes_context"| CodeTask
        CodeTask -->|"triggers"| Agent2
        Agent2 -->|"parses_diagram"| Parser
    end

    Manager["Crew Workflow Manager"]:::manager
    Tools["Supporting Tools/Utilities"]:::tool

    Manager -->|"orchestrates_Input"| Inp
    Manager -->|"orchestrates_UMLAgent"| Agent1
    Manager -->|"orchestrates_UMLTask"| UMLTask
    Manager -->|"orchestrates_CodeTask"| CodeTask
    Manager -->|"orchestrates_CodeAgent"| Agent2
    Manager -->|"supports"| Tools

    classDef input fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef agent fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef task fill:#a9dfbf,stroke:#27ae60,stroke-width:2px,rx:5,ry:5;
    classDef manager fill:#f5b7b1,stroke:#cb4335,stroke-width:2px;
    classDef parser fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;
    classDef tool fill:#fad7a0,stroke:#d35400,stroke-width:2px;

    click Agent1 "https://github.com/saiprasaad2002/d2c-agent/blob/main/agents.py"
    click Agent2 "https://github.com/saiprasaad2002/d2c-agent/blob/main/agents.py"
    click UMLTask "https://github.com/saiprasaad2002/d2c-agent/blob/main/tasks.py"
    click CodeTask "https://github.com/saiprasaad2002/d2c-agent/blob/main/tasks.py"
    click Manager "https://github.com/saiprasaad2002/d2c-agent/blob/main/crew.py"
    click Tools "https://github.com/saiprasaad2002/d2c-agent/blob/main/tools.py"
```
