# iflytek/astron-agent architecture

> Architecture diagram of the GitHub repository iflytek/astron-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iflytek/astron-agent
- Repository: https://github.com/iflytek/astron-agent

## Overview

##### Project Type & Purpose
- Astron Agent is a full-stack, enterprise-grade AI Agent Development Platform.
- It comprises a React/TypeScript SPA (console frontend), a Java Spring Boot multi-module backend (console hub), and a set of microservices written in Python and Go (“core” services).
- Supports end-to-end: model hosting, workflow orchestration, RPA, data storage, caching, messaging, and object storage.

##### File Structure
- Top-level “console” directory:
- frontend – TS/React app served via Nginx, built with Vite.
- backend – Maven multi-module:
– commons (shared annotations, DTOs, services)
– toolkit (utility libraries)
– hub (Spring Boot application exposing REST/SSE APIs)
- “core” directory: independent microservices, each self-contained:
- core/agent (Python FastAPI)
- core/knowledge, core/memory, core/workflow (Python)
- core/plugin/aitools, link, rpa (Python)
- core/tenant (Go)
- core/common (shared Python libs)
- “docker/astronAgent” holds a Docker Compose stack orchestrating console + all core services plus MySQL, Redis, Kafka, MinIO.

##### README Insights
- Backend languages: Java 21/Spring Boot, Python 3.11, Go
- Frontend: React 18, TypeScript 5
- Datastores: MySQL 8, Redis
- Messaging: Apache Kafka
- Storage: MinIO
- Deployment: Docker Compose, one-click startup

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        Browser["Browser"]:::external
        SPA["SPA (React/TS)"]:::frontend
        Nginx["Nginx"]:::frontend
    end
    Browser -->|uses| SPA
    SPA -->|serves assets| Nginx

    %% Backend API
    subgraph "Console Backend (Java Spring Boot)"
        Commons["commons"]:::backend
        Toolkit["toolkit"]:::backend
        Hub["hub (API/SSE)"]:::backend
    end
    Nginx -->|HTTP/REST, SSE| Hub
    Commons --> Hub
    Toolkit --> Hub

    %% Core Microservices
    subgraph "Core Microservices"
        Agent["Agent Service"]:::micro
        Knowledge["Knowledge Service"]:::micro
        Memory["Memory-DB Service"]:::micro
        Workflow["Workflow Service"]:::micro
        AItools["Plugin: AI Tools"]:::micro
        Link["Plugin: Link"]:::micro
        RPA["Plugin: RPA"]:::micro
        Tenant["Tenant Service"]:::micro
    end
    Hub -->|HTTP/REST| Agent
    Hub -->|HTTP/REST| Knowledge
    Hub -->|HTTP/REST| Memory
    Hub -->|HTTP/REST| Workflow
    Hub -->|HTTP/REST| AItools
    Hub -->|HTTP/REST| Link
    Hub -->|HTTP/REST| RPA
    Hub -->|HTTP/REST| Tenant

    %% Data Stores & Messaging
    subgraph "Data Stores & Messaging"
        MySQL["MySQL"]:::db
        Redis["Redis"]:::db
        Kafka["Kafka"]:::db
        MinIO["MinIO"]:::db
    end
    Agent -->|JDBC| MySQL
    Knowledge -->|JDBC| MySQL
    Memory -->|JDBC| MySQL
    Workflow -->|JDBC| MySQL
    Agent -->|Redis GET/SET| Redis
    Knowledge -->|Redis GET/SET| Redis
    Memory -->|Redis GET/SET| Redis
    Workflow -->|Redis GET/SET| Redis
    Agent -->|Kafka Topic: agent-events| Kafka
    Knowledge -->|Kafka Topic: knowledge-events| Kafka
    Workflow -->|Kafka Topic: workflow-events| Kafka
    Agent -->|MinIO PUT/GET| MinIO
    Workflow -->|MinIO PUT/GET| MinIO

    %% External Services
    subgraph "External Services"
        LLM["LLM Providers"]:::external
        iFLYTEK["iFLYTEK API"]:::external
        RPAExec["RPA Executors"]:::external
    end
    Agent -->|HTTP| LLM
    AItools -->|HTTP| iFLYTEK
    Workflow -->|HTTP| RPAExec

    %% Orchestration
    DockerCompose["Docker Compose Orchestration"]:::orchestration
    DockerCompose --> Nginx
    DockerCompose --> Hub
    DockerCompose --> Agent
    DockerCompose --> Knowledge
    DockerCompose --> Memory
    DockerCompose --> Workflow
    DockerCompose --> AItools
    DockerCompose --> Link
    DockerCompose --> RPA
    DockerCompose --> Tenant
    DockerCompose --> MySQL
    DockerCompose --> Redis
    DockerCompose --> Kafka
    DockerCompose --> MinIO

    %% Click Events
    click SPA "https://github.com/iflytek/astron-agent/tree/main/console/frontend"
    click Hub "https://github.com/iflytek/astron-agent/tree/main/console/backend/hub"
    click Commons "https://github.com/iflytek/astron-agent/tree/main/console/backend/commons"
    click Toolkit "https://github.com/iflytek/astron-agent/tree/main/console/backend/toolkit"
    click Agent "https://github.com/iflytek/astron-agent/tree/main/core/agent"
    click Knowledge "https://github.com/iflytek/astron-agent/tree/main/core/knowledge"
    click Memory "https://github.com/iflytek/astron-agent/tree/main/core/memory/database"
    click Workflow "https://github.com/iflytek/astron-agent/tree/main/core/workflow"
    click AItools "https://github.com/iflytek/astron-agent/tree/main/core/plugin/aitools"
    click Link "https://github.com/iflytek/astron-agent/tree/main/core/plugin/link"
    click RPA "https://github.com/iflytek/astron-agent/tree/main/core/plugin/rpa"
    click Tenant "https://github.com/iflytek/astron-agent/tree/main/core/tenant"
    click DockerCompose "https://github.com/iflytek/astron-agent/blob/main/docker/astronAgent/docker-compose.yaml"
    click MySQL "https://github.com/iflytek/astron-agent/blob/main/docker/astronAgent/mysql/schema.sql"
    click Redis "https://github.com/iflytek/astron-agent/tree/main/console/backend/docker/redis"
    click MinIO "https://github.com/iflytek/astron-agent/tree/main/console/backend/docker/minio"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef backend fill:#E2F0D9,stroke:#2E7D32,color:#2E7D32
    classDef micro fill:#FFE8CC,stroke:#F57C00,color:#F57C00
    classDef db fill:#F2F2F2,stroke:#607D8B,color:#455A64
    classDef orchestration fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C
    classDef external stroke-dasharray: 5 5,stroke:#616161,color:#424242
```
