# ijaeg/job-hunt-agent architecture

> Architecture diagram of the GitHub repository ijaeg/job-hunt-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ijaeg/job-hunt-agent
- Repository: https://github.com/ijaeg/job-hunt-agent

## Overview

This is a Streamlit job-search assistant for software developers in Germany. A user describes a role; the agent searches the Federal Employment Agency board, refines results, retrieves promising listing details, assesses fit against the profile, and presents an explained shortlist. Tracker saves and preference memories require user approval. The graph combines the documented product workflow with source-index relationships and shown imports; some internal tool and page wiring is unsampled, so those connections are omitted where evidence is insufficient.

Main entry points: [`src/job_hunt_agent/agent.py`](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/agent.py) (Agent graph), [`app.py`](https://github.com/ijaeg/job-hunt-agent/blob/main/app.py) (Chat app), [`src/job_hunt_agent/ba_client.py`](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/ba_client.py) (BA and demo source), [`ui_shared.py`](https://github.com/ijaeg/job-hunt-agent/blob/main/ui_shared.py) (Shared UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_streamlit["Chat app<br/>[app.py]"]
  node_shared_ui["Shared UI<br/>[ui_shared.py]"]
  node_results_ui["Shortlist views<br/>[ui_view.py]"]
  node_tracker_page["Tracker page<br/>[1_Tracker.py]"]
  node_memory_page["Memory page<br/>[2_Memory.py]"]
  node_profile_page["Profile page<br/>[3_Profile.py]"]
  node_settings_page["Developer settings"]
end

subgraph group_agent["Agent runtime"]
  node_agent["Agent graph<br/>[agent.py]"]
  node_middleware["Guards and context"]
  node_state["Thread state<br/>[state.py]"]
  node_context["Run context<br/>[context.py]"]
end

subgraph group_jobdata["Job discovery and fit"]
  node_search["Search tool<br/>[search.py]"]
  node_details["Listing details<br/>[details.py]"]
  node_assessment["Fit assessment<br/>[assess.py]"]
  node_rubric["Fit rubric<br/>[rubric.py]"]
  node_ba_source["BA and demo source<br/>[ba_client.py]"]
end

subgraph group_persistence["Profile and persistence"]
  node_tracker_memory["Tracker and memory tools"]
  node_sqlite[("SQLite stores<br/>[storage.py]")]
  node_profile["Profile models<br/>[models.py]"]
end

subgraph group_operations["Model and observability"]
  node_model_factory["Model client<br/>[llm.py]"]
  node_usage["Usage accounting<br/>[usage.py]"]
  node_tracing["Tracing<br/>[tracing.py]"]
end

node_jobseeker(("Job seeker"))
node_openrouter["OpenRouter"]
node_ba_api["BA job board API"]

node_jobseeker -->|"describes search"| node_streamlit
node_streamlit -->|"runs turns"| node_agent
node_streamlit -->|"uses shared UI"| node_shared_ui
node_streamlit -->|"renders shortlist"| node_results_ui
node_agent -->|"assembles guards"| node_middleware
node_agent -->|"registers tool"| node_search
node_agent -->|"registers tool"| node_details
node_agent -->|"registers tool"| node_assessment
node_agent -->|"registers tools"| node_tracker_memory
node_agent -->|"configures state"| node_state
node_agent -->|"uses run context"| node_context
node_search -->|"searches listings"| node_ba_source
node_assessment -->|"scores fit"| node_rubric
node_assessment -->|"loads details"| node_ba_source
node_context -->|"supplies source"| node_ba_source
node_ba_source -->|"queries board"| node_ba_api
node_tracker_memory -->|"persists approved changes"| node_sqlite
node_agent -->|"configures persistence"| node_sqlite
node_shared_ui -->|"shares connection"| node_sqlite
node_shared_ui -->|"loads selected profile"| node_profile
node_context -->|"carries profile"| node_profile
node_jobseeker -->|"reviews entries"| node_tracker_page
node_jobseeker -->|"reviews memories"| node_memory_page
node_jobseeker -->|"edits profile"| node_profile_page
node_jobseeker -->|"changes settings"| node_settings_page
node_model_factory -->|"calls model API"| node_openrouter
node_agent -->|"uses chat model"| node_model_factory
node_streamlit -->|"records turn usage"| node_usage
node_streamlit -->|"configures callbacks"| node_tracing
node_settings_page -->|"configures tracing"| node_tracing

click node_streamlit "https://github.com/ijaeg/job-hunt-agent/blob/main/app.py"
click node_shared_ui "https://github.com/ijaeg/job-hunt-agent/blob/main/ui_shared.py"
click node_results_ui "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/ui_view.py"
click node_tracker_page "https://github.com/ijaeg/job-hunt-agent/blob/main/pages/1_Tracker.py"
click node_memory_page "https://github.com/ijaeg/job-hunt-agent/blob/main/pages/2_Memory.py"
click node_profile_page "https://github.com/ijaeg/job-hunt-agent/blob/main/pages/3_Profile.py"
click node_settings_page "https://github.com/ijaeg/job-hunt-agent/blob/main/pages/4_Developer_settings.py"
click node_agent "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/agent.py"
click node_middleware "https://github.com/ijaeg/job-hunt-agent/tree/main/src/job_hunt_agent/middleware"
click node_state "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/state.py"
click node_context "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/context.py"
click node_search "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/search.py"
click node_details "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/details.py"
click node_assessment "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/assess.py"
click node_rubric "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/rubric.py"
click node_ba_source "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/ba_client.py"
click node_tracker_memory "https://github.com/ijaeg/job-hunt-agent/tree/main/src/job_hunt_agent/tools"
click node_sqlite "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/storage.py"
click node_profile "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/models.py"
click node_model_factory "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/llm.py"
click node_usage "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/usage.py"
click node_tracing "https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tracing.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_streamlit,node_shared_ui,node_results_ui,node_tracker_page,node_memory_page,node_profile_page,node_settings_page toneBlue
class node_agent,node_middleware,node_state,node_context toneAmber
class node_search,node_details,node_assessment,node_rubric,node_ba_source,node_openrouter,node_ba_api toneMint
class node_tracker_memory,node_sqlite,node_profile toneRose
class node_model_factory,node_usage,node_tracing,node_jobseeker toneIndigo
```

## Components

### User experience

- [Chat app](https://github.com/ijaeg/job-hunt-agent/blob/main/app.py): `app.py`
- [Shared UI](https://github.com/ijaeg/job-hunt-agent/blob/main/ui_shared.py): `ui_shared.py`
- [Shortlist views](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/ui_view.py): `src/job_hunt_agent/ui_view.py`
- [Tracker page](https://github.com/ijaeg/job-hunt-agent/blob/main/pages/1_Tracker.py): `pages/1_Tracker.py`
- [Memory page](https://github.com/ijaeg/job-hunt-agent/blob/main/pages/2_Memory.py): `pages/2_Memory.py`
- [Profile page](https://github.com/ijaeg/job-hunt-agent/blob/main/pages/3_Profile.py): `pages/3_Profile.py`
- [Developer settings](https://github.com/ijaeg/job-hunt-agent/blob/main/pages/4_Developer_settings.py): `pages/4_Developer_settings.py`

### Agent runtime

- [Agent graph](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/agent.py): `src/job_hunt_agent/agent.py`
- [Guards and context](https://github.com/ijaeg/job-hunt-agent/tree/main/src/job_hunt_agent/middleware): `src/job_hunt_agent/middleware`
- [Thread state](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/state.py): `src/job_hunt_agent/state.py`
- [Run context](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/context.py): `src/job_hunt_agent/context.py`

### Job discovery and fit

- [Search tool](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/search.py): `src/job_hunt_agent/tools/search.py`
- [Listing details](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/details.py): `src/job_hunt_agent/tools/details.py`
- [Fit assessment](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tools/assess.py): `src/job_hunt_agent/tools/assess.py`
- [Fit rubric](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/rubric.py): `src/job_hunt_agent/rubric.py`
- [BA and demo source](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/ba_client.py): `src/job_hunt_agent/ba_client.py`

### Profile and persistence

- [Tracker and memory tools](https://github.com/ijaeg/job-hunt-agent/tree/main/src/job_hunt_agent/tools): `src/job_hunt_agent/tools`
- [SQLite stores](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/storage.py): `src/job_hunt_agent/storage.py`
- [Profile models](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/models.py): `src/job_hunt_agent/models.py`

### Model and observability

- [Model client](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/llm.py): `src/job_hunt_agent/llm.py`
- [Usage accounting](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/usage.py): `src/job_hunt_agent/usage.py`
- [Tracing](https://github.com/ijaeg/job-hunt-agent/blob/main/src/job_hunt_agent/tracing.py): `src/job_hunt_agent/tracing.py`

### Other components

- **Job seeker**
- **OpenRouter**
- **BA job board API**

## Connections

- Job seeker → Chat app: describes search (evidence: `README.md`)
- Chat app → Agent graph: runs turns (evidence: `app.py`)
- Chat app → Shared UI: uses shared UI (evidence: `app.py`)
- Chat app → Shortlist views: renders shortlist (evidence: `README.md`)
- Agent graph → Guards and context: assembles guards (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Search tool: registers tool (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Listing details: registers tool (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Fit assessment: registers tool (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Tracker and memory tools: registers tools (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Thread state: configures state (evidence: `src/job_hunt_agent/agent.py`)
- Agent graph → Run context: uses run context (evidence: `src/job_hunt_agent/agent.py`)
- Search tool → BA and demo source: searches listings (evidence: `src/job_hunt_agent/tools/search.py`)
- Fit assessment → Fit rubric: scores fit (evidence: `src/job_hunt_agent/tools/assess.py`)
- Fit assessment → BA and demo source: loads details (evidence: `src/job_hunt_agent/tools/assess.py`)
- Run context → BA and demo source: supplies source (evidence: `src/job_hunt_agent/context.py`)
- BA and demo source → BA job board API: queries board (evidence: `README.md`)
- Tracker and memory tools → SQLite stores: persists approved changes (evidence: `README.md`)
- Agent graph → SQLite stores: configures persistence (evidence: `src/job_hunt_agent/agent.py`)
- Shared UI → SQLite stores: shares connection (evidence: `ui_shared.py`)
- Shared UI → Profile models: loads selected profile (evidence: `ui_shared.py`)
- Run context → Profile models: carries profile (evidence: `src/job_hunt_agent/context.py`)
- Job seeker → Tracker page: reviews entries (evidence: `README.md`)
- Job seeker → Memory page: reviews memories (evidence: `README.md`)
- Job seeker → Profile page: edits profile (evidence: `README.md`)
- Job seeker → Developer settings: changes settings (evidence: `README.md`)
- Model client → OpenRouter: calls model API (evidence: `src/job_hunt_agent/llm.py`)
- Agent graph → Model client: uses chat model (evidence: `README.md`)
- Chat app → Usage accounting: records turn usage (evidence: `app.py`)
- Chat app → Tracing: configures callbacks (evidence: `app.py`)
- Developer settings → Tracing: configures tracing (evidence: `pages/4_Developer_settings.py`)
