# ra-agnihotri/rakesh_agnihotri_sf_hackethon architecture

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

- Interactive diagram: https://gitdiagram.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon
- Repository: https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon

## Overview

Insurance AI Hub provides two dashboard front ends for insurance analytics and AI-assisted workflows: a React dashboard and a Streamlit app. The React entry point gates access through runtime login, then routes users to executive/KPI reporting, data and document exploration, governance, knowledge, and agent workflows. Agent pages include voice input and translation; the Streamlit chat utility calls an agent client, while dashboard query pages use shared Snowflake query utilities. Most feature modules were not excerpted, so their internal dependencies are left unconnected where evidence is absent.

Main entry points: [`insurance-ai-hub-deploy/dashboard/src/App.tsx`](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/App.tsx) (App router and auth), [`insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx`](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx) (Pricing advisor), [`insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx`](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx) (Product matcher), [`insurance-ai-hub-streamlit/streamlit_app.py`](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/streamlit_app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["React Dashboard"]
  node_app["App router and auth<br/>[App.tsx]"]
  node_login["Runtime login<br/>[Login.tsx]"]
end

subgraph group_streamlit["Streamlit Dashboard"]
  node_stapp["Streamlit app<br/>[streamlit_app.py]"]
  node_stkpi["Streamlit KPI page<br/>[kpi_dashboard.py]"]
  node_stexec["Streamlit executive page"]
  node_chat["Agent chat UI<br/>[agent_chat.py]"]
end

subgraph group_services["Data And Agent Services"]
  node_snowapi["Snowflake API<br/>[snowflake-api.ts]"]
  node_prefetch["Dashboard prefetch<br/>[prefetch.ts]"]
  node_voice["Voice input hook<br/>[useVoiceInput.ts]"]
  node_translate["Speech translation<br/>[translate.ts]"]
  node_cortex["Cortex agent client<br/>[cortex-agent.ts]"]
  node_queries["Snowflake queries<br/>[queries.py]"]
  node_client["Streamlit agent client<br/>[agent_client.py]"]
end

subgraph group_features["Insurance Workflows"]
  node_exec["Executive dashboard"]
  node_kpi["KPI dashboard<br/>[KPIDashboard.tsx]"]
  node_assistant["AI assistant<br/>[AIAssistant.tsx]"]
  node_knowledge["Knowledge hub<br/>[KnowledgeHub.tsx]"]
  node_agents["Agent insights<br/>[AgentInsights.tsx]"]
  node_documents["Document intelligence"]
  node_explorer["Data explorer<br/>[DataExplorer.tsx]"]
  node_governance["Governance dashboard"]
  node_admin["Admin console<br/>[AdminConsole.tsx]"]
  node_market["Market intelligence"]
  node_pricing["Pricing advisor"]
  node_matcher["Product matcher"]
  node_enterprise["Enterprise hub agent"]
end

node_user(("Dashboard user"))
node_sfuser(("Streamlit user"))
node_snowflake[("Snowflake warehouse")]

node_user -->|"opens dashboard"| node_app
node_app -->|"shows when unauthenticated"| node_login
node_app -->|"prefetches after login"| node_prefetch
node_app -->|"routes to"| node_exec
node_app -->|"routes to"| node_kpi
node_app -->|"routes to"| node_assistant
node_app -->|"routes to"| node_knowledge
node_app -->|"routes to"| node_agents
node_app -->|"routes to"| node_documents
node_app -->|"routes to"| node_explorer
node_app -->|"routes to"| node_governance
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_market
node_app -->|"routes to"| node_pricing
node_app -->|"routes to"| node_matcher
node_app -->|"routes to"| node_enterprise
node_app -->|"checks token"| node_snowapi
node_app -.->|"renders routes"| node_user
node_pricing -->|"uses voice hook"| node_voice
node_matcher -->|"uses voice hook"| node_voice
node_pricing -->|"translates speech"| node_translate
node_matcher -->|"translates speech"| node_translate
node_pricing -->|"gets token"| node_snowapi
node_matcher -->|"gets token"| node_snowapi
node_sfuser -.->|"opens app"| node_stapp
node_stapp -.->|"dispatches page"| node_stkpi
node_stapp -.->|"dispatches page"| node_stexec
node_stkpi -->|"runs SQL"| node_queries
node_stexec -->|"runs SQL"| node_queries
node_queries -.->|"queries warehouse"| node_snowflake
node_chat -->|"calls agent"| node_client
node_client -.->|"uses session"| node_snowflake

click node_app "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/App.tsx"
click node_login "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/Login.tsx"
click node_exec "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/ExecutiveDashboard.tsx"
click node_kpi "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/KPIDashboard.tsx"
click node_assistant "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AIAssistant.tsx"
click node_knowledge "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/KnowledgeHub.tsx"
click node_agents "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AgentInsights.tsx"
click node_documents "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/DocumentIntelligence.tsx"
click node_explorer "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/DataExplorer.tsx"
click node_governance "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/GovernanceDashboard.tsx"
click node_admin "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AdminConsole.tsx"
click node_market "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/MarketIntelAgent.tsx"
click node_pricing "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx"
click node_matcher "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx"
click node_enterprise "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/EnterpriseHubAgent.tsx"
click node_snowapi "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/snowflake-api.ts"
click node_prefetch "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/prefetch.ts"
click node_voice "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/hooks/useVoiceInput.ts"
click node_translate "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/translate.ts"
click node_cortex "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/cortex-agent.ts"
click node_stapp "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/streamlit_app.py"
click node_stkpi "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/app_pages/kpi_dashboard.py"
click node_stexec "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/app_pages/executive_dashboard.py"
click node_queries "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/queries.py"
click node_chat "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/agent_chat.py"
click node_client "https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/agent_client.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_app,node_login,node_user,node_sfuser toneBlue
class node_stapp,node_stkpi,node_stexec,node_chat,node_snowflake toneAmber
class node_snowapi,node_prefetch,node_voice,node_translate,node_cortex,node_queries,node_client toneMint
class node_exec,node_kpi,node_assistant,node_knowledge,node_agents,node_documents,node_explorer,node_governance,node_admin,node_market,node_pricing,node_matcher,node_enterprise toneRose
```

## Components

### React Dashboard

- [App router and auth](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/App.tsx): `insurance-ai-hub-deploy/dashboard/src/App.tsx`
- [Runtime login](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/Login.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/Login.tsx`

### Streamlit Dashboard

- [Streamlit app](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/streamlit_app.py): `insurance-ai-hub-streamlit/streamlit_app.py`
- [Streamlit KPI page](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/app_pages/kpi_dashboard.py): `insurance-ai-hub-streamlit/app_pages/kpi_dashboard.py`
- [Streamlit executive page](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/app_pages/executive_dashboard.py): `insurance-ai-hub-streamlit/app_pages/executive_dashboard.py`
- [Agent chat UI](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/agent_chat.py): `insurance-ai-hub-streamlit/utils/agent_chat.py`

### Data And Agent Services

- [Snowflake API](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/snowflake-api.ts): `insurance-ai-hub-deploy/dashboard/src/services/snowflake-api.ts`
- [Dashboard prefetch](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/prefetch.ts): `insurance-ai-hub-deploy/dashboard/src/services/prefetch.ts`
- [Voice input hook](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/hooks/useVoiceInput.ts): `insurance-ai-hub-deploy/dashboard/src/hooks/useVoiceInput.ts`
- [Speech translation](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/translate.ts): `insurance-ai-hub-deploy/dashboard/src/services/translate.ts`
- [Cortex agent client](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/services/cortex-agent.ts): `insurance-ai-hub-deploy/dashboard/src/services/cortex-agent.ts`
- [Snowflake queries](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/queries.py): `insurance-ai-hub-streamlit/utils/queries.py`
- [Streamlit agent client](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-streamlit/utils/agent_client.py): `insurance-ai-hub-streamlit/utils/agent_client.py`

### Insurance Workflows

- [Executive dashboard](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/ExecutiveDashboard.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/ExecutiveDashboard.tsx`
- [KPI dashboard](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/KPIDashboard.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/KPIDashboard.tsx`
- [AI assistant](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AIAssistant.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/AIAssistant.tsx`
- [Knowledge hub](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/KnowledgeHub.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/KnowledgeHub.tsx`
- [Agent insights](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AgentInsights.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/AgentInsights.tsx`
- [Document intelligence](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/DocumentIntelligence.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/DocumentIntelligence.tsx`
- [Data explorer](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/DataExplorer.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/DataExplorer.tsx`
- [Governance dashboard](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/GovernanceDashboard.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/GovernanceDashboard.tsx`
- [Admin console](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/AdminConsole.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/AdminConsole.tsx`
- [Market intelligence](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/MarketIntelAgent.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/MarketIntelAgent.tsx`
- [Pricing advisor](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx`
- [Product matcher](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx`
- [Enterprise hub agent](https://github.com/ra-agnihotri/rakesh_agnihotri_sf_hackethon/blob/main/insurance-ai-hub-deploy/dashboard/src/pages/EnterpriseHubAgent.tsx): `insurance-ai-hub-deploy/dashboard/src/pages/EnterpriseHubAgent.tsx`

### Other components

- **Dashboard user**
- **Streamlit user**
- **Snowflake warehouse**

## Connections

- Dashboard user → App router and auth: opens dashboard (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Runtime login: shows when unauthenticated (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Dashboard prefetch: prefetches after login (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Executive dashboard: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → KPI dashboard: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → AI assistant: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Knowledge hub: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Agent insights: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Document intelligence: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Data explorer: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Governance dashboard: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Admin console: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Market intelligence: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Pricing advisor: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Product matcher: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Enterprise hub agent: routes to (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Snowflake API: checks token (evidence: `insurance-ai-hub-deploy/dashboard/src/App.tsx`)
- App router and auth → Dashboard user: renders routes
- Pricing advisor → Voice input hook: uses voice hook (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx`)
- Product matcher → Voice input hook: uses voice hook (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx`)
- Pricing advisor → Speech translation: translates speech (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx`)
- Product matcher → Speech translation: translates speech (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx`)
- Pricing advisor → Snowflake API: gets token (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/PricingAdvisorAgent.tsx`)
- Product matcher → Snowflake API: gets token (evidence: `insurance-ai-hub-deploy/dashboard/src/pages/ProductMatcherAgent.tsx`)
- Streamlit user → Streamlit app: opens app
- Streamlit app → Streamlit KPI page: dispatches page
- Streamlit app → Streamlit executive page: dispatches page
- Streamlit KPI page → Snowflake queries: runs SQL (evidence: `insurance-ai-hub-streamlit/app_pages/kpi_dashboard.py`)
- Streamlit executive page → Snowflake queries: runs SQL (evidence: `insurance-ai-hub-streamlit/app_pages/executive_dashboard.py`)
- Snowflake queries → Snowflake warehouse: queries warehouse
- Agent chat UI → Streamlit agent client: calls agent (evidence: `insurance-ai-hub-streamlit/utils/agent_chat.py`)
- Streamlit agent client → Snowflake warehouse: uses session
