# tanbui/job-search-agent architecture

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

- Interactive diagram: https://gitdiagram.com/tanbui/job-search-agent
- Repository: https://github.com/tanbui/job-search-agent

## Overview

#### Purpose and Entry Point
A Python CLI system that turns a job role/location query into a multi-part job-search report. `main.py` is the execution entry point: it validates configuration, builds the agent/task graph, runs it sequentially, and writes timestamped text reports under `outputs/`.

Paths: `main.py`, `outputs/.gitkeep`, `examples/example_output.txt`

#### Runtime and Dependencies
Runs on Python 3.10+ and is intended to be launched with uv (`uv run main.py`). The application uses CrewAI for multi-agent orchestration, LangChain integration, Anthropic Claude for agent reasoning, and HTTP access to Adzuna for live listings.

Paths: `pyproject.toml`, `requirements.txt`, `.env.example`

#### Configuration Boundary
Configuration centralizes default search inputs (role, location, result count), Claude model selection, and environment-backed credentials. Startup validation is the boundary preventing execution without Anthropic and Adzuna keys; secrets belong in a local `.env`, not source control.

Paths: `src/config.py`, `.env.example`, `main.py`

#### Agent Layer
Four specialized CrewAI agents define the system’s reasoning roles: job searcher, skills advisor, interview coach, and career advisor. The job-search agent is the only role expected to directly retrieve external listing data; downstream agents transform the job-listing context into advisory content through Claude.

Paths: `src/agents.py`, `src/tools.py`, `src/config.py`

#### Task Pipeline and Control Flow
Tasks encode a sequential dependency chain managed by a CrewAI Crew:
1. Job search retrieves and formats listings.
2. Skills analysis consumes listings and creates a learning roadmap.
3. Interview preparation uses listings for role-specific questions and STAR guidance.
4. Career advice uses the accumulated prior context for resume, LinkedIn, and networking recommendations.

The sequential ordering is the primary control boundary: later stages depend on earlier task outputs rather than independently fetching data.

Paths: `src/tasks.py`, `src/agents.py`, `main.py`

#### External Data Integration
The Adzuna integration is isolated in the tool layer, where API credentials, request behavior, and response/error handling should remain contained. This keeps external job-board coupling out of agent definitions and task orchestration. Anthropic is the separate LLM service boundary used by all agents.

Paths: `src/tools.py`, `src/config.py`, `src/agents.py`

#### Output and Verification
Execution produces an aggregate report plus stage-specific artifacts in `outputs/`, making generated content a filesystem delivery boundary rather than a web/API response. Tool-level behavior has focused automated coverage, especially appropriate for the external API boundary.

Paths: `main.py`, `outputs/.gitkeep`, `tests/test_tools.py`

