# alejandro-ao/crewai-instagram-example architecture

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

- Interactive diagram: https://gitdiagram.com/alejandro-ao/crewai-instagram-example
- Repository: https://github.com/alejandro-ao/crewai-instagram-example

## Overview

##### Main Components

a) Core System Components:
- Agent Configuration System
- Task Management System
- Crew Orchestrator
- Tools Module
- Configuration Manager
- Main Application Runner

b) External Dependencies:
- OpenAI API
- crewAI Framework

**┌─────────────────────────────────────────────┐**
- Configuration Layer          │
- ┌─────────────┐          ┌─────────────┐  │
- agents.yaml │          │ tasks.yaml  │  │
- ┘          └─────────────┘  │
- ┘
- ↓
**┌─────────────────────────────────────────────┐**
- Orchestration Layer            │
- ┌─────────────┐          ┌─────────────┐  │
- crew.py   │◄────────►│   main.py   │  │
- ┘          └─────────────┘  │
- ┘
- ↓
**┌─────────────────────────────────────────────┐**
- Tools Layer                   │
- ┌─────────────────────────────────────┐    │
- tools/search.py           │    │
- ┘    │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- External Services                │
- ┌─────────────┐          ┌─────────────┐  │
- OpenAI API │          │   crewAI    │  │
- ┘          └─────────────┘  │
- ┘

##### Important Elements to Highlight

a) Configuration Management:
- How agents.yaml and tasks.yaml feed into the system
- Environment configuration (.env) integration

b) Core Processing:
- How crew.py orchestrates the agents
- Main.py as the entry point
- Demonstrate task execution flow

c) Tools Integration:
- How search.py integrates with the main system
- Extensibility points for additional tools

##### Specific Implementation Details

- The modular nature of the agent system
- Configuration-driven architecture
- Tool integration capabilities
- External service dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph ConfigLayer[Configuration Layer]
        direction TB
        AgentConfig[agents.yaml]
        TaskConfig[tasks.yaml]
        EnvConfig[.env]
        Dependencies[pyproject.toml]
    end

    subgraph OrchestrationLayer[Orchestration Layer]
        direction TB
        Crew[Crew Orchestrator]
        Main[Main Application]
    end

    subgraph ToolsLayer[Tools Layer]
        direction TB
        SearchTool[Search Tool]
    end

    subgraph ExternalLayer[External Services]
        direction TB
        OpenAI[OpenAI API]
        CrewAI[crewAI Framework]
    end

    subgraph OutputLayer[Output Layer]
        direction TB
        MarketResearch[market_research.md]
        VisualContent[visual-content.md]
        ContentStrategy[final-content-strategy.md]
    end

    %% Connections
    AgentConfig --> Crew
    TaskConfig --> Crew
    EnvConfig --> Main
    Dependencies --> Main
    Crew <--> Main
    Main --> SearchTool
    SearchTool <--> OpenAI
    Crew <--> CrewAI
    Main --> OutputLayer

    %% Click Events
    click AgentConfig "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/src/instagram/config/agents.yaml"
    click TaskConfig "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/src/instagram/config/tasks.yaml"
    click EnvConfig "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/.env.example"
    click Dependencies "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/pyproject.toml"
    click Crew "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/src/instagram/crew.py"
    click Main "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/src/instagram/main.py"
    click SearchTool "https://github.com/alejandro-ao/crewai-instagram-example/blob/master/src/instagram/tools/search.py"

    %% Styling
    classDef config fill:#a8d1f0
    classDef core fill:#90EE90
    classDef tool fill:#FFE5B4
    classDef external fill:#D3D3D3
    classDef output fill:#FFC0CB

    class AgentConfig,TaskConfig,EnvConfig,Dependencies config
    class Crew,Main core
    class SearchTool tool
    class OpenAI,CrewAI external
    class MarketResearch,VisualContent,ContentStrategy output

    %% Legend
    subgraph Legend
        direction TB
        Config[Configuration]:::config
        Core[Core Components]:::core
        Tool[Tools]:::tool
        External[External Services]:::external
        Output[Output Files]:::output
    end
```
