# unisami/autonomous-social-media-curator-open-source architecture

> Architecture diagram of the GitHub repository unisami/autonomous-social-media-curator-open-source, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/unisami/autonomous-social-media-curator-open-source
- Repository: https://github.com/unisami/autonomous-social-media-curator-open-source

## Overview

Key Components to Include:

##### Core System Components
- News Collector Agent
- Content Analyzer Agent
- Content Creator Agent
- Posting Manager Agent
- Safety Monitor Agent

##### Tools Layer (Rounded rectangles)
Tools by functionality:
- Content Tools:
- content_tools.py
- news_tools.py
- Social Media Tools:
- twitter_tools.py
- linkedin_tools.py
- social_tools.py
- Safety Tools:
- safety_tools.py
- Database Tools:
- database_tools.py
- Scheduling:
- posting_scheduler.py

##### Top Level
- External APIs and data sources
- Connections to the News Collector Agent

##### Middle Level
- Five AI agents in a workflow sequence
- Inter-agent communication paths

##### Bottom Level
- Database and storage components
- Analytics and monitoring systems

Data Flow Representation:

- News Collection → Content Analysis → Content Creation → Posting Management
- Safety Monitor connecting to all other agents

- Database interactions
- API calls
- Analytics data collection

##### Analytics & Monitoring: Yellow

Special Considerations:

##### Safety Layer
- Safety check points with red diamonds

##### Configuration Management
- To relevant services

##### Error Handling
- Retry loops where applicable

- Special symbols
- Component types

Level of Detail:

##### High-Level View
- Main components and their interactions
- Microservices architecture
- Primary data flows

- Agent interaction patterns
- Database schema
- Tool dependencies
- Safety system architecture

Additional Elements:

##### Rate Limiting
- To social media posting components

##### Authentication
- Auth flows with key symbols
- Session management points

##### Monitoring
- Monitoring touchpoints throughout the system
- Analytics data collection paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Services
    subgraph External["External Services"]
        direction TB
        AzureAI["Azure OpenAI API"]:::external
        TwitterAPI["Twitter API"]:::external
        LinkedInAPI["LinkedIn API"]:::external
        NewsAPI["NewsAPI"]:::external
        RSSFeeds["RSS Feeds"]:::external
    end

    %% AI Agents
    subgraph Agents["AI Agent Services"]
        direction TB
        NewsAgent[("News Collector<br/>Agent")]:::agent
        AnalyzerAgent[("Content Analyzer<br/>Agent")]:::agent
        CreatorAgent[("Content Creator<br/>Agent")]:::agent
        PostingAgent[("Posting Manager<br/>Agent")]:::agent
        SafetyAgent[("Safety Monitor<br/>Agent")]:::agent
    end

    %% Tools Layer
    subgraph Tools["Tools Layer"]
        direction TB
        ContentTools["Content Tools"]:::tool
        NewsTools["News Tools"]:::tool
        TwitterTools["Twitter Tools"]:::tool
        LinkedInTools["LinkedIn Tools"]:::tool
        SocialTools["Social Tools"]:::tool
        SafetyTools["Safety Tools"]:::tool
        DBTools["Database Tools"]:::tool
        Scheduler["Posting Scheduler"]:::tool
    end

    %% Database Layer
    subgraph DB["Database Layer"]
        direction TB
        Database[(Main Database)]:::database
        DBManager["Database Manager"]:::database
        Models["Database Models"]:::database
    end

    %% Analytics & Monitoring
    subgraph Analytics["Analytics & Monitoring"]
        direction TB
        PerfTracker["Performance Tracker"]:::analytics
        Logger["Logging System"]:::analytics
        ErrorTrack["Error Tracking"]:::analytics
    end

    %% Config Management
    subgraph Config["Configuration"]
        direction TB
        FeedConfig["Feed Config"]:::config
        LLMConfig["LLM Config"]:::config
    end

    %% Connections
    External --> NewsAgent
    NewsAgent --> AnalyzerAgent
    AnalyzerAgent --> CreatorAgent
    CreatorAgent --> PostingAgent
    SafetyAgent -.-> NewsAgent
    SafetyAgent -.-> AnalyzerAgent
    SafetyAgent -.-> CreatorAgent
    SafetyAgent -.-> PostingAgent

    Tools --> Agents
    Agents --> DB
    DB --> Analytics

    %% Click Events
    click NewsAgent "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/agents.py"
    click AnalyzerAgent "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/agents.py"
    click CreatorAgent "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/agents.py"
    click PostingAgent "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/agents.py"
    click SafetyAgent "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/agents.py"
    
    click ContentTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/content_tools.py"
    click NewsTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/news_tools.py"
    click TwitterTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/twitter_tools.py"
    click LinkedInTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/linkedin_tools.py"
    click SocialTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/social_tools.py"
    click SafetyTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/safety_tools.py"
    click DBTools "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/database_tools.py"
    click Scheduler "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/tools/posting_scheduler.py"
    
    click DBManager "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/database/db_manager.py"
    click Models "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/database/models.py"
    click Database "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/data/social_media_bot.db"
    
    click FeedConfig "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/config/feeds.py"
    click LLMConfig "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/config/llm_config.py"
    
    click PerfTracker "https://github.com/Unisami/Autonomous-Social-Media-Curator-Open-Source/blob/main/social_media_bot/analytics/performance_tracker.py"

    %% Styling
    classDef agent fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef external fill:#90EE90,stroke:#333
    classDef tool fill:#DDA0DD,stroke:#333
    classDef database fill:#FFA500,stroke:#333
    classDef analytics fill:#FFD700,stroke:#333
    classDef config fill:#D3D3D3,stroke:#333

    %% Legend
    subgraph Legend
        direction TB
        L1[("AI Agent")]:::agent
        L2["External Service"]:::external
        L3["Tool Component"]:::tool
        L4[(Database)]:::database
        L5["Analytics"]:::analytics
        L6["Configuration"]:::config
    end
```
