# bayrameker/agentic-team-framework architecture

> Architecture diagram of the GitHub repository bayrameker/agentic-team-framework, 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/bayrameker/agentic-team-framework
- Repository: https://github.com/bayrameker/agentic-team-framework

## Overview

##### Major Components & Layers
- Frontend/UI Layer:
- Two frontend subdirectories are visible: “app/static” and “src/ui”. The “src/ui” folder (which includes package.json, public and src subdirectories, React components, pages, and services) indicates that React (or a similar framework) is used to build the user interface. This layer is responsible for the web UI (as noted in the README at http://localhost:8000) that interacts with the API.
- Backend/API Layer:
- The entry points “app.py” and “src/api/app.py” define the RESTful API endpoints. The API endpoints such as “/api/models”, “/api/teams”, and actions related to tasks are clearly documented in the README.
- This layer handles actions like creating teams, loading and interacting with LLM models, task management, and interacting with agents.
- Agent & Team Orchestration Layer:
- Look at “src/agents” (with files such as agent.py, base_agent.py, llm_agent.py, task.py, team.py). Here you have the logic for creating various types of agents.
- “src/teams” and other files like “src/team_manager.py” handle the organization of these agents into teams and the assignment/distribution of tasks.
- Model Integration & External Service Adaptation:
- “src/models” (including ollama.py, agent.py, team.py, etc.) show that the different LLM models (such as llama3, mistral, mixtral, etc.) are integrated via an adapter. This is where communication with the external Ollama service is encapsulated.
- Core Services and Utilities:
- Within “src/core”, “src/utils”, and similar helpers, you have code for logging, configuration, and other shared services.
- Data/Configuration:
- The “data” directory (containing JSON files for bugs, messages, tasks, teams) represents persistent data storage or a simple datastore.
- Environment files (.env, .env.example) and configuration files provide runtime configurations.

##### Relationships and Interactions
- Within the API layer, show calls to the Agent Orchestration Services – using the classes under “src/agents” and “src/teams”. This indicates the distribution of tasks and team formation.

##### Architectural Patterns & Design Principles
- Separation of concerns: Clearly demarcate between the front‑end (presentation), the API server (controller), and the business logic / agent orchestration (model).
- Modularization: Each major functionality (agent behavior, team management, external model integration) exists in its own module/folder.
- Extensibility: The architecture supports the addition of new LLM models or agents through clearly defined interfaces (e.g., in “src/models/” and “src/agents/”).

##### Relevant Technologies & Frameworks
- Frontend: React (implied by “src/ui” structure with components, pages, package.json).
- Backend: Python (with Flask/FastAPI style API design, as suggested by file names and REST API endpoints).
- External Services: Ollama for LLM services.
- Data Storage: JSON files for persistent state.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend/UI Layer
    subgraph "Frontend/UI Layer"
        direction TB
        UI1["React UI"]:::frontend
        UI2["Static Assets"]:::frontend
    end

    %% Backend/API Layer
    subgraph "Backend/API Layer"
        direction TB
        API1["API Server"]:::backend
        subgraph "API Endpoints"
            direction TB
            APIEntrypoint1["Backend Main Entry"]:::backend
            APIRoutes["API Routes"]:::backend
        end
    end

    %% Agent & Team Orchestration Layer
    subgraph "Agent & Team Orchestration"
        direction TB
        Agents["Agent Services"]:::internal
        Teams["Team Management"]:::internal
    end

    %% Model Integration & External Service Adaptation
    subgraph "Model Integration"
        direction TB
        Models["LLM Model Integration"]:::internal
        Ollama["Ollama Service"]:::external
    end

    %% Core Services & Utilities
    subgraph "Core Services & Utilities"
        direction TB
        Core["Core Manager"]:::internal
        Utils["Utility Functions"]:::internal
    end

    %% Data/Configuration
    subgraph "Data/Configuration"
        direction TB
        Data["File-Based Data Storage"]:::storage
        Config["Env & Config Files"]:::storage
    end

    %% Connections between layers
    UI1 -->|"HTTP_Request"| API1
    UI2 -->|"HTTP_Request"| API1

    API1 -->|"RouteHandling"| APIEntrypoint1
    API1 -->|"RouteHandling"| APIRoutes

    API1 -->|"TaskDelegation"| Agents
    API1 -->|"TeamFormation"| Teams
    API1 -->|"ModelCall"| Models

    Models -->|"InvokeOllama"| Ollama

    Agents -->|"UtilizeCore"| Core
    Agents -->|"UtilizeUtils"| Utils
    Teams -->|"UtilizeCore"| Core
    Teams -->|"UtilizeUtils"| Utils

    API1 -->|"PersistData"| Data
    Agents -->|"PersistData"| Data
    Teams -->|"PersistData"| Data

    API1 -->|"LoadConfig"| Config

    %% Click Events
    click UI1 "https://github.com/bayrameker/agentic-team-framework/tree/main/src/ui"
    click UI2 "https://github.com/bayrameker/agentic-team-framework/tree/main/app/static"
    click APIEntrypoint1 "https://github.com/bayrameker/agentic-team-framework/blob/main/app.py"
    click APIRoutes "https://github.com/bayrameker/agentic-team-framework/tree/main/src/api"
    click Agents "https://github.com/bayrameker/agentic-team-framework/tree/main/src/agents"
    click Teams "https://github.com/bayrameker/agentic-team-framework/tree/main/src/teams"
    click Models "https://github.com/bayrameker/agentic-team-framework/tree/main/src/models"
    click Core "https://github.com/bayrameker/agentic-team-framework/tree/main/src/core"
    click Utils "https://github.com/bayrameker/agentic-team-framework/tree/main/src/utils"
    click Data "https://github.com/bayrameker/agentic-team-framework/tree/main/data"

    %% Styles
    classDef frontend fill:#9fd,stroke:#333,stroke-width:2px;
    classDef backend fill:#afa,stroke:#333,stroke-width:2px;
    classDef internal fill:#fea,stroke:#333,stroke-width:2px;
    classDef external fill:#ccc,stroke:#333,stroke-width:2px;
    classDef storage fill:#eef,stroke:#333,stroke-width:2px;
```
