How menacehecker/huntai works
1. What this repo is
- HuntAI is a daily job-opportunity pipeline, not a general app.
- Its main purpose is to ingest jobs, rank them against a profile, pick a best option, and send a short email brief.
2. Primary runtime boundary
- The documented production path is a FastAPI backend exposed locally and called by n8n on a schedule.
- External services in the loop are ngrok for exposure and Gmail for delivery.
3. Entry points
- main.py is likely the top-level launcher.
- api/app.py is the API layer that serves the /run-hunt endpoint mentioned in the README.
- That endpoint is the handoff point between the automation workflow and the internal job-evaluation pipeline.
4. Workflow orchestration
- workflows/pipeline.py appears to coordinate the end-to-end run.
- The pipeline likely pulls jobs, filters them, scores them, chooses a recommendation, and prepares the email payload.
- This is the main “glue” layer separating request handling from business logic.
5. Core business services
- services/ holds the functional stages of the system:
- source_service.py for collecting jobs from configured sources
- filter_service.py for applying hard constraints
- dedupe_service.py for removing repeats
- scoring_service.py for ranking jobs
- tailoring_service.py for generating role-specific framing
- profile_service.py for reading the user profile
- job_service.py for job-level orchestration
- notification_service.py for email output
- This is the main domain boundary in the repo.
6. Data model and persistence
- models/job.py defines the job entity used across the pipeline.
- Persistent state is split across a few lightweight stores:
- jobs.db for structured job history/state
- seen_jobs.json for duplicate suppression
- data/ JSON files for profile, sources, and experience knowledge
- This suggests a small local-state architecture rather than a central database service.
7. Configuration and knowledge inputs
- data/profile.json is the candidate profile used for matching.
- data/job_sources.json defines where jobs are pulled from.
- data/experience_bank.json likely powers tailoring and “how to position” output.
- .env.example indicates secrets and runtime config are environment-driven.
8. Output generation and email
- The final artifact is an “opportunity brief” email containing top jobs, one recommended role, score/verdict, and a tailored rationale.
- services/notification_service.py is the boundary where internal results become an external email message.
- The README indicates the workflow either sends a detailed brief or a no-match update.
9. Agent-related layers
- agents/ contains discovery_agent.py and eligibility_agent.py, which look like specialized reasoning components for finding and qualifying opportunities.
- adk_agents/huntai_team/ contains a more explicit multi-agent setup: coordinator, scout, fit, positioning, and action agents.
- This looks like an advanced/experimental agent architecture alongside the simpler service pipeline.
10. State and deduplication concerns
- The repository explicitly calls out duplicate jobs as a known limitation.
- That lines up with dedupe_service.py and seen_jobs.json, which are likely the first-line controls for repeated listings.
- There is no sign of a heavyweight job-tracking backend yet; state appears intentionally lightweight.
11. System flow to diagram
- External scheduler in n8n triggers FastAPI.
- API hands off to the workflow pipeline.
- Pipeline consults profile/source data, fetches jobs, filters/dedupes/scores them, and optionally tailors the top pick.
- Notification service sends the result to Gmail.
- Local files and DBs persist profile, history, and seen-job state between runs.
12. Architecture takeaway
- This is a compact, file-backed decision pipeline with a clear separation between orchestration, domain services, and notification output.
- The main architectural boundary is between the scheduled external workflow and the internal job-ranking engine.
Main entry points: job_service.py Job service · coordinator_agent.py Coordinator · source_service.py Sources · app.py API app
Components 26
Runtime & entrypoints
External scheduler and API entry layer for launching the hunt pipeline.
Orchestration
End-to-end pipeline coordination and job-level control flow.
- Pipeline · Coordinates the end-to-end job hunt run.
workflows/pipeline.py
Domain services
Core job ingestion, filtering, scoring, tailoring, and notification logic.
- Job service · Higher-level job workflow coordination across the service stages.
services/job_service.py - Sources · Collects jobs from configured sources.
services/source_service.py - Filter · Applies hard eligibility constraints to candidate jobs.
services/filter_service.py - Dedupe · Removes repeated jobs using local seen-job state.
services/dedupe_service.py - Scoring · Ranks jobs against the candidate profile and preferences.
services/scoring_service.py - Tailoring · Generates role-specific framing and rationale for the best match.
services/tailoring_service.py - Profile · Loads the candidate profile used for matching and tailoring.
services/profile_service.py - Notify · Formats and sends the opportunity brief via email.
services/notification_service.py - Job model · Shared job entity used across the pipeline.
models/job.py
State & data
Local persistence and JSON-backed knowledge inputs.
- Jobs DB · Structured local store for job history and state.
jobs.db - Seen jobs · JSON record of previously processed jobs.
seen_jobs.json - Profile data · Candidate profile used for ranking and tailoring.
data/profile.json - Sources data · Job source definitions for ingestion.
data/job_sources.json - Experience bank · Reference material used to tailor role positioning.
data/experience_bank.json
Agent systems
Alternative agent-based components and multi-agent team setup.
- Discovery agent · Specialized agent for finding opportunities.
agents/discovery_agent.py - Eligibility agent · Specialized agent for qualifying opportunities.
agents/eligibility_agent.py - Coordinator · Coordinates the huntai team agent workflow.
adk_agents/huntai_team/coordinator_agent.py - Scout · Finds candidate opportunities in the team setup.
adk_agents/huntai_team/scout_agent.py - Fit · Evaluates role fit in the team setup.
adk_agents/huntai_team/fit_agent.py - Positioning · Shapes how the candidate should be positioned.
adk_agents/huntai_team/positioning_agent.py - Action · Turns the decision into a concrete next action.
adk_agents/huntai_team/action_agent.py
Connections 26
- n8n → ngrok: calls exposed API · Scheduled automation reaches the locally exposed service.
- ngrok → API app: routes requests · Tunnel forwards traffic to the FastAPI app.
- Main → API app: starts app · Launcher initializes the API runtime.
- API app → Pipeline: run-hunt · API hands off the request to the workflow pipeline.
- Pipeline → Job service: orchestrates · Pipeline delegates the main job hunt flow.
- Job service → Profile: loads profile · Job workflow retrieves candidate context.
- Profile → Profile data: reads · Profile service consumes the profile JSON.
- Job service → Sources: fetches jobs · Job workflow requests candidate opportunities.
- Sources → Sources data: reads · Source definitions drive ingestion.
- Sources → Job model: creates jobs · Ingested records are normalized into job entities.
- Job service → Filter: applies filters · Hard constraints are applied before ranking.
- Job service → Dedupe: dedupes · Repeated listings are removed using seen-job state.
- Dedupe → Seen jobs: reads/writes · Duplicate suppression depends on local JSON state.
- Job service → Scoring: scores · Remaining jobs are ranked against the profile.
- Scoring → Job model: evaluates · Scoring operates on normalized job entities.
- Job service → Tailoring: tailors brief · Top pick is framed for a concise opportunity brief.
- Tailoring → Experience bank: reads · Tailoring uses experience knowledge for positioning.
- Job service → Notify: sends brief · Final result is rendered into an email update.
- Notify → Jobs DB: stores history · Notification flow can persist run outcomes and history.
- Job service → Jobs DB: updates state · Pipeline state is tracked in the local job database.
- Job service → Discovery agent: optional discovery · Alternative agent path for opportunity finding.
- Job service → Eligibility agent: optional qualification · Alternative agent path for eligibility reasoning.
- Coordinator → Scout: coordinates · Coordinator delegates search work to scout.
- Coordinator → Fit: coordinates · Coordinator delegates fit evaluation.
- Coordinator → Positioning: coordinates · Coordinator delegates positioning work.
- Coordinator → Action: coordinates · Coordinator delegates action selection.