How huuthonguyen76/job-advert-assigment works
Project Type and Purpose
• This project is an AI-powered tool that processes various document formats (PDF, DOCX, images), extracts key job advertisement details, and generates optimized job adverts with custom visuals.
• It’s a full-stack application that features both a backend processing pipeline (using AI agents and extractors) and a frontend web interface (implemented via Gradio) for interaction with end users.
Analyzing the File Structure and What It Implies
• Top-level directories and files like Dockerfile, Makefile, pyproject.toml, and README.md indicate that the project is meant to be containerized and easily deployed.
• Under the src folder, you see specialized subdirectories:
• src/agent: Contains AI agent implementations (e.g., extraction, image generation, post-processing, template generation) which strongly suggests there’s an “agent workflow” orchestrated by Langgraph/Langchain in the system.
• src/app: Contains the main application, likely the entry point for the web UI.
• src/bucket: Likely responsible for shared aspects such as logging, configuration, and handling of local storage or file operations.
• src/common: Contains shared utility functions (in this case, image utilities) that support the core functionalities.
• src/component/job_advert_generation: Focuses on components that generate job advert specifications—likely integrating document information extraction and managing the workflow.
• src/model: Contains data models (or settings models) which define structured data flowing through the system.
• The file tree also shows a test_data folder, suggesting input samples for testing the pipeline.
Key System Components
a. Frontend Web Interface:
• Gradio UI which allows users to upload various job posting formats, view results, and download generated outputs.
b. Input Processing Module:
• Handles multi-format document input (PDF, DOCX, images) and conversion (OCR for images).
c. Information Extraction Module:
• Applies AI and LLM-based processing to extract structured data (company info, job details, key requirements etc.).
• This module might be represented via components under the agent and component directories.
d. Content Generation Module:
• Uses Gemini (LLM) along with Langchain/Langgraph agents to produce the optimized textual job adverts and image-based ad templates.
• Could be decomposed into stages (template generation, image generation, and post-processing) as shown in src/agent.
e. Data/Configuration and Integration:
• Includes bucket handling for logging, settings, and other shared functionality.
• The data models in src/model also feed into the workflow.
f. External Technologies:
• Integration with Gemini’s API for LLM and hints to external APIs (Bannerbear, Predis.ai) in exploratory comments, even if not fully integrated.
Relationships and Interactions
• The user interacts first with the Web Interface.
• Uploaded job advert documents are passed into the Input Processing component, which handles OCR and data extraction.
• The processed information is then fed into the Information Extraction component (internally orchestrated by agents) to generate structured data.
• Structured information flows to the Content Generation module where:
• Optimized text is generated using Gemini.
• Visual assets and ad templates are processed and integrated.
• The final output is served back to the web interface for user review/download.
• Under the hood, various shared utilities (from bucket, common, model) support data management and configuration.
Architectural Patterns and Design Principles
• Modular design: Clearly separated directories denote separation of concerns (AI agents, app UI, utility libraries).
• Pipeline/Workflow pattern: The sequential steps from input → extraction → content generation → output are clearly visible.
• Agent-based processing: The use of Langchain and Langgraph among different agent implementations highlights a decoupled, multi-stage processing architecture.