# ragunath77/final_yr_project architecture

> Architecture diagram of the GitHub repository ragunath77/final_yr_project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ragunath77/final_yr_project
- Repository: https://github.com/ragunath77/final_yr_project

## Overview

OWL is a multi-agent framework for automating real-world tasks. Its central runtime turns a user task into a collaborative agent session, invokes tools, and returns a result; the repository also includes a web interface, benchmark/document utilities, and a substantial A-share investment example. The investment example’s main orchestrator and agent dependencies are visible in the source index, but some internal tool and runtime details are not sampled, so uncertain links are omitted.

Main entry points: [`community_usecase/a_share_investment_agent_camel/src/main.py`](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/main.py) (Investment Workflow), [`community_usecase/a_share_investment_agent_camel/src/agents/base_agent.py`](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/base_agent.py) (Agent Base), [`owl/utils/enhanced_role_playing.py`](https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/enhanced_role_playing.py) (Role Playing), [`community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py`](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py) (Market Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent Runtime"]
  node_roleplay["Role Playing"]
  node_camel{{"CAMEL Framework"}}
  node_toolkits{{"Search, Browser &amp; MCP Tools"}}
end

subgraph group_interfaces["User Interfaces"]
  node_web["Web UI<br/>[webapp.py]"]
end

subgraph group_utilities["Task Utilities"]
  node_common["Common Helpers<br/>[common.py]"]
  node_documents["Document Toolkit"]
  node_gaia["GAIA Benchmark<br/>[gaia.py]"]
end

subgraph group_investment["Investment Example"]
  node_invest_main["Investment Workflow<br/>[main.py]"]
  node_market["Market Data"]
  node_technical["Technical Analysis"]
  node_fundamentals["Fundamentals Analysis"]
  node_sentiment["Sentiment Analysis"]
  node_valuation["Valuation Analysis"]
  node_bull["Bull Research<br/>[researcher_bull.py]"]
  node_bear["Bear Research<br/>[researcher_bear.py]"]
  node_debate["Research Debate<br/>[debate_room.py]"]
  node_risk["Risk Assessment<br/>[risk_manager.py]"]
  node_portfolio["Portfolio Decision"]
  node_base_agent["Agent Base<br/>[base_agent.py]"]
  node_roles["Agent Roles<br/>[roles.py]"]
  node_models["Investment Models<br/>[models.py]"]
  node_data_helper["Market Data Helpers<br/>[data_helper.py]"]
  node_sec["SEC Analysis Example<br/>[sec_agent.py]"]
  node_sec_tools["SEC Tools<br/>[sec_tools.py]"]
  node_sec_prompts["SEC Prompts<br/>[prompts.py]"]
end

node_user(("User"))
node_investment_user(("Investment User"))

node_user -->|"submits task"| node_web
node_web -->|"runs agent session"| node_roleplay
node_roleplay -->|"uses framework"| node_camel
node_roleplay -.->|"dispatches tools"| node_toolkits
node_gaia -->|"runs benchmark tasks"| node_roleplay
node_investment_user -.->|"requests analysis"| node_invest_main
node_invest_main -->|"calls"| node_market
node_invest_main -->|"calls"| node_technical
node_invest_main -->|"calls"| node_fundamentals
node_invest_main -->|"calls"| node_sentiment
node_invest_main -->|"calls"| node_valuation
node_invest_main -->|"calls"| node_bull
node_invest_main -->|"calls"| node_bear
node_invest_main -->|"calls"| node_debate
node_invest_main -->|"calls"| node_risk
node_invest_main -->|"calls"| node_portfolio
node_invest_main -->|"uses data models"| node_models
node_market -->|"uses helpers"| node_data_helper
node_market -->|"inherits from"| node_base_agent
node_technical -->|"inherits from"| node_base_agent
node_fundamentals -->|"inherits from"| node_base_agent
node_sentiment -->|"inherits from"| node_base_agent
node_valuation -->|"inherits from"| node_base_agent
node_bull -->|"inherits from"| node_base_agent
node_bear -->|"inherits from"| node_base_agent
node_debate -->|"inherits from"| node_base_agent
node_risk -->|"inherits from"| node_base_agent
node_portfolio -->|"inherits from"| node_base_agent
node_technical -->|"creates role agent"| node_roles
node_sec -->|"uses tools"| node_sec_tools
node_sec -->|"uses prompts"| node_sec_prompts

click node_web "https://github.com/ragunath77/final_yr_project/blob/main/owl/webapp.py"
click node_roleplay "https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/enhanced_role_playing.py"
click node_common "https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/common.py"
click node_documents "https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/document_toolkit.py"
click node_gaia "https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/gaia.py"
click node_invest_main "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/main.py"
click node_market "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py"
click node_technical "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/technical_analyst.py"
click node_fundamentals "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/fundamentals_analyst.py"
click node_sentiment "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/sentiment_analyst.py"
click node_valuation "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/valuation_analyst.py"
click node_bull "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/researcher_bull.py"
click node_bear "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/researcher_bear.py"
click node_debate "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/debate_room.py"
click node_risk "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/risk_manager.py"
click node_portfolio "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/portfolio_manager.py"
click node_base_agent "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/base_agent.py"
click node_roles "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/roles.py"
click node_models "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/models.py"
click node_data_helper "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/tools/data_helper.py"
click node_sec "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/agent/sec_agent.py"
click node_sec_tools "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/tools/sec_tools.py"
click node_sec_prompts "https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/prompts.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_roleplay,node_camel,node_toolkits,node_user,node_investment_user toneBlue
class node_web toneAmber
class node_common,node_documents,node_gaia toneMint
class node_invest_main,node_market,node_technical,node_fundamentals,node_sentiment,node_valuation,node_bull,node_bear,node_debate,node_risk,node_portfolio,node_base_agent,node_roles,node_models,node_data_helper,node_sec,node_sec_tools,node_sec_prompts toneRose
```

## Components

### Agent Runtime

- [Role Playing](https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/enhanced_role_playing.py): `owl/utils/enhanced_role_playing.py`
- **CAMEL Framework**
- **Search, Browser & MCP Tools**

### User Interfaces

- [Web UI](https://github.com/ragunath77/final_yr_project/blob/main/owl/webapp.py): `owl/webapp.py`

### Task Utilities

- [Common Helpers](https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/common.py): `owl/utils/common.py`
- [Document Toolkit](https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/document_toolkit.py): `owl/utils/document_toolkit.py`
- [GAIA Benchmark](https://github.com/ragunath77/final_yr_project/blob/main/owl/utils/gaia.py): `owl/utils/gaia.py`

### Investment Example

- [Investment Workflow](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/main.py): `community_usecase/a_share_investment_agent_camel/src/main.py`
- [Market Data](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py): `community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py`
- [Technical Analysis](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/technical_analyst.py): `community_usecase/a_share_investment_agent_camel/src/agents/technical_analyst.py`
- [Fundamentals Analysis](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/fundamentals_analyst.py): `community_usecase/a_share_investment_agent_camel/src/agents/fundamentals_analyst.py`
- [Sentiment Analysis](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/sentiment_analyst.py): `community_usecase/a_share_investment_agent_camel/src/agents/sentiment_analyst.py`
- [Valuation Analysis](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/valuation_analyst.py): `community_usecase/a_share_investment_agent_camel/src/agents/valuation_analyst.py`
- [Bull Research](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/researcher_bull.py): `community_usecase/a_share_investment_agent_camel/src/agents/researcher_bull.py`
- [Bear Research](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/researcher_bear.py): `community_usecase/a_share_investment_agent_camel/src/agents/researcher_bear.py`
- [Research Debate](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/debate_room.py): `community_usecase/a_share_investment_agent_camel/src/agents/debate_room.py`
- [Risk Assessment](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/risk_manager.py): `community_usecase/a_share_investment_agent_camel/src/agents/risk_manager.py`
- [Portfolio Decision](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/portfolio_manager.py): `community_usecase/a_share_investment_agent_camel/src/agents/portfolio_manager.py`
- [Agent Base](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/agents/base_agent.py): `community_usecase/a_share_investment_agent_camel/src/agents/base_agent.py`
- [Agent Roles](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/roles.py): `community_usecase/a_share_investment_agent_camel/src/roles.py`
- [Investment Models](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/models.py): `community_usecase/a_share_investment_agent_camel/src/models.py`
- [Market Data Helpers](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/a_share_investment_agent_camel/src/tools/data_helper.py): `community_usecase/a_share_investment_agent_camel/src/tools/data_helper.py`
- [SEC Analysis Example](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/agent/sec_agent.py): `community_usecase/stock-analysis/agent/sec_agent.py`
- [SEC Tools](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/tools/sec_tools.py): `community_usecase/stock-analysis/tools/sec_tools.py`
- [SEC Prompts](https://github.com/ragunath77/final_yr_project/blob/main/community_usecase/stock-analysis/prompts.py): `community_usecase/stock-analysis/prompts.py`

### Other components

- **User**
- **Investment User**

## Connections

- User → Web UI: submits task (evidence: `README.md`)
- Web UI → Role Playing: runs agent session (evidence: `owl/webapp.py`)
- Role Playing → CAMEL Framework: uses framework
- Role Playing → Search, Browser & MCP Tools: dispatches tools (evidence: `README.md`)
- GAIA Benchmark → Role Playing: runs benchmark tasks (evidence: `owl/utils/gaia.py`)
- Investment User → Investment Workflow: requests analysis
- Investment Workflow → Market Data: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Technical Analysis: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Fundamentals Analysis: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Sentiment Analysis: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Valuation Analysis: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Bull Research: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Bear Research: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Research Debate: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Risk Assessment: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Portfolio Decision: calls (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Investment Workflow → Investment Models: uses data models (evidence: `community_usecase/a_share_investment_agent_camel/src/main.py`)
- Market Data → Market Data Helpers: uses helpers (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py`)
- Market Data → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/market_data_agent.py`)
- Technical Analysis → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/technical_analyst.py`)
- Fundamentals Analysis → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/fundamentals_analyst.py`)
- Sentiment Analysis → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/sentiment_analyst.py`)
- Valuation Analysis → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/valuation_analyst.py`)
- Bull Research → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/researcher_bull.py`)
- Bear Research → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/researcher_bear.py`)
- Research Debate → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/debate_room.py`)
- Risk Assessment → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/risk_manager.py`)
- Portfolio Decision → Agent Base: inherits from (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/portfolio_manager.py`)
- Technical Analysis → Agent Roles: creates role agent (evidence: `community_usecase/a_share_investment_agent_camel/src/agents/technical_analyst.py`)
- SEC Analysis Example → SEC Tools: uses tools (evidence: `community_usecase/stock-analysis/agent/sec_agent.py`)
- SEC Analysis Example → SEC Prompts: uses prompts (evidence: `community_usecase/stock-analysis/agent/sec_agent.py`)
