# camel-ai/oasis architecture

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

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

## Overview

##### Main Components and Architecture

The system should be represented with these key components:

a) Core Components:
- Social Agents Layer
- Social Platform Layer
- Inference Engine
- Clock System
- Database Layer

b) External Services:
- LLM Integration (OpenAI API/Open Source Models)
- Data Storage Systems

##### Detailed Component Breakdown

A. Social Agents Layer (/oasis/social_agent/):
- Agent Core (agent.py)
- Action Handler (agent_action.py)
- Environment Interface (agent_environment.py)
- Social Graph Manager (agent_graph.py)
- Agent Generator (agents_generator.py)

B. Social Platform Layer (/oasis/social_platform/):
- Platform components:
- Platform Core (platform.py)
- Communication Channels (channel.py)
- Recommendation System (recsys.py)
- Database Interface (database.py)
- Configuration Management (config/)

C. Inference Engine (/oasis/inference/):
- Inference components:
- Inference Manager (inference_manager.py)
- Inference Threading System (inference_thread.py)

D. Database Layer:
- Database schema components:
- User Management
- Content Management (posts, comments)
- Interaction Tracking (likes, follows)
- Product Management
- Recommendation Storage

##### Interaction Flows

a) Data Flow:
- Agent → Platform (actions/requests)
- Platform → Database (storage/retrieval)
- Platform → Recommendation System (content distribution)
- Inference Engine → Agents (decision making)

b) Control Flow:
- Clock System → Platform (timing/synchronization)
- Platform → Agents (event notifications)
- Inference Manager → LLM Services

##### Specific Design Elements

Use distinct visual elements:

##### Technical Details

Technical specifications:
- Supported LLM models
- Database schemas
- API endpoints
- Configuration parameters

##### The data collection and analysis capabilities

Keep the abstraction level high enough to show the overall architecture while including sufficient detail to understand the system's operation and scalability features.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core Components
    subgraph SocialAgents["Social Agents Layer"]
        AgentCore["Agent Core"]:::component
        ActionHandler["Action Handler"]:::component
        EnvInterface["Environment Interface"]:::component
        GraphManager["Social Graph Manager"]:::component
        AgentGen["Agent Generator"]:::component
    end

    subgraph Platform["Social Platform Layer"]
        PlatformCore["Platform Core"]:::component
        CommChannels["Communication Channels"]:::component
        RecSys["Recommendation System"]:::component
        DBInterface["Database Interface"]:::component
        Config["Configuration Management"]:::component
    end

    subgraph InferenceEngine["Inference Engine"]
        InfManager["Inference Manager"]:::component
        InfThread["Inference Threading System"]:::component
    end

    subgraph DB["Database Layer"]
        UserDB[("User Management")]:::database
        ContentDB[("Content Management")]:::database
        InteractionDB[("Interaction Tracking")]:::database
        ProductDB[("Product Management")]:::database
        RecDB[("Recommendation Storage")]:::database
    end

    Clock["Clock System"]:::component

    %% External Services
    LLM["LLM Services"]:::external

    %% Connections
    AgentCore --> PlatformCore
    ActionHandler --> PlatformCore
    PlatformCore --> DBInterface
    DBInterface --> DB
    RecSys --> PlatformCore
    Clock --> Platform
    Platform --> SocialAgents
    InfManager --> LLM
    InfManager --> SocialAgents
    
    %% Click Events
    click SocialAgents "https://github.com/camel-ai/oasis/tree/main//oasis/social_agent/"
    click AgentCore "https://github.com/camel-ai/oasis/blob/main//oasis/social_agent/agent.py"
    click ActionHandler "https://github.com/camel-ai/oasis/blob/main//oasis/social_agent/agent_action.py"
    click EnvInterface "https://github.com/camel-ai/oasis/blob/main//oasis/social_agent/agent_environment.py"
    click GraphManager "https://github.com/camel-ai/oasis/blob/main//oasis/social_agent/agent_graph.py"
    click AgentGen "https://github.com/camel-ai/oasis/blob/main//oasis/social_agent/agents_generator.py"
    
    click Platform "https://github.com/camel-ai/oasis/tree/main//oasis/social_platform/"
    click PlatformCore "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/platform.py"
    click CommChannels "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/channel.py"
    click RecSys "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/recsys.py"
    click DBInterface "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/database.py"
    click Config "https://github.com/camel-ai/oasis/tree/main//oasis/social_platform/config/"
    
    click InferenceEngine "https://github.com/camel-ai/oasis/tree/main//oasis/inference/"
    click InfManager "https://github.com/camel-ai/oasis/blob/main//oasis/inference/inference_manager.py"
    click InfThread "https://github.com/camel-ai/oasis/blob/main//oasis/inference/inference_thread.py"
    
    click Clock "https://github.com/camel-ai/oasis/blob/main//oasis/clock/clock.py"
    
    click UserDB "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/schema/user.sql"
    click ContentDB "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/schema/post.sql"
    click InteractionDB "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/schema/like.sql"
    click ProductDB "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/schema/product.sql"
    click RecDB "https://github.com/camel-ai/oasis/blob/main//oasis/social_platform/schema/rec.sql"

    %% Styles
    classDef component fill:#a8d1ff,stroke:#000
    classDef database fill:#ffcca8,stroke:#000
    classDef external fill:#c9e6ca,stroke:#000
    
    %% Legend
    subgraph Legend
        L1["Component"]:::component
        L2[("Database")]:::database
        L3["External Service"]:::external
    end
```
