How gaurav-kumar98/cvinsight works
Project Type and Purpose
• This is an open-source, Python-based resume analysis tool with a plugin-based architecture.
• Purpose: Ingest PDF/DOCX resumes, extract structured data (profile, skills, education, experience, years of experience) via LLMs (Google’s Gemini), and emit JSON outputs while tracking token usage and logging.
File Structure Analysis
• Top-Level Scripts:
• main.py – CLI entry point
• resume_processor.py – Orchestrates resume processing
• llm_service.py – Wraps LLM API calls
• Configuration & Constants:
• config.py / .env – Environment and runtime parameters
• constants.py – Shared constants
• Plugin Subsystems:
• base_plugins/ – Abstract BasePlugin and built-in extractors
• custom_plugins/ – User-provided plugins extending BasePlugin
• plugins/ – Loader, registry, and plugin config
• Utilities: utils/ – File I/O, cleanup, date parsing, logging helpers
• Models: models/ – Resume and plugin data schemas
• Documentation: docs/wiki/ – Design, usage, and extension guides
• Resumes/ – Sample inputs
• Results & Logs (configured at runtime)
Key Architectural Insights from README
• Plugin Manager dynamically discovers and loads all plugins (both built-in and custom)
• Concurrent processing: resumes are processed in parallel across extractors
• LLM interaction is centralized via llm_service.py
• Token usage is tracked per plugin and logged separately, with rotation and retention policies
Components
a. Input Layer
• Resume Files (PDF/DOCX) in Resumes/ folder
• Configuration (.env, config.py)
b. Orchestration Layer
• CLI main.py
• ResumeProcessor
• PluginManager / plugins.loader
c. Processing Layer
• BasePlugin Implementations (Profile, Skills, Education, Experience, YoE)
• CustomPlugins (keyword_matcher, etc.)
• llm_service (handles REST/gRPC calls to Gemini LLM)
d. Data & Storage Layer
• JSON Results Directory
• Logs Directory (token usage logs, application logs)
• Models for structured data (models/resume_models.py)
e. Utilities & Support
• utils for cleanup, file operations, logging, date parsing
f. External Services
• Google Gemini LLM API
Relationships and Interactions
• main.py → ResumeProcessor triggers processing for each resume
• ResumeProcessor → PluginManager loads plugins; for each plugin:
• Plugin → llm_service (synchronous or async API call)
• llm_service → External LLM API → llm_service → Plugin
• Plugin outputs → ResumeProcessor aggregates into final JSON
• ResumeProcessor writes to Results/ and emits token usage to Logs/
• Utility modules are used at various stages (file reading, logging, cleanup)
Architectural Patterns and Design Principles
• Plugin Pattern: Decouples core orchestration from extractors
• Dependency Injection: Config and constants injected into services
• Concurrency: Parallel execution of plugins to improve throughput
• Single Responsibility: Separate modules for orchestration, LLM interaction, file I/O, logging
• Config-Driven: .env and config.py drive runtime behavior
Technologies, Frameworks, and Libraries
• Python 3.x
• Google Gemini LLM (via REST/gRPC)
• python-docx (for DOCX parsing), pdfminer or similar (for PDF)
• Standard logging module with rotation handlers
• argparse or click for CLI
• concurrent.futures or asyncio for parallelism