How mindk-scrap/resumeranker works
Project Type and Purpose
• ResumeRanker is a backend‐only, production‐grade FastAPI service.
• It exposes REST endpoints for extracting ranking criteria from job descriptions and scoring resumes using CrewAI agents and the Groq LLM.
• No persistent database is used; results are returned directly as JSON or CSV.
File Structure Analysis
• Top‐level:
● app/ – FastAPI application
● requirements.txt, .env.example – dependency and configuration
• app/:
● main.py – application instantiation, middleware, router inclusion
● logger.py – centralized logging configuration
● crews/ – CrewAI agent definitions and crew configurations (YAML/JSON)
● models/ – Pydantic schema definitions for request/response models
● routes/ – three routers (criteria.py, scoring.py, pipeline.py) defining endpoints
● services/ – business logic modules: document processing, criteria extraction, resume scoring, name extraction, result formatting, crew manager
• Config:
● app/crews/config/*.yaml/.json – agent and task definitions for CrewAI
• No DB: file‐based in/out and external APIs only.
README Insights
• Technical stack: Python 3.11, FastAPI, Pydantic, CrewAI, Groq API, Uvicorn
• Features: PDF/DOCX ingestion, pattern matching for names, CSV export, Swagger UI
• Workflow: standalone endpoints or a combined “/rank-resumes-from-job” pipeline
a. Main Components
1. API Client (UI or HTTP client / Swagger)
2. FastAPI Application
• Routes Layer
• Services Layer
• CrewAI Manager & Agent Config
• Pydantic Models
• Logger
3. External Services
• Groq LLM Inference API
• CrewAI agent framework (runs locally/in-process)
4. Output Artifact
• JSON or CSV response served back to client
b. Relationships and Data Flows
1. Client → FastAPI Routes (POST /extract-criteria, /score-resumes, /rank-resumes-from-job)
2. Routes → Services (document_processor → criteria_extractor → crew_manager → resume_scorer → result_formatter → name_extractor)
3. Services ↔ External APIs (CrewAI, Groq)
4. Services → Response (JSON criteria list or CSV bytes) → Client
c. Architectural Patterns
• Layered architecture (Routes → Services → External integrations)
• Configuration-driven agent orchestration (CrewAI)
• Schema validation (Pydantic)
• Stateless microservice (no local DB)
d. Key Technologies & Frameworks
• FastAPI (uvicorn ASGI server)
• Pydantic schemas (app/models/schemas.py)
• CrewAI (app/crews/config & resume_ranker_crew.py)
• Groq LLM API (configured via .env)
• PDF/DOCX processing libraries in document_processor
Detailed Elements
• Routes Layer:
• /extract-criteria → CriteriaExtractorService
• /score-resumes → ResumeScorerService
• /rank-resumes-from-job → orchestrator combining both
• Services Layer:
• DocumentProcessorService (PDF/DOCX → text)
• CriteriaExtractorService (text → list of criteria via Groq/CrewAI)
• ResumeScorerService (criteria + resumes → scores via Groq/CrewAI)
• NameExtractorService (text → candidate name)
• ResultFormatterService (scores + names → CSV)
• CrewAI Integration:
• Configuration files (agents.yaml, tasks.yaml)
• CrewManager orchestrates agent calls
• External LLM:
• Groq API (Key via .env)
• Logging & Validation:
• Logger module capturing all service interactions
• Pydantic schemas validating request bodies and responses