Files
ruflo/docs/agentic-flow-architecture-diagrams.md
T
rUv 16a2cd1c41 feat: Enhanced settings with self-improving workflows, performance optimizations, and agentic-flow EPIC
- Added comprehensive hook system with GitHub checkpoints
- Implemented neural optimization and memory persistence
- Created performance monitoring and optimization scripts
- Designed multi-LLM provider architecture for agentic-flow
- Created EPIC issue #421 for agentic-flow implementation
- Added 10-20x performance improvements through caching and parallelization
2025-07-20 20:45:53 +00:00

11 KiB

Agentic-Flow Architecture Diagrams

System Overview

graph TB
    subgraph "User Interface Layer"
        CLI[CLI Commands]
        API[REST API]
        SDK[TypeScript SDK]
        WEB[Web Dashboard]
    end
    
    subgraph "Agentic-Flow Core"
        subgraph "Agent Layer"
            AA[Autonomous Agents]
            BH[Behavior Engine]
            GE[Goal Engine]
            DE[Decision Engine]
        end
        
        subgraph "Intelligence Layer"
            LE[Learning Engine]
            RE[Reasoning Engine]
            ME[Memory System]
            KG[Knowledge Graph]
        end
        
        subgraph "Coordination Layer"
            TF[Team Formation]
            CM[Communication Manager]
            CS[Consensus System]
            RP[Reputation Protocol]
        end
    end
    
    subgraph "Integration Layer"
        CFB[Claude Flow Bridge]
        MCA[MCP Adapter]
        HMA[Hive Mind Adapter]
        EXT[External APIs]
    end
    
    subgraph "Infrastructure"
        CF[Claude Flow]
        MCP[MCP Server]
        HM[Hive Mind]
        DB[(Databases)]
    end
    
    CLI --> AA
    API --> AA
    SDK --> AA
    WEB --> AA
    
    AA --> BH
    AA --> GE
    AA --> DE
    
    BH --> LE
    GE --> RE
    DE --> RE
    
    LE --> ME
    RE --> KG
    ME --> KG
    
    AA --> TF
    TF --> CM
    CM --> CS
    CS --> RP
    
    AA --> CFB
    CFB --> CF
    
    AA --> MCA
    MCA --> MCP
    
    TF --> HMA
    HMA --> HM
    
    ME --> DB
    KG --> DB

Agent Architecture

graph LR
    subgraph "Autonomous Agent"
        subgraph "Perception"
            ENV[Environment]
            SEN[Sensors]
            PER[Perception Module]
        end
        
        subgraph "Cognition"
            BEL[Beliefs]
            GOL[Goals]
            PLN[Plans]
            MEM[Memory]
        end
        
        subgraph "Action"
            DEC[Decision Making]
            EXE[Execution]
            MON[Monitoring]
        end
        
        subgraph "Learning"
            EXP[Experience Buffer]
            LEA[Learning Module]
            ADP[Adaptation]
        end
    end
    
    ENV --> SEN
    SEN --> PER
    PER --> BEL
    
    BEL --> DEC
    GOL --> DEC
    PLN --> DEC
    MEM --> DEC
    
    DEC --> EXE
    EXE --> MON
    MON --> ENV
    
    MON --> EXP
    EXP --> LEA
    LEA --> ADP
    ADP --> BEL
    ADP --> PLN

Goal Decomposition Flow

graph TD
    G[High-Level Goal] --> GP[Goal Parser]
    GP --> GV[Goal Validator]
    GV --> GD[Goal Decomposer]
    
    GD --> S1[Sub-goal 1]
    GD --> S2[Sub-goal 2]
    GD --> S3[Sub-goal 3]
    
    S1 --> T1[Task 1.1]
    S1 --> T2[Task 1.2]
    
    S2 --> T3[Task 2.1]
    S2 --> T4[Task 2.2]
    S2 --> T5[Task 2.3]
    
    S3 --> T6[Task 3.1]
    
    T1 --> A1[Action 1.1.1]
    T1 --> A2[Action 1.1.2]
    
    style G fill:#f9f,stroke:#333,stroke-width:4px
    style S1 fill:#bbf,stroke:#333,stroke-width:2px
    style S2 fill:#bbf,stroke:#333,stroke-width:2px
    style S3 fill:#bbf,stroke:#333,stroke-width:2px

Team Formation Process

