# ainsleyfreedman01/branchingoutai architecture

> Architecture diagram of the GitHub repository ainsleyfreedman01/branchingoutai, 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/ainsleyfreedman01/branchingoutai
- Repository: https://github.com/ainsleyfreedman01/branchingoutai

## Overview

BranchingOutAI helps users explore careers through an interactive graph: users provide interests, expand career branches, get AI guidance, and search live jobs. The graph page uses authenticated career-tree APIs; account-level state is persisted in Supabase, while a separate legacy chatbot runs through a state-routed agent graph. The README documents frontend/API relationships and major features; some backend route details and optional integrations are unsampled, so uncertain links are omitted or marked unverified.

Main entry points: [`backend/app/main.py`](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/main.py) (FastAPI routes), [`backend/app/state_manager.py`](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/state_manager.py) (Session state), [`backend/app/config.py`](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/config.py) (AI and DB clients), [`backend/app/graph_setup.py`](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/graph_setup.py) (Agent graph runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Career graph experience"]
  node_graph_page["Interactive graph<br/>[page.tsx]"]
  node_graph_api["Graph API client<br/>[graphApi.mjs]"]
  node_auth["Sign-in and profile<br/>[AuthContext.tsx]"]
end

subgraph group_api["Career-tree API"]
  node_main["FastAPI routes<br/>[main.py]"]
  node_career_tree["Career tree generation<br/>[career_tree.py]"]
  node_jobs["Live job search<br/>[live_jobs.py]"]
end

subgraph group_guidance["Career guidance"]
  node_legacy_chat["Legacy chatbot<br/>[career_chat.py]"]
  node_agent_graph["Agent graph runner<br/>[graph_setup.py]"]
  node_interests["Interest extraction<br/>[interests_node.py]"]
  node_industry["Industry suggestions<br/>[industry_node.py]"]
  node_job_node["Role suggestions<br/>[job_node.py]"]
  node_skills["Skills suggestions<br/>[skills_node.py]"]
end

subgraph group_services["Persistence and integrations"]
  node_state["Session state<br/>[state_manager.py]"]
  node_config["AI and DB clients<br/>[config.py]"]
  node_normalization["State normalization<br/>[normalization.py]"]
  node_keywords["Keyword extraction<br/>[keywords.py]"]
end

node_explorer(("Career explorer"))
node_supabase[("Supabase")]
node_openai["OpenAI"]
node_theirstack["TheirStack jobs"]

node_explorer -->|"explores careers"| node_graph_page
node_graph_page -->|"requests graph actions"| node_graph_api
node_graph_api -->|"calls career APIs"| node_main
node_auth -.->|"provides sign-in"| node_graph_page
node_main -->|"handles tree actions"| node_career_tree
node_main -->|"handles job searches"| node_jobs
node_main -->|"loads and saves state"| node_state
node_main -->|"routes legacy chat"| node_legacy_chat
node_main -->|"dispatches chatbot"| node_agent_graph
node_main -->|"normalizes state"| node_normalization
node_state -->|"reads and writes"| node_supabase
node_state -->|"gets DB client"| node_config
node_career_tree -.->|"requests suggestions"| node_openai
node_jobs -.->|"searches listings"| node_theirstack
node_agent_graph -->|"runs selected node"| node_interests
node_agent_graph -->|"runs selected node"| node_industry
node_agent_graph -->|"runs selected node"| node_job_node
node_agent_graph -->|"runs selected node"| node_skills
node_interests -->|"extracts keywords"| node_keywords
node_industry -->|"extracts keywords"| node_keywords
node_job_node -->|"extracts keywords"| node_keywords
node_skills -->|"extracts keywords"| node_keywords
node_interests -->|"requests AI parsing"| node_config
node_industry -->|"requests suggestions"| node_config
node_job_node -->|"requests suggestions"| node_config
node_skills -->|"requests skills"| node_config
node_config -->|"calls model"| node_openai
node_interests -->|"saves node state"| node_state
node_industry -->|"loads and saves"| node_state
node_job_node -->|"loads and saves"| node_state
node_skills -->|"loads and saves"| node_state

click node_graph_page "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/app/graph/page.tsx"
click node_graph_api "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/lib/graphApi.mjs"
click node_auth "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/context/AuthContext.tsx"
click node_main "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/main.py"
click node_career_tree "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/career_tree.py"
click node_jobs "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/live_jobs.py"
click node_legacy_chat "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/career_chat.py"
click node_agent_graph "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/graph_setup.py"
click node_interests "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/interests_node.py"
click node_industry "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/industry_node.py"
click node_job_node "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/job_node.py"
click node_skills "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/skills_node.py"
click node_state "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/state_manager.py"
click node_config "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/config.py"
click node_normalization "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/utils/normalization.py"
click node_keywords "https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/utils/keywords.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_graph_page,node_graph_api,node_auth toneBlue
class node_main,node_career_tree,node_jobs,node_supabase toneAmber
class node_legacy_chat,node_agent_graph,node_interests,node_industry,node_job_node,node_skills toneMint
class node_state,node_config,node_normalization,node_keywords toneRose
class node_explorer,node_openai,node_theirstack toneIndigo
```

## Components

### Career graph experience

- [Interactive graph](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/app/graph/page.tsx): `frontend/src/app/graph/page.tsx`
- [Graph API client](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/lib/graphApi.mjs): `frontend/src/lib/graphApi.mjs`
- [Sign-in and profile](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`

### Career-tree API

- [FastAPI routes](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Career tree generation](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/career_tree.py): `backend/app/career_tree.py`
- [Live job search](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/live_jobs.py): `backend/app/live_jobs.py`

### Career guidance

- [Legacy chatbot](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/career_chat.py): `backend/app/career_chat.py`
- [Agent graph runner](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/graph_setup.py): `backend/app/graph_setup.py`
- [Interest extraction](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/interests_node.py): `backend/app/nodes/interests_node.py`
- [Industry suggestions](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/industry_node.py): `backend/app/nodes/industry_node.py`
- [Role suggestions](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/job_node.py): `backend/app/nodes/job_node.py`
- [Skills suggestions](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/nodes/skills_node.py): `backend/app/nodes/skills_node.py`

### Persistence and integrations

- [Session state](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/state_manager.py): `backend/app/state_manager.py`
- [AI and DB clients](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/config.py): `backend/app/config.py`
- [State normalization](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/utils/normalization.py): `backend/app/utils/normalization.py`
- [Keyword extraction](https://github.com/ainsleyfreedman01/branchingoutai/blob/main/backend/app/utils/keywords.py): `backend/app/utils/keywords.py`

### Other components

- **Career explorer**
- **Supabase**
- **OpenAI**
- **TheirStack jobs**

## Connections

- Career explorer → Interactive graph: explores careers
- Interactive graph → Graph API client: requests graph actions
- Graph API client → FastAPI routes: calls career APIs
- Sign-in and profile → Interactive graph: provides sign-in
- FastAPI routes → Career tree generation: handles tree actions (evidence: `backend/app/main.py`)
- FastAPI routes → Live job search: handles job searches (evidence: `backend/app/main.py`)
- FastAPI routes → Session state: loads and saves state (evidence: `backend/app/main.py`)
- FastAPI routes → Legacy chatbot: routes legacy chat (evidence: `backend/app/main.py`)
- FastAPI routes → Agent graph runner: dispatches chatbot (evidence: `backend/app/main.py`)
- FastAPI routes → State normalization: normalizes state (evidence: `backend/app/main.py`)
- Session state → Supabase: reads and writes (evidence: `backend/app/state_manager.py`)
- Session state → AI and DB clients: gets DB client (evidence: `backend/app/state_manager.py`)
- Career tree generation → OpenAI: requests suggestions
- Live job search → TheirStack jobs: searches listings
- Agent graph runner → Interest extraction: runs selected node (evidence: `backend/app/graph_setup.py`)
- Agent graph runner → Industry suggestions: runs selected node (evidence: `backend/app/graph_setup.py`)
- Agent graph runner → Role suggestions: runs selected node (evidence: `backend/app/graph_setup.py`)
- Agent graph runner → Skills suggestions: runs selected node (evidence: `backend/app/graph_setup.py`)
- Interest extraction → Keyword extraction: extracts keywords (evidence: `backend/app/nodes/interests_node.py`)
- Industry suggestions → Keyword extraction: extracts keywords (evidence: `backend/app/nodes/industry_node.py`)
- Role suggestions → Keyword extraction: extracts keywords (evidence: `backend/app/nodes/job_node.py`)
- Skills suggestions → Keyword extraction: extracts keywords (evidence: `backend/app/nodes/skills_node.py`)
- Interest extraction → AI and DB clients: requests AI parsing (evidence: `backend/app/nodes/interests_node.py`)
- Industry suggestions → AI and DB clients: requests suggestions (evidence: `backend/app/nodes/industry_node.py`)
- Role suggestions → AI and DB clients: requests suggestions (evidence: `backend/app/nodes/job_node.py`)
- Skills suggestions → AI and DB clients: requests skills (evidence: `backend/app/nodes/skills_node.py`)
- AI and DB clients → OpenAI: calls model (evidence: `backend/app/config.py`)
- Interest extraction → Session state: saves node state (evidence: `backend/app/nodes/interests_node.py`)
- Industry suggestions → Session state: loads and saves (evidence: `backend/app/nodes/industry_node.py`)
- Role suggestions → Session state: loads and saves (evidence: `backend/app/nodes/job_node.py`)
- Skills suggestions → Session state: loads and saves (evidence: `backend/app/nodes/skills_node.py`)
