# agenticsorg/edge-agents architecture

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

- Interactive diagram: https://gitdiagram.com/agenticsorg/edge-agents
- Repository: https://github.com/agenticsorg/edge-agents

## Overview

##### Main Components
– Agent Functions (e.g., agent_alpha, agent_beta, agent_stream, agent_websocket, agentic_inbox_agent)
– Management Functions (e.g., agent-manager, edge_deployment)
– Communication Functions (e.g., resend, send-contact-notification)
– Integration Functions (e.g., github-api, mcp-server)
– Utility Functions (e.g., stripe_check-subscription-status, feedback, test-function)
- MCP Server and Agent Orchestration: The “scripts/agentic-mcp” package appears to implement the Model Context Protocol server. Represent its role in coordinating multi-agent workflows, performing web research, summarization, context management, and offering additional tools.
- Agent Implementations: There are multiple agent projects throughout the file tree (e.g., agents/*, scripts/agents, scripts/openai-agent, gemini-rotator, gemini-tumbler, sparc2). These components show examples of agent clients, orchestration, and even testing frameworks.
- Supporting Tools & Libraries: In addition to the agents and MCP server, include components that provide utility functions for:
– Database operations (database integration with Supabase/PostgreSQL)
– Real-time communication (using Supabase’s channels)
– Secure secrets management
– Logging/tracing and debugging (as seen by tracing modules within agents and extensive tests)
- External Services and Infrastructure: Highlight the use of:
– Supabase (for edge functions, real-time capabilities, and database interactions)
– Deno (the runtime powering many of these functions)
– Third-party integrations (like OpenAI APIs, GitHub APIs, Stripe, Resend, Calendly, etc.)

##### Relationships and Interactions
- Internal agent communication and orchestration. For example, an incoming request might be processed by an agent function that uses the MCP server to delegate tasks to specialized agents.
- How the management functions allow deployment and dynamic workflow management between agents.
– Between client calls and edge functions (low latency, secure access)
– Between the MCP server and individual agents (orchestration and context management)
– Between edge functions and external services (database queries, authentication, and external API calls)

##### Architectural Patterns and Design Principles
- Microservice or modular design: Each function or agent is an independent component that can be developed, tested, and deployed individually.
- Separation of concerns: Different folders are dedicated to agents, management, integration, and utility functions.
- Event-driven and real-time: Emphasize how the platform leverages Supabase’s real-time channels and edge function architecture.
- Security-first: Illustrate the use of Deno with explicit permissions and secure handling of environment variables and secrets.
- Scalability: Note the dynamic scaling aspect tied to serverless deployment at the network edge.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Client Applications
    Client("Agentic Dashboard/Agentic Inbox"):::front_clients

    %% Edge Functions (Supabase)
    subgraph "Edge Functions (Supabase)"
        %% Agent Functions
        subgraph "Agent Functions"
            A_alpha("agent_alpha"):::edge_functions
            A_beta("agent_beta"):::edge_functions
            A_stream("agent_stream"):::edge_functions
            A_websocket("agent_websocket"):::edge_functions
            A_inbox("agentic_inbox_agent"):::edge_functions
        end
        %% Management Functions
        subgraph "Management Functions"
            M_manager("agent-manager"):::edge_functions
            M_deploy("edge_deployment"):::edge_functions
        end
        %% Communication Functions
        subgraph "Communication Functions"
            C_resend("resend"):::edge_functions
            C_contact("send-contact-notification"):::edge_functions
        end
        %% Integration Functions
        subgraph "Integration Functions"
            I_github("github-api"):::edge_functions
            I_mcp("mcp-server"):::edge_functions
        end
        %% Utility Functions
        subgraph "Utility Functions"
            U_stripe("stripe_check-subscription-status"):::edge_functions
            U_feedback("feedback"):::edge_functions
            U_test("test-function"):::edge_functions
        end
    end

    %% MCP Server and Agent Orchestration
    subgraph "MCP Server and Agentic Orchestrator"
        MCP("MCP Server / Agentic Orchestrator"):::mcp
        MCP_tools("MCP Tools"):::mcp
    end

    %% Agent Implementations
    subgraph "Agent Implementations"
        Agents_general("General Agents (agents/*)"):::agents
        Agents_scripts("Scripts Agents (scripts/agents)"):::agents
        Agents_openai("OpenAI Agent"):::agents
        Agents_gemini("Gemini Agents"):::agents
        Agents_sparc("Sparc2 Agent"):::agents
    end

    %% Supporting Tools & Libraries
    subgraph "Supporting Tools & Libraries"
        Tools_docs("Docs & Utilities"):::tools
    end

    %% External Services and Infrastructure
    subgraph "External Services and Infrastructure"
        Supabase("Supabase"):::external
        Deno("Deno Runtime"):::external
        ThirdParty("Third-Party APIs"):::external
    end

    %% Connections
    Client -->|"HTTP_request"| A_alpha
    A_inbox -->|"handles_task"| MCP
    M_manager -->|"manages_agents"| MCP
    I_mcp -->|"integrates_with"| MCP
    MCP -->|"orchestrates"| Agents_general
    MCP -->|"orchestrates"| Agents_scripts
    MCP -->|"orchestrates"| Agents_openai
    MCP -->|"orchestrates"| Agents_gemini
    MCP -->|"orchestrates"| Agents_sparc
    A_websocket -->|"real-time_comm"| Supabase
    A_stream -->|"streaming_data"| Supabase
    C_resend -->|"email_service"| ThirdParty
    C_contact -->|"notification"| ThirdParty
    I_github -->|"GitHub_calls"| ThirdParty
    A_beta -->|"runs_on"| Deno
    MCP -->|"runs_on"| Deno
    M_deploy -->|"deployment_updates"| Supabase
    Tools_docs -->|"supports"| Agents_general

    %% Class definitions for styling
    classDef front_clients fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef edge_functions fill:#C2F0C2,stroke:#333,stroke-width:2px;
    classDef mcp fill:#FFE699,stroke:#333,stroke-width:2px;
    classDef agents fill:#FFCCCB,stroke:#333,stroke-width:2px;
    classDef tools fill:#D6EAF8,stroke:#333,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#333,stroke-width:2px;

    %% Click Events for Edge Functions - Agent Functions
    click A_alpha "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agent_alpha/index.ts"
    click A_beta "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agent_beta/index.ts"
    click A_stream "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agent_stream/index.ts"
    click A_websocket "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agent_websocket/index.ts"
    click A_inbox "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agentic_inbox_agent/index.ts"

    %% Click Events for Edge Functions - Management Functions
    click M_manager "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/agent-manager/index.ts"
    click M_deploy "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/edge_deployment/index.ts"

    %% Click Events for Edge Functions - Communication Functions
    click C_resend "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/resend/index.ts"
    click C_contact "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/send-contact-notification/index.ts"

    %% Click Events for Edge Functions - Integration Functions
    click I_github "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/github-api/index.ts"
    click I_mcp "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/mcp-server/index.ts"

    %% Click Events for Edge Functions - Utility Functions
    click U_stripe "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/stripe_check-subscription-status/index.ts"
    click U_feedback "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/feedback/index.ts"
    click U_test "https://github.com/agenticsorg/edge-agents/blob/main/supabase/functions/test-function/index.ts"

    %% Click Events for MCP Server and Agent Orchestration
    click MCP "https://github.com/agenticsorg/edge-agents/blob/main/scripts/agentic-mcp/src/mcp/server.ts"
    click MCP_tools "https://github.com/agenticsorg/edge-agents/tree/main/scripts/agentic-mcp/src/mcp/tools/"

    %% Click Events for Agent Implementations
    click Agents_general "https://github.com/agenticsorg/edge-agents/tree/main/agents/"
    click Agents_scripts "https://github.com/agenticsorg/edge-agents/tree/main/scripts/agents/"
    click Agents_openai "https://github.com/agenticsorg/edge-agents/blob/main/scripts/agents/openai-agent/agent.ts"
    click Agents_gemini "https://github.com/agenticsorg/edge-agents/tree/main/scripts/gemini-rotator/"
    click Agents_sparc "https://github.com/agenticsorg/edge-agents/tree/main/scripts/sparc2/src/agent"

    %% Click Event for Supporting Tools & Libraries
    click Tools_docs "https://github.com/agenticsorg/edge-agents/tree/main/docs/"
```
