How shettigarpratham6-web/portfolio-health-monitor works
Portfolio Health Monitor is a web-based, evidence-focused portfolio surveillance product. Users authenticate, manage holdings, and initiate monitoring; the backend orchestrates portfolio analysis, research discovery, verification, impact assessment, and alert reporting, then presents results in the dashboard. The README documents additional capabilities including live market data, external research, audit exports, and observability. Edges are limited to relationships supported by excerpts, the source index, or README; unsampled subsystem paths use their enclosing directories.
Main entry points: supervisor.py Supervisor agent · clients.py MCP tool gateway · App.tsx Web application · portfolios.py Portfolio routes
Components 29
Web client
- Web application
frontend/src/App.tsx - Authentication UI
frontend/src/components/auth/AuthModal.tsx - Auth context
frontend/src/context/AuthContext.tsx - Portfolio dashboard
frontend/src/components/dashboard/PortfolioManager.tsx - Alerts dashboard
frontend/src/components/dashboard/AlertsManager.tsx - Frontend API client
frontend/src/api/client.ts
API and security
- Authentication routes
app/api/routes/auth.py - Portfolio routes
app/api/routes/portfolios.py - Input and output guardrails
app/guardrails
Monitoring workflow
- LangGraph workflow
app/graph/workflow.py - Supervisor agent
app/agents/supervisor.py - Portfolio analysis
app/agents/portfolio_agent.py - Research discovery
app/agents/discovery_agent.py - Evidence verification
app/agents/verification_agent.py - Risk impact analysis
app/agents/impact_agent.py - Alert reporting
app/agents/reporting_agent.py
Tools and integrations
- MCP tool gateway
app/mcp/clients.py - MCP tool servers
app/mcp/servers - LLM service
app/services/llm.py - Market data and FX
app/services/twelve_data.py - Research service
app/services/research.py - LangSmith tracing
app/core/tracing.py
Persistence
- PostgreSQL
- Database access
app/database/connection.py - Portfolio and event models
app/models
Other components
- Portfolio user
- Tavily search
- OpenRouter
- LangSmith Cloud
Connections 40
- Portfolio user → Web application: uses
- Web application → Authentication UI: renders
frontend/src/App.tsx - Web application → Portfolio dashboard: renders
frontend/src/App.tsx - Web application → Alerts dashboard: renders
frontend/src/App.tsx - Web application → Auth context: provides auth
frontend/src/App.tsx - Authentication UI → Auth context: uses
frontend/src/components/auth/AuthModal.tsx - Auth context → Frontend API client: stores credentials
frontend/src/context/AuthContext.tsx - Portfolio dashboard → Frontend API client: calls API
frontend/src/components/dashboard/PortfolioManager.tsx - Alerts dashboard → Frontend API client: calls API
frontend/src/components/dashboard/AlertsManager.tsx - Frontend API client → Authentication routes: HTTP requests
- Frontend API client → Portfolio routes: HTTP requests
- Authentication routes → Database access: uses sessions
app/api/routes/auth.py - Authentication routes → Portfolio and event models: queries users
app/api/routes/auth.py - Portfolio routes → LangGraph workflow: starts monitoring
app/api/routes/portfolios.py - Portfolio routes → Market data and FX: fetches quotes
app/api/routes/portfolios.py - Portfolio routes → Database access: uses sessions
app/api/routes/portfolios.py - LangGraph workflow → Input and output guardrails: validates inputs
app/graph/workflow.py - LangGraph workflow → Supervisor agent: routes work
app/graph/workflow.py - Supervisor agent → Portfolio analysis: loads holdings
app/agents/supervisor.py - Supervisor agent → Research discovery: requests research
app/agents/supervisor.py - Supervisor agent → Evidence verification: verifies events
app/agents/supervisor.py - Supervisor agent → Risk impact analysis: assesses impact
app/agents/supervisor.py - Supervisor agent → Alert reporting: builds report
app/agents/supervisor.py - Portfolio analysis → MCP tool gateway: requests tools
app/agents/portfolio_agent.py - Research discovery → MCP tool gateway: requests tools
app/agents/discovery_agent.py - Evidence verification → MCP tool gateway: checks duplicates
app/agents/verification_agent.py - Risk impact analysis → MCP tool gateway: requests analysis
app/agents/impact_agent.py - Alert reporting → MCP tool gateway: persists alerts
app/agents/reporting_agent.py - MCP tool gateway → MCP tool servers: dispatches tools
app/mcp/clients.py - MCP tool servers → PostgreSQL: reads and writes
- MCP tool servers → Tavily search: searches
- Research discovery → LLM service: uses language model
app/agents/discovery_agent.py - Evidence verification → LLM service: classifies evidence
app/agents/verification_agent.py - LLM service → OpenRouter: sends completions
app/services/llm.py - Portfolio routes → Portfolio and event models: reads and writes
app/api/routes/portfolios.py - Database access → PostgreSQL: connects
app/database/connection.py - LangGraph workflow → LangSmith tracing: configures tracing
app/graph/workflow.py - LangSmith tracing → LangSmith Cloud: sends traces
- Research service → Tavily search: searches
- Market data and FX → Tavily search