# shirsadip0907/gen_ai architecture

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

- Interactive diagram: https://gitdiagram.com/shirsadip0907/gen_ai
- Repository: https://github.com/shirsadip0907/gen_ai

## Overview

##### Main system components
- Frontend/UI: The interactive user interface built using Streamlit (represented by app.py).
- Multi-Agent Ecosystem: The pool of specialized agents – Project Lead, Business Analyst, Designer, Developer, and Tester (found under the agents/ directory). Each of these agents is responsible for a specific phase of the SDLC.
- Data and Artifact Storage: The ChromaDB component and associated SQLite databases (directories under chroma_db and the knowledge_base under data/knowledge_base).
- Database Management: The database module (database/db_manager.py) for artifact storage, retrieval, and versioning.
- Utility Module: Helper functions and tools (under utils/).

##### Interactions and data flows
- The user interacts with the Frontend (Streamlit), triggering project initialization.
- The Project Lead agent processes the project initiation and coordinates subsequent phases.
- The Business Analyst agent takes requirements and converts them into detailed user stories.
- The Designer agent generates the system and architectural design documents.
- The Developer agent converts these specifications into functional code through iterative feedback.
- The Tester agent is responsible for quality assurance by running tests and validating the final product.
- Artifacts and outputs from each phase are stored and retrieved from ChromaDB, ensuring continuity and context transfer throughout the lifecycle.
- The database manager acts as the custodian of these artifacts, interfacing with ChromaDB.

##### Architectural patterns and technology stacks
- Layered structure (Frontend, Agent orchestration, Data management, and Utilities).
- The overall pattern resembles a workflow pipeline, where each phase produces outputs that serve as inputs to the next.
- Noted design principles include separation of concerns, encapsulation (each AI agent has a defined role), and context propagation (via artifact storage and retrieval leveraging RAG capabilities).
- Technologies in use: Python 3.9+, Streamlit (frontend), ChromaDB/SQLite (data storage), LangChain and LiteLLM (LLM integrations), and the multi-agent framework CrewAI.

## Diagram (Mermaid)

```mermaid
graph LR
    %% Title
    %% NexusForge GENAI System Architecture (Landscape)

    %% Frontend Layer
    subgraph "Frontend Layer"
        UI["Streamlit UI - Frontend"]:::ui
    end

    %% Multi-Agent Ecosystem
    subgraph "Multi-Agent Ecosystem"
        PL["Project Lead Agent"]:::agent
        BA["Business Analyst Agent"]:::agent
        DS["Designer Agent"]:::agent
        DV["Developer Agent"]:::agent
        TS["Tester Agent"]:::agent
    end

    %% Data Management Layer
    subgraph "Data Management Layer"
        DM["Database Manager"]:::db
        DB["ChromaDB / Knowledge Base"]:::db
    end

    %% Utility Services
    subgraph "Utility Services"
        UT["Utility Module"]:::utility
    end

    %% Sequential Workflow Connections
    UI -->|"InitializationDoc"| PL
    PL -->|"Requirements"| BA
    BA -->|"UserStories"| DS
    DS -->|"DesignDoc"| DV
    DV -->|"CodeImplementation"| TS
    TS -->|"TestPlan"| DM

    %% Agents pushing artifacts to Database Manager
    PL -->|"Artifacts"| DM
    BA -->|"Artifacts"| DM
    DS -->|"Artifacts"| DM
    DV -->|"Artifacts"| DM
    TS -->|"Artifacts"| DM

    %% Database Manager interacts with ChromaDB / Knowledge Base
    DM -->|"StoresRetrieves"| DB

    %% Utility interactions with Agents and Database Manager
    UT ---|"HelperFunctions"| DM
    UT ---|"HelperFunctions"| PL
    UT ---|"HelperFunctions"| BA
    UT ---|"HelperFunctions"| DS
    UT ---|"HelperFunctions"| DV
    UT ---|"HelperFunctions"| TS

    %% Styles
    classDef ui fill:#add8e6,stroke:#000,stroke-width:1px;
    classDef agent fill:#90ee90,stroke:#000,stroke-width:1px;
    classDef db fill:#ffcccb,stroke:#000,stroke-width:1px;
    classDef utility fill:#f9e79f,stroke:#000,stroke-width:1px;

    %% Click Events
    click UI "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/app.py"
    click PL "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/agents/project_lead.py"
    click BA "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/agents/business_analyst.py"
    click DS "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/agents/designer.py"
    click DV "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/agents/developer.py"
    click TS "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/agents/tester.py"
    click DM "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/database/db_manager.py"
    click DB "https://github.com/shirsadip0907/gen_ai/tree/main/GenerativeAIPro/chroma_db"
    click DB "https://github.com/shirsadip0907/gen_ai/tree/main/GenerativeAIPro/data/knowledge_base"
    click UT "https://github.com/shirsadip0907/gen_ai/blob/main/GenerativeAIPro/utils/helpers.py"
```