sequenceDiagram
    participant I as Initiator Agent
    participant B as Broadcast System
    participant A1 as Agent 1
    participant A2 as Agent 2
    participant A3 as Agent 3
    participant T as Team Manager
    
    I->>B: Broadcast Goal & Requirements
    B->>A1: Goal Notification
    B->>A2: Goal Notification
    B->>A3: Goal Notification
    
    A1->>I: Capability Match (80%)
    A2->>I: Capability Match (95%)
    A3->>I: Capability Match (60%)
    
    I->>T: Form Team Request
    T->>A2: Leader Assignment
    T->>A1: Member Assignment
    
    A2->>A1: Task Delegation
    A1->>A2: Accept Task
    
    Note over A2,A1: Collaborative Execution
    
    A1->>I: Progress Update
    A2->>I: Final Result

Learning and Knowledge Sharing

graph TB
    subgraph "Agent A"
        EA[Experience A]
        LA[Local Learning]
        KA[Knowledge A]
    end
    
    subgraph "Agent B"
        EB[Experience B]
        LB[Local Learning]
        KB[Knowledge B]
    end
    
    subgraph "Collective Memory"
        SK[Shared Knowledge]
        EP[Experience Pool]
        ML[Meta-Learning]
    end
    
    EA --> LA
    LA --> KA
    
    EB --> LB
    LB --> KB
    
    KA --> SK
    KB --> SK
    
    EA --> EP
    EB --> EP
    
    EP --> ML
    ML --> SK
    
    SK --> KA
    SK --> KB
    
    style SK fill:#f96,stroke:#333,stroke-width:2px
    style ML fill:#9f6,stroke:#333,stroke-width:2px

Communication Protocol Stack

graph BT
    subgraph "Physical Layer"
        NET[Network Transport]
    end
    
    subgraph "Transport Layer"
        TCP[TCP/WebSocket]
        UDP[UDP Multicast]
    end
    
    subgraph "Message Layer"
        ENC[Encryption]
        SER[Serialization]
        COM[Compression]
    end
    
    subgraph "Protocol Layer"
        REQ[Request/Response]
        PUB[Publish/Subscribe]
        BRO[Broadcast]
    end
    
    subgraph "Semantic Layer"
        GOA[Goal Proposals]
        CAP[Capability Ads]
        KNO[Knowledge Exchange]
        NEG[Negotiation]
    end
    
    NET --> TCP
    NET --> UDP
    
    TCP --> ENC
    UDP --> ENC
    
    ENC --> SER
    SER --> COM
    
    COM --> REQ
    COM --> PUB
    COM --> BRO
    
    REQ --> GOA
    PUB --> CAP
    BRO --> KNO
    REQ --> NEG

Decision Making Process

graph TD
    subgraph "Input"
        CTX[Context]
        BEL[Beliefs]
        GOA[Goals]
        CON[Constraints]
    end
    
    subgraph "Reasoning Strategies"
        LOG[Logical Reasoning]
        PRO[Probabilistic]
        HEU[Heuristic]
        CAS[Case-Based]
    end
    
    subgraph "Evaluation"
        EVA[Multi-Criteria Evaluation]
        RIS[Risk Assessment]
        UTI[Utility Calculation]
    end
    
    subgraph "Selection"
        RAN[Ranking]
        THR[Threshold Check]
        SEL[Final Selection]
    end
    
    CTX --> LOG
    BEL --> LOG
    GOA --> LOG
    CON --> LOG
    
    CTX --> PRO
    CTX --> HEU
    CTX --> CAS
    
    LOG --> EVA
    PRO --> EVA
    HEU --> EVA
    CAS --> EVA
    
    EVA --> RIS
    RIS --> UTI
    
    UTI --> RAN
    RAN --> THR
    THR --> SEL
    
    style SEL fill:#9f9,stroke:#333,stroke-width:2px

Integration Architecture

graph LR
    subgraph "Agentic-Flow"
        AA[Autonomous Agents]
        AM[Agent Manager]
        TM[Task Manager]
    end
    
    subgraph "Claude Flow Integration"
        CFB[Bridge]
        CFO[Orchestrator]
        CFT[Terminal Manager]
        CFM[Memory Manager]
    end
    
    subgraph "MCP Integration"
        MCA[MCP Adapter]
        MCS[MCP Server]
        MCT[MCP Tools]
    end
    
    subgraph "Hive Mind Integration"
        HMA[HM Adapter]
        HMS[Swarm Manager]
        HMQ[Queen System]
    end
    
    AA --> AM
    AM --> TM
    
    TM --> CFB
    CFB --> CFO
    CFO --> CFT
    CFO --> CFM
    
    AA --> MCA
    MCA --> MCS
    MCS --> MCT
    
    AM --> HMA
    HMA --> HMS
    HMS --> HMQ
    
    style AA fill:#f9f,stroke:#333,stroke-width:4px
    style CFB fill:#bbf,stroke:#333,stroke-width:2px
    style MCA fill:#bfb,stroke:#333,stroke-width:2px
    style HMA fill:#fbf,stroke:#333,stroke-width:2px

