# eidolon-ai/eidolon architecture

> Architecture diagram of the GitHub repository eidolon-ai/eidolon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eidolon-ai/eidolon
- Repository: https://github.com/eidolon-ai/eidolon

## Overview

##### Main Components and Architecture

a) Client Layer:
- Python client (`eidolon-ai-client`)
- Web UI interface (`webui` directory)
- REST API endpoints

b) Core Service Layer:
- Agent Service components
- Browser Service
- Usage Service
- Kubernetes Operator

c) SDK Layer:
- Agent Framework
- Processing Units
- Memory Systems
- Security Components

##### Key Relationships to Highlight

- Client-to-Service communication via HTTP/REST
- Inter-agent communication pathways
- Integration with external services (LLMs, databases)
- Kubernetes deployment flow

##### Component Details

a) Agent Framework:
**┌─ Agent Framework ─────────────┐**
- ┌─────────┐    ┌──────────┐  │
- APU    │←→  │  Logic   │  │
- Units   │  │
- ┘    └──────────┘  │
- ┌─────────┐    ┌──────────┐  │
- Memory  │←→  │ Security │  │
- Systems │    │ Manager  │  │
- ┘    └──────────┘  │
- ┘

b) Service Architecture:
**┌─ Services ──────────────────┐**
- ┌─────────┐   ┌──────────┐ │
- Agent   │←→ │ Browser  │ │
- Service │   │ Service  │ │
- ┘   └──────────┘ │
- ┌─────────┐   ┌──────────┐ │
- Usage   │←→ │   K8s    │ │
- Service │   │ Operator │ │
- ┘   └──────────┘ │
- ┘

##### Elements

- Component labels
- API endpoints
- External service connections
- Security boundaries
- Deployment boundaries

##### Specific Implementation Details

Integration with:
- LLM providers (OpenAI, Anthropic, etc.)
- Storage systems (MongoDB, S3)
- Authentication systems
- Kubernetes infrastructure

##### External Integrations

This will provide a clear understanding of how Eidolon's components work together while highlighting its modular and service-oriented nature.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        PythonClient["Python Client"]:::client
        WebUI["Web UI Interface"]:::client
        REST["REST API Endpoints"]:::api
    end

    subgraph Services
        AgentService["Agent Service"]:::service
        BrowserService["Browser Service"]:::service
        UsageService["Usage Service"]:::service
        K8sOperator["Kubernetes Operator"]:::service
    end

    subgraph "Agent Framework"
        AgentOS["Agent OS"]:::core
        APU["Processing Units"]:::core
        LogicUnits["Logic Units"]:::core
        MemorySystems["Memory Systems"]:::core
        SecurityManager["Security Components"]:::security
        DocManager["Document Management"]:::core
        SystemCore["System Core"]:::core
    end

    subgraph "External Integrations"
        LLM["LLM Integration"]:::external
        Storage["Storage Systems"]:::external
        Auth["Authentication"]:::external
    end

    %% Client Layer Connections
    PythonClient --> REST
    WebUI --> REST
    REST --> AgentService

    %% Service Layer Connections
    AgentService --> BrowserService
    AgentService --> UsageService
    AgentService --> K8sOperator
    
    %% Agent Framework Internal Connections
    AgentOS --> APU
    AgentOS --> LogicUnits
    AgentOS --> MemorySystems
    AgentOS --> SecurityManager
    AgentOS --> DocManager
    SystemCore --> AgentOS

    %% Service to Framework Connections
    AgentService --> AgentOS

    %% External Integration Connections
    APU --> LLM
    MemorySystems --> Storage
    SecurityManager --> Auth

    %% Click Events
    click PythonClient "https://github.com/eidolon-ai/eidolon/tree/main/client/python/eidolon_ai_client/"
    click WebUI "https://github.com/eidolon-ai/eidolon/tree/main/webui/apps/eidolon-ui2/"
    click BrowserService "https://github.com/eidolon-ai/eidolon/tree/main/browser-service/eidolon_browser_service/"
    click UsageService "https://github.com/eidolon-ai/eidolon/tree/main/usage-service/usage-server/usage_server/"
    click K8sOperator "https://github.com/eidolon-ai/eidolon/tree/main/k8s-operator/"
    click APU "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/apu/"
    click LogicUnits "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/builtins/logic_units/"
    click MemorySystems "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/memory/"
    click SecurityManager "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/security/"
    click LLM "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/apu/llm/"
    click DocManager "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/agent/doc_manager/"
    click AgentOS "https://github.com/eidolon-ai/eidolon/blob/main/sdk/eidolon_ai_sdk/agent_os.py"
    click SystemCore "https://github.com/eidolon-ai/eidolon/tree/main/sdk/eidolon_ai_sdk/system/"

    %% Styling
    classDef client fill:#9966FF,stroke:#333,stroke-width:2px
    classDef service fill:#3399FF,stroke:#333,stroke-width:2px
    classDef core fill:#66CC99,stroke:#333,stroke-width:2px
    classDef security fill:#FF9933,stroke:#333,stroke-width:2px
    classDef external fill:#99CC00,stroke:#333,stroke-width:2px
    classDef api fill:#FF6666,stroke:#333,stroke-width:2px
```
