How pr4vndevhubx/rolescout works
Purpose and entry points
rolescout is an agentic job-search assistant: it ingests job listings, compares them with a user resume, prepares truthful tailored materials, tracks applications, and sends daily digests. The backend starts as a FastAPI service at app/main.py; its REST surface is organized in app/api/. The React/Vite dashboard starts from frontend/src/main.tsx and composes the UI in frontend/src/App.tsx.
API, identity, and persistence boundary
Authenticated API routes expose resumes, jobs, matching, tailoring, preferences, applications, and assistant execution. JWT/password security, database initialization, middleware, and scheduling are centralized in app/core/, while persisted domain entities are defined in app/models/db_models.py. Alembic owns schema evolution under alembic/versions/, including ATS and job-experience fields. Postgres/Neon is the system of record; pgvector setup supports vector search.
Resume ingestion and user profile pipeline
Resume upload and processing are handled through app/api/resumes.py, backed by extraction, parsing, normalization, storage, and repository services. The pipeline accepts uploaded resume files, extracts text (with document-format handling), derives structured resume data through an LLM, builds canonical text, and generates embeddings. Relevant boundaries are app/services/text_extraction.py, app/services/resume_parser.py, and app/services/embedding_service.py; raw resume files are PII and are separated through app/services/file_storage.py.
Job scouting and canonical ingestion
The ingestion service searches registered external boards, normalizes source-specific payloads, extracts experience requirements, deduplicates listings, and persists/embed new jobs. Its primary coordinator is app/services/job_ingestion.py; source adapters are behind the source abstraction and registry at app/services/job_sources/base.py and app/services/job_sources/registry.py. Current integrations include Remotive, Arbeitnow, and optional Adzuna, implemented in app/services/job_sources/remotive_source.py, app/services/job_sources/arbeitnow_source.py, and app/services/job_sources/adzuna_source.py.
Matching, ranking, and gap analysis
Matching retrieves semantically close jobs through pgvector, applies user/job hard constraints, calculates skill overlap and blended ranking, then stores candidate match records. The matching stage is decomposed into retrieval (app/services/matching/retrieval.py), deterministic filters (app/services/matching/hard_filters.py), and ranking (app/services/matching/ranker.py). Job vectors are managed by app/services/matching/job_vector_store.py; skill extraction/gap analysis live in app/services/matching/job_skill_extractor.py and app/services/matching/skill_gap.py. ATS-oriented scoring is isolated in app/services/ats/ats_scorer.py.
AI provider and truthful tailoring boundary
All LLM work uses a provider-neutral router with fast/smart task tiers and provider failover. The abstraction and routing layer are app/ai/llm/base.py, app/ai/llm/router.py, and app/ai/llm/registry.py; OpenAI-compatible endpoints support configured providers/local models through app/ai/llm/providers/openai_compatible.py. Tailoring and cover-letter generation use app/services/tailoring_service.py and prompts in app/ai/prompts/tailoring_prompts.py; this is the key truthfulness boundary, intended to constrain output to resume-supported facts and identify unmet requirements as gaps.
Agent execution and daily control flow
The assistant has two paths over the same service layer: interactive chat and deterministic daily execution. The LangGraph-style orchestrator and tool wrappers are in app/agent/orchestrator.py and app/agent/tools.py; agent state/context is held in app/agent/context.py. The scheduled cycle in app/agent/daily_cycle.py performs scout → evaluate/classify → capped tailoring → application preparation → notification. Scheduler integration is centralized in app/core/scheduler.py, while email/digest delivery and deduplication are handled by app/services/notification_service.py. Agent runs/actions provide the shared audit trail for chat, cron, and manual runs.
Dashboard and external infrastructure
The frontend is a client for the authenticated API, with feature panels for jobs, matches, uploads, preferences, and assistant activity under frontend/src/components/. It communicates through frontend/src/api.ts. Material external dependencies are Neon/Postgres with pgvector, local sentence-transformers embeddings, configurable LLM providers (including Ollama), job-board APIs, optional SMTP, and optional Tesseract OCR.
Main entry points: daily_cycle.py Daily execution cycle · resumes.py Resume processing · job_ingestion.py Job ingestion · retrieval.py Match pipeline
Components 21
Dashboard
- React dashboard
frontend/src/App.tsx - Authenticated API client
frontend/src/api.ts
API & Core
- FastAPI service
app/main.py - REST route surface · Resumes, jobs, matches, tailoring, preferences, applications, and assistant execution.
- Identity & scheduler · Centralizes JWT/password security, database setup, middleware, and scheduled execution.
- Domain models
app/models/db_models.py
Job & Resume Intelligence
- Resume processing · Extracts, parses, normalizes, stores, and embeds uploaded resumes.
app/api/resumes.py - Resume parser
app/services/resume_parser.py - PII file storage · Separates raw uploaded resume files from domain data.
app/services/file_storage.py - Job ingestion · Normalizes, deduplicates, persists, and embeds external listings.
app/services/job_ingestion.py - Job source registry · Registers Remotive, Arbeitnow, and optional Adzuna sources.
app/services/job_sources/registry.py - Match pipeline · Retrieves vector candidates, applies hard constraints, ranks, and stores matches.
app/services/matching/retrieval.py - Ranking & skill gaps · Combines deterministic ranking, skill overlap, gaps, and ATS scoring.
app/services/matching/ranker.py
AI & Agent
- LLM router · Selects fast/smart tiers and fails over across configured providers.
app/ai/llm/router.py - Truthful tailoring · Produces resume-supported tailored materials and flags unmet requirements.
app/services/tailoring_service.py - Assistant orchestrator · Interactive agent path over shared tools and services.
app/agent/orchestrator.py - Daily execution cycle · Scouts, evaluates, tailors, prepares applications, and notifies.
app/agent/daily_cycle.py
Data & External Systems
- Neon Postgres + pgvector · Stores domain entities, audit records, and vector-search data.
- Job-board APIs
- LLM providers · OpenAI-compatible providers and local models such as Ollama.
app/ai/llm/providers/openai_compatible.py - Digest delivery · Delivers and deduplicates email digests through optional SMTP.
app/services/notification_service.py
Connections 27
- React dashboard → Authenticated API client: uses
- Authenticated API client → FastAPI service: authenticated requests
- FastAPI service → REST route surface: mounts
- FastAPI service → Identity & scheduler: initializes
- REST route surface → Resume processing: resume uploads
- REST route surface → Job ingestion: job operations
- REST route surface → Match pipeline: match requests
- REST route surface → Truthful tailoring: tailoring requests
- REST route surface → Assistant orchestrator: assistant execution
- Resume processing → PII file storage: stores raw files
- Resume processing → Resume parser: structures extracted text
- Resume parser → LLM router: structured extraction
- Resume processing → Neon Postgres + pgvector: stores profile and vectors
- Job ingestion → Job source registry: selects adapters
- Job source registry → Job-board APIs: fetches listings
- Job ingestion → Neon Postgres + pgvector: persists jobs and embeddings
- Match pipeline → Neon Postgres + pgvector: pgvector retrieval and match records
- Match pipeline → Ranking & skill gaps: candidate evaluation
- Truthful tailoring → LLM router: constrained generation
- LLM router → LLM providers: routes requests
- Identity & scheduler → Daily execution cycle: scheduled trigger
- Daily execution cycle → Job ingestion: scout
- Daily execution cycle → Match pipeline: evaluate
- Daily execution cycle → Truthful tailoring: capped tailoring
- Daily execution cycle → Digest delivery: send digest
- Assistant orchestrator → Neon Postgres + pgvector: run and action audit trail
- Digest delivery → Neon Postgres + pgvector: delivery deduplication