# ajayk47/stock-insight-agent architecture

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

- Interactive diagram: https://gitdiagram.com/ajayk47/stock-insight-agent
- Repository: https://github.com/ajayk47/stock-insight-agent

## Overview

##### Main Components

a) Agent Layer:
- Financial Assistant Agent
- Research Assistant Agent
- Financial Expert Agent

b) External Services:
- DuckDuckGo Search API
- Stock Data API (implied from functionality)
- Language Model API (indicated by OAI_CONFIG_LIST.json)

c) Data Flow Components:
- Input/Output Handler
- Data Processing Layer

##### Specific Connection Patterns

- User input/output flows

##### Detailed Component Breakdown

**User Input → Main Controller**
- ↓
**Agent Orchestration Layer**
- Financial Assistant Agent ←→ Stock Data API
- Research Assistant Agent ←→ DuckDuckGo API
- Financial Expert Agent

**All Agents ←→ Language Model API**

##### Additional Elements

Supporting components:
- Configuration Management (OAI_CONFIG_LIST.json)
- Error Handling Flow
- Data Validation Layer

##### Important Notes

- Clear separation between agent responsibilities
- Notes for key integration points

##### Technical Details to Highlight

- Python Runtime Environment
- AutoGen Framework Integration
- API Dependencies
- Asynchronous Communication Patterns

##### Recommendations for Implementation

- Maintain consistent spacing between components
- Version information
- Timing indicators for critical paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        UI[User Interface]
        MC[Main Controller]:::controller
    end

    subgraph "Agent Layer"
        FA[Financial Assistant Agent]:::agent
        RA[Research Assistant Agent]:::agent
        FE[Financial Expert Agent]:::agent
    end

    subgraph "External Services"
        LM[Language Model API]:::external
        SD[Stock Data API]:::external
        DD[DuckDuckGo Search API]:::external
        CF[Configuration]:::config
    end

    subgraph "Data Processing"
        DV[Data Validation]:::processing
        EH[Error Handler]:::processing
    end

    %% Connections
    UI --> MC
    MC --> FA
    MC --> RA
    MC --> FE

    %% Agent Interconnections
    FA <--> RA
    RA <--> FE
    FA <--> FE

    %% External Service Connections
    FA <--> SD
    RA <--> DD
    FA <--> LM
    RA <--> LM
    FE <--> LM
    CF -.-> MC

    %% Data Processing Connections
    MC <--> DV
    MC <--> EH

    %% Styling
    classDef agent fill:#a4c2f4,stroke:#1a73e8
    classDef external fill:#b7e1cd,stroke:#0f9d58
    classDef processing fill:#f9cb9c,stroke:#e69138
    classDef controller fill:#c9daf8,stroke:#3d85c6
    classDef config fill:#d9d9d9,stroke:#666666

    %% Click Events
    click MC "https://github.com/AjayK47/Stock-Insight-Agent/blob/main/main.py"
    click CF "https://github.com/AjayK47/Stock-Insight-Agent/blob/main/OAI_CONFIG_LIST.json"

    %% Legend
    subgraph Legend
        L1[Agent]:::agent
        L2[External Service]:::external
        L3[Processing Component]:::processing
        L4[Controller]:::controller
        L5[Configuration]:::config
    end
```
