# marcopros/dlsais-project architecture

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

- Interactive diagram: https://gitdiagram.com/marcopros/dlsais-project
- Repository: https://github.com/marcopros/dlsais-project

## Overview

##### Project type and purpose
- This is a full-stack, distributed AI system (“Home Repair Assistant”) composed of multiple lightweight microservices (agents), a web frontend, and a shared database.
- Purpose: take a user’s home-repair request, run it through a pipeline of AI agents (diagnosis → DIY suggestion → matching → appointment → feedback), and connect the user with qualified professionals while collecting feedback.

##### File structure
Top-level:
- A2A/ – shared Python library for agent-to-agent RPC (client & server abstractions, task manager, utils)
- orchestrator/ – coordinates the end-to-end flow through agents
- diagnosis_agent_app/, matching_agent_app/, appointment_agent_app/, feedback_agent_app/ – four standalone Python agent services, each with:
– agent.py (logic)
– server.py (RPC entrypoint)
– task_manager.py (orchestrates sub-tasks)
– tools.py, utils.py (support functions)
– a2a_agent_card.json (metadata for card UI in chat)
- client/ – web UI: static/ (HTML, CSS, JS), server.py (serves pages and talks A2A client)
- database/ – mock Node.js microservice (models, populate script, test_connection), holds professionals, users, requests
- main.py & litellm_config.yaml & requirements.txt & pyproject.toml – root entrypoint and dependency/config files

##### README
- Describes five logical “agents”: Diagnosis, DIY, Matching, Appointment, Feedback
- Emphasizes NLP/ML processing and bridging users to pros

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        Browser["User Browser"]:::blue
        Frontend["Frontend Server"]:::blue
        Static["Static Assets<br/>(HTML/CSS/JS)"]:::blue
        Template["Templates"]:::blue
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        Orchestrator["Orchestrator Service"]:::green
        OrchTaskMgr["Orch Task Manager"]:::green
        OrchTools["Orch Tools"]:::green
    end

    %% A2A Messaging Layer
    subgraph "A2A Messaging Layer"
        A2AClient["A2A Client"]:::green
        A2AServer["A2A Server"]:::green
        A2ATaskMgr["A2A Task Manager"]:::green
        A2AUtils["A2A Utils"]:::green
    end

    %% Agent Layer
    subgraph "Agent Layer"
        Diagnosis["Diagnosis Agent"]:::orange
        Matching["Matching Agent"]:::orange
        Appointment["Appointment Agent"]:::orange
        Feedback["Feedback Agent"]:::orange
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        Database["Database Service"]:::gray
    end

    %% Connections
    Browser -->|"HTTP Request"| Frontend
    Frontend -->|"A2A RPC"| A2AClient
    A2AClient -->|"dispatch()"| Orchestrator
    Orchestrator -->|"task()"| A2ATaskMgr
    Orchestrator -->|"diagnose() call"| Diagnosis
    Diagnosis -->|"match() call"| Matching
    Matching -->|"schedule() call"| Appointment
    Appointment -->|"DB Query"| Database
    Browser -->|"Feedback Input"| Feedback
    Feedback -->|"report() call"| Orchestrator
    Diagnosis -->|"status update"| Orchestrator
    Matching -->|"status update"| Orchestrator
    Appointment -->|"status update"| Orchestrator
    Feedback -->|"status update"| Orchestrator

    %% Click Events
    click A2AClient "https://github.com/marcopros/dlsais-project/blob/main/A2A/client/client.py"
    click A2AServer "https://github.com/marcopros/dlsais-project/blob/main/A2A/server/server.py"
    click A2ATaskMgr "https://github.com/marcopros/dlsais-project/blob/main/A2A/server/task_manager.py"
    click A2AUtils "https://github.com/marcopros/dlsais-project/tree/main/A2A/utils/"
    click Frontend "https://github.com/marcopros/dlsais-project/blob/main/client/server.py"
    click Static "https://github.com/marcopros/dlsais-project/tree/main/client/static/"
    click Template "https://github.com/marcopros/dlsais-project/tree/main/client/template/"
    click Orchestrator "https://github.com/marcopros/dlsais-project/blob/main/orchestrator/server.py"
    click OrchTaskMgr "https://github.com/marcopros/dlsais-project/blob/main/orchestrator/task_manager.py"
    click OrchTools "https://github.com/marcopros/dlsais-project/blob/main/orchestrator/tools.py"
    click Diagnosis "https://github.com/marcopros/dlsais-project/blob/main/diagnosis_agent_app/server.py"
    click Matching "https://github.com/marcopros/dlsais-project/blob/main/matching_agent_app/server.py"
    click Appointment "https://github.com/marcopros/dlsais-project/blob/main/appointment_agent/server.py"
    click Feedback "https://github.com/marcopros/dlsais-project/blob/main/feedback_agent_app/server.py"
    click Database "https://github.com/marcopros/dlsais-project/tree/main/database/"

    %% Styles
    classDef blue fill:#D0E7FF,stroke:#333,stroke-width:1px
    classDef green fill:#D0FFD6,stroke:#333,stroke-width:1px
    classDef orange fill:#FFE7A0,stroke:#333,stroke-width:1px
    classDef gray fill:#E0E0E0,stroke:#333,stroke-width:1px
```
