# koraysrn/multiagent-portfolio-intelligence-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/koraysrn/multiagent-portfolio-intelligence-assistant
- Repository: https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant

## Overview

Portfolio Intelligence Assistant lets investors upload a portfolio, receive deterministic financial analysis, and explore results in a dashboard or chat. The documented analysis pipeline routes requests through planning, financial execution, quality checks, and decision-making; the dashboard also computes portfolio analytics directly. Major capabilities include live market/news data, hybrid RAG, onboarding, and PDF/Excel reports. Relationships for unsampled routes and pipeline internals are shown only where the README documents them; some subsystem links remain unverified because their source was not excerpted.

Main entry points: [`backend/app/graph/nodes/execution_layer_node.py`](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/execution_layer_node.py) (Engine execution), [`backend/app/api/dashboard_endpoint.py`](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/dashboard_endpoint.py) (Dashboard analysis), [`backend/app/graph/workflow_graph.py`](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/workflow_graph.py) (LangGraph workflow), [`frontend/src/services/api.ts`](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/services/api.ts) (Frontend API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Investor experience"]
  node_dashboard["Portfolio dashboard<br/>[page.tsx]"]
  node_upload_ui["Portfolio upload"]
  node_chat_ui["Analysis chat<br/>[ChatSection.tsx]"]
  node_dashboard_ui["Analysis views<br/>[AutoDashboard.tsx]"]
  node_api_client["Frontend API client<br/>[api.ts]"]
end

subgraph group_api["API and workflow"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_api_routes["API routes<br/>[endpoints.py]"]
  node_upload_route["Portfolio upload route<br/>[upload.py]"]
  node_chat_route["Chat route<br/>[chat.py]"]
  node_dashboard_route["Dashboard analysis"]
  node_onboarding["Investor onboarding<br/>[onboarding.py]"]
  node_workflow["LangGraph workflow<br/>[workflow_graph.py]"]
  node_controller["Intent controller<br/>[controller_node.py]"]
  node_router["Dynamic router<br/>[dynamic_router.py]"]
  node_planning["Analysis planning<br/>[planning_node.py]"]
  node_execution["Engine execution"]
  node_quality["Quality checks<br/>[quality_nodes.py]"]
  node_decision["Analysis decisions<br/>[decision_nodes.py]"]
end

subgraph group_analysis["Financial analysis"]
  node_risk["Risk analytics<br/>[risk_engine.py]"]
  node_technical["Technical analysis"]
  node_fundamental["Fundamental analysis"]
  node_monte_carlo["Monte Carlo"]
  node_optimization["Portfolio optimization"]
  node_thesis["Investment thesis"]
  node_other_engines["Other financial engines"]
end

subgraph group_knowledge["Knowledge and output"]
  node_parser["Portfolio parser<br/>[parser.py]"]
  node_market_data["Live market data<br/>[data_fetcher.py]"]
  node_news["News intelligence"]
  node_rag[("Hybrid portfolio RAG<br/>[vector_store.py]")]
  node_llm["LLM provider factory<br/>[llm.py]"]
  node_reports["PDF and Excel reports"]
end

node_investor(("Investor"))
node_external_data(("Market and news providers"))
node_llm_provider(("LLM services"))

node_investor -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_upload_ui
node_dashboard -->|"renders"| node_chat_ui
node_dashboard -->|"renders"| node_dashboard_ui
node_upload_ui -->|"uploads through"| node_api_client
node_chat_ui -->|"sends messages through"| node_api_client
node_api_client -->|"posts uploads"| node_upload_route
node_api_client -->|"posts chat"| node_chat_route
node_api_client -.->|"requests dashboard"| node_dashboard_route
node_fastapi -->|"registers"| node_api_routes
node_fastapi -->|"registers"| node_dashboard_route
node_fastapi -->|"registers"| node_onboarding
node_api_routes -->|"includes"| node_upload_route
node_api_routes -->|"includes"| node_chat_route
node_upload_route -.->|"parses portfolio"| node_parser
node_chat_route -->|"runs analysis"| node_workflow
node_dashboard_route -->|"uses parsed portfolio"| node_parser
node_dashboard_route -->|"computes risk"| node_risk
node_workflow -->|"starts at"| node_controller
node_workflow -->|"routes stages"| node_router
node_workflow -->|"plans analysis"| node_planning
node_workflow -->|"runs engines"| node_execution
node_workflow -->|"checks results"| node_quality
node_workflow -->|"decides outcome"| node_decision
node_controller -.->|"sets route plan"| node_router
node_execution -.->|"runs"| node_risk
node_execution -.->|"runs"| node_technical
node_execution -.->|"runs"| node_fundamental
node_execution -.->|"runs"| node_monte_carlo
node_execution -.->|"runs"| node_optimization
node_execution -.->|"runs"| node_other_engines
node_dashboard_route -->|"uses"| node_fundamental
node_dashboard_route -->|"uses"| node_technical
node_dashboard_route -->|"uses"| node_monte_carlo
node_dashboard_route -->|"uses"| node_news
node_dashboard_route -->|"fetches data"| node_market_data
node_execution -.->|"fetches live data"| node_market_data
node_execution -.->|"analyzes news"| node_news
node_execution -.->|"retrieves evidence"| node_rag
node_execution -.->|"requests interpretation"| node_llm
node_thesis -->|"uses inputs"| node_fundamental
node_thesis -->|"uses inputs"| node_technical
node_thesis -->|"uses inputs"| node_news
node_thesis -->|"uses inputs"| node_monte_carlo
node_market_data -.->|"queries prices"| node_external_data
node_news -.->|"searches news"| node_external_data
node_llm -->|"selects provider"| node_llm_provider
node_onboarding -->|"generates reports"| node_reports

click node_dashboard "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/app/dashboard/page.tsx"
click node_upload_ui "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/PortfolioUpload.tsx"
click node_chat_ui "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/ChatSection.tsx"
click node_dashboard_ui "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/AutoDashboard.tsx"
click node_api_client "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/services/api.ts"
click node_fastapi "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/endpoints.py"
click node_upload_route "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/routers/upload.py"
click node_chat_route "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/routers/chat.py"
click node_dashboard_route "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/dashboard_endpoint.py"
click node_onboarding "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/onboarding.py"
click node_parser "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/parser.py"
click node_workflow "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/workflow_graph.py"
click node_controller "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/controller_node.py"
click node_router "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/routers/dynamic_router.py"
click node_planning "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/planning_node.py"
click node_execution "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/execution_layer_node.py"
click node_quality "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/quality_nodes.py"
click node_decision "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/decision_nodes.py"
click node_risk "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/risk_engine.py"
click node_technical "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/technical_engine.py"
click node_fundamental "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/fundamental_engine.py"
click node_monte_carlo "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/monte_carlo_engine.py"
click node_optimization "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/optimization_engine.py"
click node_thesis "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/investment_thesis_engine.py"
click node_other_engines "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/tree/main/backend/app/engines"
click node_market_data "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/data_fetcher.py"
click node_news "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/news_intelligence.py"
click node_rag "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/vector_store.py"
click node_llm "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/config/llm.py"
click node_reports "https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/report_generator.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_dashboard,node_upload_ui,node_chat_ui,node_dashboard_ui,node_api_client toneBlue
class node_fastapi,node_api_routes,node_upload_route,node_chat_route,node_dashboard_route,node_onboarding,node_workflow,node_controller,node_router,node_planning,node_execution,node_quality,node_decision toneAmber
class node_risk,node_technical,node_fundamental,node_monte_carlo,node_optimization,node_thesis,node_other_engines toneMint
class node_parser,node_market_data,node_news,node_rag,node_llm,node_reports toneRose
class node_investor,node_external_data,node_llm_provider toneIndigo
```

## Components

### Investor experience

- [Portfolio dashboard](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Portfolio upload](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/PortfolioUpload.tsx): `frontend/src/components/PortfolioUpload.tsx`
- [Analysis chat](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/ChatSection.tsx): `frontend/src/components/ChatSection.tsx`
- [Analysis views](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/components/AutoDashboard.tsx): `frontend/src/components/AutoDashboard.tsx`
- [Frontend API client](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and workflow

- [FastAPI application](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/endpoints.py): `backend/app/api/endpoints.py`
- [Portfolio upload route](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/routers/upload.py): `backend/app/api/routers/upload.py`
- [Chat route](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/routers/chat.py): `backend/app/api/routers/chat.py`
- [Dashboard analysis](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/dashboard_endpoint.py): `backend/app/api/dashboard_endpoint.py`
- [Investor onboarding](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/api/onboarding.py): `backend/app/api/onboarding.py`
- [LangGraph workflow](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/workflow_graph.py): `backend/app/graph/workflow_graph.py`
- [Intent controller](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/controller_node.py): `backend/app/graph/nodes/controller_node.py`
- [Dynamic router](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/routers/dynamic_router.py): `backend/app/graph/routers/dynamic_router.py`
- [Analysis planning](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/planning_node.py): `backend/app/graph/nodes/planning_node.py`
- [Engine execution](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/execution_layer_node.py): `backend/app/graph/nodes/execution_layer_node.py`
- [Quality checks](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/quality_nodes.py): `backend/app/graph/nodes/quality_nodes.py`
- [Analysis decisions](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/graph/nodes/decision_nodes.py): `backend/app/graph/nodes/decision_nodes.py`

### Financial analysis

- [Risk analytics](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/risk_engine.py): `backend/app/engines/risk_engine.py`
- [Technical analysis](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/technical_engine.py): `backend/app/engines/technical_engine.py`
- [Fundamental analysis](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/fundamental_engine.py): `backend/app/engines/fundamental_engine.py`
- [Monte Carlo](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/monte_carlo_engine.py): `backend/app/engines/monte_carlo_engine.py`
- [Portfolio optimization](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/optimization_engine.py): `backend/app/engines/optimization_engine.py`
- [Investment thesis](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/investment_thesis_engine.py): `backend/app/engines/investment_thesis_engine.py`
- [Other financial engines](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/tree/main/backend/app/engines): `backend/app/engines`

### Knowledge and output

- [Portfolio parser](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/parser.py): `backend/app/services/parser.py`
- [Live market data](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/data_fetcher.py): `backend/app/services/data_fetcher.py`
- [News intelligence](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/engines/news_intelligence.py): `backend/app/engines/news_intelligence.py`
- [Hybrid portfolio RAG](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/vector_store.py): `backend/app/services/vector_store.py`
- [LLM provider factory](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/config/llm.py): `backend/app/config/llm.py`
- [PDF and Excel reports](https://github.com/koraysrn/multiagent-portfolio-intelligence-assistant/blob/main/backend/app/services/report_generator.py): `backend/app/services/report_generator.py`

### Other components

- **Investor**
- **Market and news providers**
- **LLM services**

## Connections

- Investor → Portfolio dashboard: uses
- Portfolio dashboard → Portfolio upload: renders (evidence: `frontend/src/app/dashboard/page.tsx`)
- Portfolio dashboard → Analysis chat: renders (evidence: `frontend/src/app/dashboard/page.tsx`)
- Portfolio dashboard → Analysis views: renders (evidence: `frontend/src/app/dashboard/page.tsx`)
- Portfolio upload → Frontend API client: uploads through (evidence: `frontend/src/components/PortfolioUpload.tsx`)
- Analysis chat → Frontend API client: sends messages through (evidence: `frontend/src/components/ChatSection.tsx`)
- Frontend API client → Portfolio upload route: posts uploads (evidence: `frontend/src/services/api.ts`)
- Frontend API client → Chat route: posts chat (evidence: `frontend/src/services/api.ts`)
- Frontend API client → Dashboard analysis: requests dashboard
- FastAPI application → API routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Dashboard analysis: registers (evidence: `backend/app/main.py`)
- FastAPI application → Investor onboarding: registers (evidence: `backend/app/main.py`)
- API routes → Portfolio upload route: includes (evidence: `backend/app/api/endpoints.py`)
- API routes → Chat route: includes (evidence: `backend/app/api/endpoints.py`)
- Portfolio upload route → Portfolio parser: parses portfolio
- Chat route → LangGraph workflow: runs analysis (evidence: `backend/app/api/routers/chat.py`)
- Dashboard analysis → Portfolio parser: uses parsed portfolio (evidence: `backend/app/api/dashboard_endpoint.py`)
- Dashboard analysis → Risk analytics: computes risk (evidence: `backend/app/api/dashboard_endpoint.py`)
- LangGraph workflow → Intent controller: starts at
- LangGraph workflow → Dynamic router: routes stages
- LangGraph workflow → Analysis planning: plans analysis
- LangGraph workflow → Engine execution: runs engines
- LangGraph workflow → Quality checks: checks results
- LangGraph workflow → Analysis decisions: decides outcome
- Intent controller → Dynamic router: sets route plan
- Engine execution → Risk analytics: runs
- Engine execution → Technical analysis: runs
- Engine execution → Fundamental analysis: runs
- Engine execution → Monte Carlo: runs
- Engine execution → Portfolio optimization: runs
- Engine execution → Other financial engines: runs
- Dashboard analysis → Fundamental analysis: uses (evidence: `backend/app/api/dashboard_endpoint.py`)
- Dashboard analysis → Technical analysis: uses (evidence: `backend/app/api/dashboard_endpoint.py`)
- Dashboard analysis → Monte Carlo: uses (evidence: `backend/app/api/dashboard_endpoint.py`)
- Dashboard analysis → News intelligence: uses (evidence: `backend/app/api/dashboard_endpoint.py`)
- Dashboard analysis → Live market data: fetches data (evidence: `backend/app/api/dashboard_endpoint.py`)
- Engine execution → Live market data: fetches live data
- Engine execution → News intelligence: analyzes news
- Engine execution → Hybrid portfolio RAG: retrieves evidence
- Engine execution → LLM provider factory: requests interpretation
- Investment thesis → Fundamental analysis: uses inputs (evidence: `backend/app/engines/investment_thesis_engine.py`)
- Investment thesis → Technical analysis: uses inputs (evidence: `backend/app/engines/investment_thesis_engine.py`)
- Investment thesis → News intelligence: uses inputs (evidence: `backend/app/engines/investment_thesis_engine.py`)
- Investment thesis → Monte Carlo: uses inputs (evidence: `backend/app/engines/investment_thesis_engine.py`)
- Live market data → Market and news providers: queries prices
- News intelligence → Market and news providers: searches news
- LLM provider factory → LLM services: selects provider (evidence: `backend/app/config/llm.py`)
- Investor onboarding → PDF and Excel reports: generates reports (evidence: `backend/app/api/onboarding.py`)
