# yukeshwaran186-max/market-research-agent architecture

> Architecture diagram of the GitHub repository yukeshwaran186-max/market-research-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yukeshwaran186-max/market-research-agent
- Repository: https://github.com/yukeshwaran186-max/market-research-agent

## Overview

This is a CrewAI market-research application: a query enters through the CLI, then live runs coordinate market research and CSV financial analysis with report synthesis; mock runs provide illustrative content instead. The resulting content is compiled into Markdown and A4 PDF reports, with execution benchmarks saved separately. The README documents the hierarchical Gemini manager, Tavily research, and report capabilities. Some implementation details, including web search and benchmark tracking, were not excerpted, so their internal behavior is not inferred.

Main entry points: [`main.py`](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/main.py) (CLI Workflow), [`crew/crew.py`](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/crew.py) (Crew Orchestrator), [`config/settings.py`](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/config/settings.py) (Runtime Configuration), [`crew/tasks.py`](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/tasks.py) (Research Tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow"]
  node_cli["CLI Workflow<br/>[main.py]"]
  node_crew["Crew Orchestrator<br/>[crew.py]"]
  node_tasks["Research Tasks<br/>[tasks.py]"]
end

subgraph group_research["Research and Analysis"]
  node_agents["Specialist Agents<br/>[agents.py]"]
  node_researcher["Market Researcher<br/>[agents.py]"]
  node_analyst["Financial Analyst<br/>[agents.py]"]
  node_writer["Report Writer<br/>[agents.py]"]
  node_websearch["Web Search Tool<br/>[web_search.py]"]
  node_financial["Financial Metrics"]
  node_csv["Metrics CSV"]
end

subgraph group_reporting["Reporting"]
  node_markdown["Markdown Compiler"]
  node_pdf["PDF Compiler<br/>[pdf_generator.py]"]
  node_benchmark["Execution Benchmarks<br/>[benchmark.py]"]
end

subgraph group_runtime["Runtime Services"]
  node_settings["Runtime Configuration<br/>[settings.py]"]
  node_gemini(("Google Gemini"))
  node_tavily(("Tavily Search"))
end

node_user(("Query User"))

node_user -->|"submits query"| node_cli
node_cli -->|"creates and runs"| node_crew
node_crew -->|"creates agents"| node_agents
node_crew -->|"creates tasks"| node_tasks
node_tasks -->|"sets context"| node_writer
node_researcher -->|"uses tool"| node_websearch
node_analyst -->|"uses tool"| node_financial
node_financial -->|"reads metrics"| node_csv
node_cli -->|"compiles content"| node_markdown
node_cli -->|"compiles content"| node_pdf
node_cli -->|"records execution"| node_benchmark
node_cli -->|"validates environment"| node_settings
node_agents -->|"gets LLM"| node_settings
node_crew -->|"gets manager LLM"| node_settings
node_settings -->|"configures model"| node_gemini
node_websearch -.->|"searches web"| node_tavily

click node_cli "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/main.py"
click node_crew "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/crew.py"
click node_tasks "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/tasks.py"
click node_agents "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py"
click node_researcher "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py"
click node_analyst "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py"
click node_writer "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py"
click node_websearch "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/tools/web_search.py"
click node_financial "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/tools/financial_parser.py"
click node_csv "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/data/sample_financial_metrics.csv"
click node_markdown "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/report/markdown_generator.py"
click node_pdf "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/report/pdf_generator.py"
click node_benchmark "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/utils/benchmark.py"
click node_settings "https://github.com/yukeshwaran186-max/market-research-agent/blob/master/config/settings.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_crew,node_tasks,node_user toneBlue
class node_agents,node_researcher,node_analyst,node_writer,node_websearch,node_financial,node_csv toneAmber
class node_markdown,node_pdf,node_benchmark toneMint
class node_settings,node_gemini,node_tavily toneRose
```

## Components

### Workflow

- [CLI Workflow](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/main.py): `main.py`
- [Crew Orchestrator](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/crew.py): `crew/crew.py`
- [Research Tasks](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/tasks.py): `crew/tasks.py`

### Research and Analysis

- [Specialist Agents](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py): `crew/agents.py`
- [Market Researcher](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py): `crew/agents.py`
- [Financial Analyst](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py): `crew/agents.py`
- [Report Writer](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/crew/agents.py): `crew/agents.py`
- [Web Search Tool](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/tools/web_search.py): `tools/web_search.py`
- [Financial Metrics](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/tools/financial_parser.py): `tools/financial_parser.py`
- [Metrics CSV](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/data/sample_financial_metrics.csv): `data/sample_financial_metrics.csv`

### Reporting

- [Markdown Compiler](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/report/markdown_generator.py): `report/markdown_generator.py`
- [PDF Compiler](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/report/pdf_generator.py): `report/pdf_generator.py`
- [Execution Benchmarks](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/utils/benchmark.py): `utils/benchmark.py`

### Runtime Services

- [Runtime Configuration](https://github.com/yukeshwaran186-max/market-research-agent/blob/master/config/settings.py): `config/settings.py`
- **Google Gemini**
- **Tavily Search**

### Other components

- **Query User**

## Connections

- Query User → CLI Workflow: submits query (evidence: `README.md`)
- CLI Workflow → Crew Orchestrator: creates and runs (evidence: `main.py`)
- Crew Orchestrator → Specialist Agents: creates agents (evidence: `crew/crew.py`)
- Crew Orchestrator → Research Tasks: creates tasks (evidence: `crew/crew.py`)
- Research Tasks → Report Writer: sets context (evidence: `crew/tasks.py`)
- Market Researcher → Web Search Tool: uses tool (evidence: `crew/agents.py`)
- Financial Analyst → Financial Metrics: uses tool (evidence: `crew/agents.py`)
- Financial Metrics → Metrics CSV: reads metrics (evidence: `tools/financial_parser.py`)
- CLI Workflow → Markdown Compiler: compiles content (evidence: `main.py`)
- CLI Workflow → PDF Compiler: compiles content (evidence: `main.py`)
- CLI Workflow → Execution Benchmarks: records execution (evidence: `main.py`)
- CLI Workflow → Runtime Configuration: validates environment (evidence: `main.py`)
- Specialist Agents → Runtime Configuration: gets LLM (evidence: `crew/agents.py`)
- Crew Orchestrator → Runtime Configuration: gets manager LLM (evidence: `crew/crew.py`)
- Runtime Configuration → Google Gemini: configures model (evidence: `README.md`)
- Web Search Tool → Tavily Search: searches web (evidence: `README.md`)
