# shivamim/finance_agenticai architecture

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

- Interactive diagram: https://gitdiagram.com/shivamim/finance_agenticai
- Repository: https://github.com/shivamim/finance_agenticai

## Overview

##### Project type and purpose
- This is an open-source, single-script AI tool (“Financial Agentic AI”) that uses a multi-agent architecture to gather real-time stock market data (via YFinanceTools) and fresh web intel (via Google Search, DuckDuckGo), then fuses them into structured, source-backed reports.
- Its core goal is to let analysts or enthusiasts pose a query (e.g. “Summarize analyst recommendations for Nvidia”), have orchestrated agents fetch and analyze data, and produce a unified Markdown/table output.

##### File structure
- Top-level files only:
- README.md – full project description, features, usage
- requirements.txt – Python dependencies
- financial_agent.py – single entry point containing:
– Agent orchestration logic (phi.agent framework)
– Web Search Agent implementation
– Financial Insights Agent implementation
– Aggregation & formatting logic
- No frontend, no database, no microservices—pure Python script relying on external APIs.

##### Key architectural insights from the README
- **Agent-Based**: Built on `phi.agent` with specialized agents.
- **External APIs**: Google Search, DuckDuckGo, YFinanceTools, Groq model (via GROQ_API_KEY).
- **Multi-Agent Integration**: Agents work in parallel then results are merged.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Project Files"
        README["README.md"]:::doc
        Reqs["requirements.txt"]:::doc
    end

    Config["Env Vars / GROQ_API_KEY"]:::config

    UI["User Interface\n(CLI or function call)"]:::internal
    Orchestrator["Agent Manager\n(phi.agent + Groq Model)"]:::internal
    WebAgent["Web Search Agent"]:::internal
    FinAgent["Financial Insights Agent"]:::internal
    Aggregator["Result Aggregator & Formatter"]:::internal
    Renderer["Output Renderer\n(Markdown/Table)"]:::internal

    subgraph "External APIs"
        GoogleAPI["Google Search API"]:::external
        DuckAPI["DuckDuckGo API"]:::external
        YFinanceAPI["YFinance Web API"]:::external
    end

    UI -->|"Query"| Orchestrator
    Config -.-> Orchestrator
    Orchestrator -->|"dispatch"| WebAgent
    Orchestrator -->|"dispatch"| FinAgent

    WebAgent -->|"HTTP Request"| GoogleAPI
    WebAgent -->|"HTTP Request"| DuckAPI
    FinAgent -->|"HTTP Request"| YFinanceAPI

    WebAgent -->|"Data Response"| Aggregator
    FinAgent -->|"Data Response"| Aggregator

    Aggregator -->|"Formatted Data"| Renderer
    Renderer -->|"Output Report"| UI

    click README "https://github.com/shivamim/finance_agenticai/blob/main/README.md"
    click Reqs "https://github.com/shivamim/finance_agenticai/blob/main/requirements.txt"
    click Config "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click UI "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click Orchestrator "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click WebAgent "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click FinAgent "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click Aggregator "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"
    click Renderer "https://github.com/shivamim/finance_agenticai/blob/main/financial_agent.py"

    classDef internal fill:#D6EAF8,stroke:#21618C,color:#1B4F72
    classDef external fill:#D5F5E3,stroke:#27AE60,color:#145A32
    classDef config fill:#FCF3CF,stroke:#F1C40F,color:#7D6608
    classDef doc fill:#F2F3F4,stroke:#A6ACAF,color:#566573
```
