# rajeshbakthavachalam/agenticsdlc architecture

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

- Interactive diagram: https://gitdiagram.com/rajeshbakthavachalam/agenticsdlc
- Repository: https://github.com/rajeshbakthavachalam/agenticsdlc

## Overview

##### Project type and purpose
- AgenticSDLC is a full-stack, AI-driven SDLC orchestration platform tailored to automate the Software Development Lifecycle of complex projects (in this example, a WiFi7 management platform).
- It exposes both a programmatic REST API (FastAPI) and an interactive UI (Streamlit). Internally it uses a graph-based workflow engine, integrates with external LLM services, persists state in Redis, and emits Markdown artifacts to disk.

##### File structure
- Top-level entry points:
- app_api.py – FastAPI server
- app_streamlit.py – Streamlit UI
- dockerfile – containerizes Redis + application
- requirements.txt – dependencies
- Core code under src/dev_pilot:
- api/fastapi_app.py – API routing and controllers
- ui/streamlit_ui/streamlit_app.py – UI components and controls
- graph/graph_builder.py & graph_executor.py – constructs and runs the LangGraph workflow
- LLMS/… – adapters to Gemini, Groq, OpenAI
- cache/redis_cache.py – Redis connection and state persistence
- nodes/… – individual nodes for each SDLC phase (requirements, design, code, tests, etc.)
- state/sdlc_state.py – data models for session state
- dto/… – request/response schemas for API
- utils/… – logging, constants, helpers

##### Key insights from README
- Graph‐based workflow (LangGraph) drives sequential SDLC phases.
- Human-in-the-loop approval loops at each node.
- Generates artifacts to “artifacts/” (Markdown files).
- External services: LLM APIs and Redis.
- Two frontends: Streamlit (web UI) and FastAPI (REST).

##### Main components & relationships
A. Frontend layer
- Streamlit UI ──> calls FastAPI endpoints OR invokes graph executor directly
- REST API (FastAPI) ──> entrypoint for programmatic access
B. Backend layer
- Controller/service layer (api/) receives requests, transforms into DTOs, delegates to workflow engine
- Workflow engine (graph_builder + graph_executor) orchestrates nodes in sequence
- Node modules (nodes/*) implement each SDLC step, interacting with LLM clients for artifact generation
- State management (redis_cache + sdlc_state) for persisting session progress
C. External services
- LLM providers (OpenAI, Gemini, Groq) called by LLMS adapters
- Redis – key/value store for session state
D. Artifacts storage
- Filesystem “artifacts/” – stores generated Markdown docs per phase

##### Architectural patterns & design principles
- Modular, plugin-style nodes for each SDLC phase (Strategy/Command pattern)
- Graph orchestration (Workflow engine pattern)
- Clear separation: UI vs API vs core engine vs persistence vs external integrations
- Dependency injection of LLM clients & cache to enable easy swapping/testing

##### Final checklist
- Clear, descriptive labels on all components
- A note on the modular node structure and pluggable LLM adapters

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        STUI["Streamlit UI"]:::ui
        APIClient["REST API (FastAPI)"]:::ui
    end

    %% Backend Layer
    subgraph "Backend Layer"
        FA["FastAPI Service"]:::backend
        subgraph "Workflow Engine"
            GB["Graph Builder"]:::backend
            GE["Graph Executor"]:::backend
        end
    end

    %% Nodes
    subgraph "SDLC Phase Nodes"
        PRN["Project Requirements Node"]:::backend
        DDN["Design Document Node"]:::backend
        MDN["Markdown Artifact Node"]:::backend
        CN["Coding Node"]:::backend
    end

    %% LLM Adapters
    subgraph "LLM Adapters"
        Gem["Gemini LLM Adapter"]:::external
        Gro["Groq LLM Adapter"]:::external
        OAI["OpenAI LLM Adapter"]:::external
    end

    %% Persistence
    subgraph "Persistence"
        RC["Redis Cache"]:::persistence
        AR["Artifacts (Filesystem)"]:::persistence
    end

    %% Flow Connections
    STUI -->|"calls API"| FA
    APIClient -->|"calls API"| FA
    STUI -->|"invoke in-process"| GE
    FA -->|"POST /api/v1/sdlc/start"| GB
    FA -->|"POST /api/v1/sdlc/start"| GE
    GE -->|"executes phase"| PRN
    GE -->|"executes phase"| DDN
    GE -->|"executes phase"| MDN
    GE -->|"executes phase"| CN
    PRN -->|"LLM.generate(prompt)"| Gem
    PRN -->|"LLM.generate(prompt)"| Gro
    PRN -->|"LLM.generate(prompt)"| OAI
    DDN -->|"LLM.generate(prompt)"| Gem
    DDN -->|"LLM.generate(prompt)"| Gro
    DDN -->|"LLM.generate(prompt)"| OAI
    MDN -->|"LLM.generate(prompt)"| Gem
    MDN -->|"LLM.generate(prompt)"| Gro
    MDN -->|"LLM.generate(prompt)"| OAI
    CN -->|"LLM.generate(prompt)"| Gem
    CN -->|"LLM.generate(prompt)"| Gro
    CN -->|"LLM.generate(prompt)"| OAI
    FA -->|"session read/write"| RC
    GE -->|"session read/write"| RC
    PRN -->|"write Markdown"| AR
    DDN -->|"write Markdown"| AR
    MDN -->|"write Markdown"| AR
    CN -->|"write Markdown"| AR
    GE -->|"approval needed"| STUI

    %% Click Events
    click STUI "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/app_streamlit.py"
    click STUI "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/ui/streamlit_ui/streamlit_app.py"
    click FA "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/app_api.py"
    click FA "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/api/fastapi_app.py"
    click GB "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/graph/graph_builder.py"
    click GE "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/graph/graph_executor.py"
    click PRN "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/nodes/project_requirement_node.py"
    click DDN "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/nodes/design_document_node.py"
    click MDN "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/nodes/markdown_node.py"
    click CN "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/nodes/coding_node.py"
    click Gem "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/LLMS/geminillm.py"
    click Gro "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/LLMS/groqllm.py"
    click OAI "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/LLMS/openai_llm.py"
    click RC "https://github.com/rajeshbakthavachalam/agenticsdlc/blob/main/src/dev_pilot/cache/redis_cache.py"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#0366D6,color:#0366D6
    classDef backend fill:#E6FFEA,stroke:#2C662D,color:#2C662D
    classDef persistence fill:#FFF4E5,stroke:#CC8E00,color:#CC8E00
    classDef external fill:#F3E5FF,stroke:#6A1B9A,color:#6A1B9A
```
