# carlosbasto/sap-a2a-mcp-agentic-ai architecture

> Architecture diagram of the GitHub repository carlosbasto/sap-a2a-mcp-agentic-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carlosbasto/sap-a2a-mcp-agentic-ai
- Repository: https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai

## Overview

##### Project type and purpose
- From the file tree and README, this is a Python-based agent framework (“sap-a2a-mcp-agentic-ai”) designed for application-to-application (A2A) integration, specifically with an SAP system. It provides:
- Agent implementations (e.g., SAP agent, utility agent)
- A common client/server layer for inter-agent communication and task orchestration
- Shared types and utilities for caching, notifications, and data models

##### File structure
- Top-level directories:
- A2A/agents – concrete agent implementations, each in its own sub-module (sap, utils)
- A2A/common – the shared communications layer:
– client/ (client APIs, card_resolver, client abstractions)
– server/ (server, task_manager, utils)
– utils/ (in_memory_cache, push_notification_auth)
– types.py (shared data schemas)
- Project roots include pyproject.toml + lock files, indicating Poetry or pip-tools for dependency management.
- Patterns:
- Modular plugin style: each agent is an independent module with its own entry point (__main__.py)
- Shared client/server boundary for RPC or message passing
- Task manager pattern for coordinating work

##### Key insights from README
- Although very brief, the project name tells us the focus: a micro-service or agentic framework for SAP A2A communication.

##### Main components & their interactions
a. Agents
- SAP Agent (A2A/agents/sap)
- Utility Agent (A2A/agents/utils)
– Each agent:
– __main__.py: entry point
– agent.py: core behavior
– task_manager.py: schedules sub-tasks
b. Common Client Library (A2A/common/client)
– Exposes client interfaces for agents and external callers
– card_resolver: resolves payload formats
c. Common Server (A2A/common/server)
– Implements a central task server (server.py)
– task_manager: orchestrates tasks across agents
– utils: helper functions
d. Shared Utilities
- In-memory cache (for fast lookup)
- Push notification auth (for external notifications)
e. Data Schemas (common/types.py)
– Defines message formats, request/response types

##### Architectural patterns & design principles
- Modular architecture: decoupling agent implementations from communication layer
- Client-server pattern: all agents and external callers interact via a uniform RPC/API layer
- Task queue/manager pattern: server manages work distribution and state
- Shared types ensure consistency across modules
- Plugin/entry-point pattern: agents can be hot-swapped or extended

##### Diagramming recommendations
- From Agents → Common Client → Common Server (request flow)
- From Common Server → Agents (task dispatch)
- From Agents → External Systems (SAP API, Notification Service)
- Blue: Agents
- Green: Common Layer (client & server)
- Yellow: Shared Utilities & Types
- Grey: External Services

##### Summary
- Major Python modules as individual components

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Agents"
        subgraph "SAP Agent Module"
            SAP_Main["__main__.py"]:::agent
            SAP_Agent["agent.py"]:::agent
            SAP_TM["task_manager.py"]:::agent
        end
        subgraph "Utility Agent Module"
            UT_Main["__main__.py"]:::agent
            UT_Agent["agent.py"]:::agent
            UT_TM["task_manager.py"]:::agent
        end
    end

    subgraph "Common Layer"
        subgraph "Client Library"
            CL_Client["client.py"]:::common
            CL_Card["card_resolver.py"]:::common
        end
        subgraph "Server Layer"
            SV_Server["server.py"]:::common
            SV_TM["task_manager.py"]:::common
            SV_Utils["utils.py"]:::common
        end
    end

    subgraph "Shared Utilities & Types"
        UTIL_Cache["in_memory_cache.py"]:::util
        UTIL_Push["push_notification_auth.py"]:::util
        TYPES["types.py"]:::util
    end

    subgraph "External Services"
        SAP_Backend[(SAP System)]:::external
        Notif[(Notification Service)]:::external
    end

    %% Dependencies & Data Flow
    SAP_Main -->|"loads types"| TYPES
    SAP_Agent -->|"uses cache"| UTIL_Cache
    SAP_Agent -->|"sends notification"| UTIL_Push
    UT_Agent -->|"uses cache"| UTIL_Cache
    SAP_TM -->|"orchestrates"| SAP_Agent
    UT_TM -->|"orchestrates"| UT_Agent

    SAP_Agent -->|"calls client API"| CL_Client
    UT_Agent -->|"calls client API"| CL_Client

    CL_Client -->|"requests RPC"| SV_Server
    SV_Server -->|"enqueues task"| SV_TM
    SV_TM -->|"dispatches to SAP TM"| SAP_TM
    SV_TM -->|"dispatches to UT TM"| UT_TM

    SAP_Agent -->|"calls SAP API"| SAP_Backend
    UT_Agent -->|"calls Notification"| Notif

    SAP_Agent -->|"reports result"| SV_Server
    UT_Agent -->|"reports result"| SV_Server

    %% Click Events
    click SAP_Main "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/sap/__main__.py"
    click SAP_Agent "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/sap/agent.py"
    click SAP_TM "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/sap/task_manager.py"
    click UT_Main "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/utils/__main__.py"
    click UT_Agent "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/utils/agent.py"
    click UT_TM "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/agents/utils/task_manager.py"
    click CL_Client "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/client/client.py"
    click CL_Card "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/client/card_resolver.py"
    click SV_Server "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/server/server.py"
    click SV_TM "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/server/task_manager.py"
    click SV_Utils "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/server/utils.py"
    click UTIL_Cache "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/utils/in_memory_cache.py"
    click UTIL_Push "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/utils/push_notification_auth.py"
    click TYPES "https://github.com/carlosbasto/sap-a2a-mcp-agentic-ai/blob/main/A2A/common/types.py"

    %% Styles
    classDef agent fill:#cce5ff,stroke:#004085;
    classDef common fill:#d4edda,stroke:#155724;
    classDef util fill:#fff3cd,stroke:#856404;
    classDef external fill:#e2e3e5,stroke:#6c757d;
```