Main entry points: [`src/agents.py`](https://github.com/tanbui/job-search-agent/blob/main/src/agents.py) (Specialist agents), [`main.py`](https://github.com/tanbui/job-search-agent/blob/main/main.py) (Crew execution), [`src/tools.py`](https://github.com/tanbui/job-search-agent/blob/main/src/tools.py) (Adzuna tool), [`outputs/.gitkeep`](https://github.com/tanbui/job-search-agent/blob/main/outputs/.gitkeep) (Generated reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_cli["CLI entry point<br/>Python CLI<br/>[main.py]"]
  node_config["Configuration<br/>settings<br/>[config.py]"]
  node_env["Local environment<br/>secrets<br/>[.env.example]"]
end

subgraph group_workflow["CrewAI workflow"]
  node_agents["Specialist agents<br/>CrewAI agents<br/>[agents.py]"]
  node_tasks["Sequential tasks<br/>CrewAI tasks<br/>[tasks.py]"]
  node_crew["Crew execution<br/>CrewAI crew<br/>[main.py]"]
  node_job_search["Job search<br/>pipeline stage<br/>[tasks.py]"]
  node_skills["Skills analysis<br/>pipeline stage<br/>[tasks.py]"]
  node_interview["Interview preparation<br/>pipeline stage<br/>[tasks.py]"]
  node_career["Career advice<br/>pipeline stage<br/>[tasks.py]"]
end

subgraph group_integrations["External boundaries"]
  node_adzuna_tool{{"Adzuna tool<br/>HTTP integration<br/>[tools.py]"}}
  node_adzuna{{"Adzuna API<br/>job listings API"}}
  node_anthropic{{"Anthropic Claude<br/>LLM service"}}
  node_tool_tests["Tool tests<br/>automated tests<br/>[test_tools.py]"]
end

subgraph group_delivery["Report delivery"]
  node_reports["Generated reports<br/>filesystem output<br/>[.gitkeep]"]
  node_example_report["Example report<br/>reference artifact<br/>[example_output.txt]"]
end

node_env -.->|"supplies credentials"| node_config
node_config -->|"startup validation"| node_cli
node_cli -->|"builds"| node_agents
node_cli -->|"builds"| node_tasks
node_agents -->|"assigned to"| node_crew
node_tasks -->|"orchestrated by"| node_crew
node_crew -->|"stage 1"| node_job_search
node_job_search -->|"listings context"| node_skills
node_skills -->|"prior context"| node_interview
node_interview -->|"accumulated context"| node_career
node_agents -->|"search role uses"| node_adzuna_tool
node_adzuna_tool -->|"HTTP requests"| node_adzuna
node_agents -->|"agent reasoning"| node_anthropic
node_career -->|"final advisory content"| node_reports
node_crew -->|"writes aggregate and stages"| node_reports
node_tool_tests -.->|"verifies"| node_adzuna_tool
node_example_report -.->|"illustrates format"| node_reports

click node_cli "https://github.com/tanbui/job-search-agent/blob/main/main.py"
click node_config "https://github.com/tanbui/job-search-agent/blob/main/src/config.py"
click node_env "https://github.com/tanbui/job-search-agent/blob/main/.env.example"
click node_agents "https://github.com/tanbui/job-search-agent/blob/main/src/agents.py"
click node_tasks "https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py"
click node_crew "https://github.com/tanbui/job-search-agent/blob/main/main.py"
click node_job_search "https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py"
click node_skills "https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py"
click node_interview "https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py"
click node_career "https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py"
click node_adzuna_tool "https://github.com/tanbui/job-search-agent/blob/main/src/tools.py"
click node_reports "https://github.com/tanbui/job-search-agent/blob/main/outputs/.gitkeep"
click node_example_report "https://github.com/tanbui/job-search-agent/blob/main/examples/example_output.txt"
click node_tool_tests "https://github.com/tanbui/job-search-agent/blob/main/tests/test_tools.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_cli,node_config,node_env toneBlue
class node_agents,node_tasks,node_crew,node_job_search,node_skills,node_interview,node_career toneAmber
class node_adzuna_tool,node_adzuna,node_anthropic,node_tool_tests toneMint
class node_reports,node_example_report toneRose
```

## Components

### Runtime

- [CLI entry point](https://github.com/tanbui/job-search-agent/blob/main/main.py): Python CLI · Validates startup, runs the crew, and writes reports. · `main.py`
- [Configuration](https://github.com/tanbui/job-search-agent/blob/main/src/config.py): settings · Default query inputs, model choice, and credential loading. · `src/config.py`
- [Local environment](https://github.com/tanbui/job-search-agent/blob/main/.env.example): secrets · Provides Anthropic and Adzuna credentials outside source control. · `.env.example`

### CrewAI workflow

- [Specialist agents](https://github.com/tanbui/job-search-agent/blob/main/src/agents.py): CrewAI agents · Defines search, skills, interview, and career roles. · `src/agents.py`
- [Sequential tasks](https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py): CrewAI tasks · Encodes the dependent four-stage report pipeline. · `src/tasks.py`
- [Crew execution](https://github.com/tanbui/job-search-agent/blob/main/main.py): CrewAI crew · Runs task outputs in sequence as shared downstream context. · `main.py`
- [Job search](https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py): pipeline stage · Retrieves and formats live job listings. · `src/tasks.py`
- [Skills analysis](https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py): pipeline stage · Turns listings into a learning roadmap. · `src/tasks.py`
- [Interview preparation](https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py): pipeline stage · Produces role-specific questions and STAR guidance. · `src/tasks.py`
- [Career advice](https://github.com/tanbui/job-search-agent/blob/main/src/tasks.py): pipeline stage · Produces resume, LinkedIn, and networking advice. · `src/tasks.py`

### External boundaries

- [Adzuna tool](https://github.com/tanbui/job-search-agent/blob/main/src/tools.py): HTTP integration · Contains listing requests, credentials, and error handling. · `src/tools.py`
- **Adzuna API**: job listings API
- **Anthropic Claude**: LLM service · Reasoning service used by all agent roles.
- [Tool tests](https://github.com/tanbui/job-search-agent/blob/main/tests/test_tools.py): automated tests · Focused coverage for the external API boundary. · `tests/test_tools.py`

### Report delivery

- [Generated reports](https://github.com/tanbui/job-search-agent/blob/main/outputs/.gitkeep): filesystem output · Aggregate and stage-specific timestamped text artifacts. · `outputs/.gitkeep`
- [Example report](https://github.com/tanbui/job-search-agent/blob/main/examples/example_output.txt): reference artifact · `examples/example_output.txt`

## Connections

- Local environment → Configuration: supplies credentials
- Configuration → CLI entry point: startup validation
- CLI entry point → Specialist agents: builds
- CLI entry point → Sequential tasks: builds
- Specialist agents → Crew execution: assigned to
- Sequential tasks → Crew execution: orchestrated by
- Crew execution → Job search: stage 1
- Job search → Skills analysis: listings context
- Skills analysis → Interview preparation: prior context
- Interview preparation → Career advice: accumulated context
- Specialist agents → Adzuna tool: search role uses
- Adzuna tool → Adzuna API: HTTP requests
- Specialist agents → Anthropic Claude: agent reasoning
- Career advice → Generated reports: final advisory content
- Crew execution → Generated reports: writes aggregate and stages
- Tool tests → Adzuna tool: verifies
- Example report → Generated reports: illustrates format