Deployment Architecture

graph TB
    subgraph "Load Balancer"
        LB[NGINX/HAProxy]
    end
    
    subgraph "API Gateway"
        AG1[Gateway 1]
        AG2[Gateway 2]
    end
    
    subgraph "Agent Clusters"
        subgraph "Cluster 1"
            A1[Agent 1.1]
            A2[Agent 1.2]
            A3[Agent 1.3]
        end
        
        subgraph "Cluster 2"
            A4[Agent 2.1]
            A5[Agent 2.2]
            A6[Agent 2.3]
        end
    end
    
    subgraph "Services"
        MS[Memory Service]
        LS[Learning Service]
        CS[Communication Service]
    end
    
    subgraph "Data Layer"
        PG[(PostgreSQL)]
        RD[(Redis)]
        ES[(Elasticsearch)]
    end
    
    LB --> AG1
    LB --> AG2
    
    AG1 --> A1
    AG1 --> A2
    AG1 --> A3
    
    AG2 --> A4
    AG2 --> A5
    AG2 --> A6
    
    A1 --> MS
    A2 --> MS
    A3 --> LS
    A4 --> LS
    A5 --> CS
    A6 --> CS
    
    MS --> PG
    MS --> RD
    LS --> ES
    CS --> RD

State Transitions

stateDiagram-v2
    [*] --> Idle
    
    Idle --> GoalReceived: Receive Goal
    GoalReceived --> Planning: Decompose Goal
    Planning --> TeamForming: Need Collaboration
    Planning --> Executing: Solo Execution
    
    TeamForming --> Negotiating: Find Partners
    Negotiating --> Executing: Agreement Reached
    Negotiating --> Planning: No Agreement
    
    Executing --> Monitoring: Start Execution
    Monitoring --> Adapting: Issue Detected
    Adapting --> Executing: Strategy Updated
    
    Monitoring --> Learning: Task Complete
    Learning --> Idle: Knowledge Updated
    
    Executing --> Failed: Unrecoverable Error
    Failed --> Idle: Reset
    
    state Executing {
        [*] --> TaskExecution
        TaskExecution --> ToolUsage
        ToolUsage --> ResultValidation
        ResultValidation --> TaskExecution: More Tasks
        ResultValidation --> [*]: Complete
    }

Performance Monitoring Dashboard

graph TB
    subgraph "Metrics Collection"
        AM[Agent Metrics]
        TM[Task Metrics]
        SM[System Metrics]
        NM[Network Metrics]
    end
    
    subgraph "Aggregation"
        TS[Time Series DB]
        AG[Aggregator]
        AL[Alerting]
    end
    
    subgraph "Visualization"
        RT[Real-time View]
        HI[Historical View]
        AN[Analytics]
        RE[Reports]
    end
    
    subgraph "Key Metrics"
        GP[Goals/Hour]
        TC[Task Completion Rate]
        AU[Agent Utilization]
        RT[Response Time]
        ER[Error Rate]
        LR[Learning Rate]
    end
    
    AM --> TS
    TM --> TS
    SM --> TS
    NM --> TS
    
    TS --> AG
    AG --> AL
    
    AG --> RT
    AG --> HI
    AG --> AN
    AN --> RE
    
    RT --> GP
    RT --> TC
    RT --> AU
    RT --> RT
    RT --> ER
    RT --> LR

These architectural diagrams provide a comprehensive visual representation of the Agentic-Flow system, illustrating:

  1. System Overview: High-level architecture showing all major components
  2. Agent Architecture: Internal structure of autonomous agents
  3. Goal Decomposition: How complex goals are broken down
  4. Team Formation: Dynamic collaboration process
  5. Learning & Knowledge: Collective intelligence mechanisms
  6. Communication Stack: Protocol layers for agent interaction
  7. Decision Making: Multi-strategy reasoning process
  8. Integration Points: How Agentic-Flow connects with Claude Flow ecosystem
  9. Deployment: Production architecture for scalability
  10. State Transitions: Agent lifecycle and behavior states
  11. Performance Monitoring: Observability and metrics collection

These diagrams serve as both documentation and implementation guides for the Agentic-Flow system.