Content Enrichment Wizard
Relevant source files
The following files were used as context for generating this wiki page:
The Content Enrichment Wizard is an AI-powered feature designed to help users improve their master resume. It analyzes the resume for weak or generic descriptions within the "Experience" and "Projects" sections, generates targeted questions to gather more specific details from the user, and then uses the answers to create new, impactful bullet points.
A key design principle of this feature is that it is additive. The wizard does not replace the user's original content; instead, it appends the newly generated, enhanced bullet points to the existing descriptions. This preserves the user's original work while augmenting it with AI-generated improvements. The process is constrained to a maximum of six questions to ensure a quick and focused user experience.
Sources: AGENTS.md, apps/backend/app/prompts/enrichment.py:59-62
Overall Workflow
The wizard guides the user through a multi-step process, beginning with analysis and culminating in the application of enhancements to their resume.
This diagram illustrates the high-level flow of the Content Enrichment Wizard from the user's perspective.
Backend Architecture
The backend is responsible for all AI interactions and data persistence. It exposes a set of API endpoints that the frontend consumes to drive the wizard.
Sources: apps/backend/app/routers/enrichment.py, apps/backend/app/prompts/enrichment.py
API Endpoints
The enrichment feature is served by three main API endpoints defined in the enrichment router.
| Method | Path | Description |
|---|---|---|
POST | /enrichment/analyze/{resume_id} | Analyzes a resume, identifies weak items, and generates clarifying questions for the user. |
POST | /enrichment/enhance | Takes user answers and generates new, enhanced bullet points for the identified resume items. |
POST | /enrichment/apply/{resume_id} | Applies the generated enhancements by adding the new bullet points to the master resume in the database. |
Sources: apps/backend/app/routers/enrichment.py:17-299, AGENTS.md
AI Prompts
The core AI logic is driven by two distinct prompts that instruct the LLM on how to perform analysis and enhancement.
1. Analysis Prompt (ANALYZE_RESUME_PROMPT)
This prompt instructs the AI to act as a professional resume analyst. It identifies weak descriptions in the "Experience" and "Projects" sections based on indicators like generic phrases, missing metrics, and passive voice. A crucial rule is to generate a maximum of 6 questions in total to avoid overwhelming the user. If the resume is already strong, the AI is instructed to return empty arrays.
Sources: apps/backend/app/prompts/enrichment.py:3-56
2. Enhancement Prompt (ENHANCE_DESCRIPTION_PROMPT)
This prompt instructs the AI to act as a professional resume writer. Its task is to ADD new, action-oriented, and quantified bullet points based on the user's answers. It is explicitly told not to rewrite or replace the existing bullets, reinforcing the additive nature of the feature.
Sources: apps/backend/app/prompts/enrichment.py:58-91
Sequence of Operations
The following diagram shows the sequence of interactions between the frontend, backend, and the LLM during the analysis and enhancement phases.
This sequence diagram details the API calls and internal logic for the analysis and enhancement steps.
Frontend Architecture
The frontend implementation is centered around the useEnrichmentWizard custom hook, which acts as a state machine for the entire user-facing workflow.
Sources: apps/frontend/hooks/use-enrichment-wizard.ts
State Management (useEnrichmentWizard)
The useEnrichmentWizard hook uses React's useReducer to manage the complex state transitions of the wizard. It defines a set of possible states (WizardStep) and actions that trigger transitions between them.
Wizard States
The wizard can be in one of the following states, managed by the step property in WizardState.
| State | Description |
|---|---|
idle | The initial state before the process begins. |
analyzing | The resume is being analyzed by the backend. |
questions | Questions are displayed to the user for input. |
generating | New bullet points are being generated based on user answers. |
preview | The generated enhancements are shown to the user for approval. |
applying | The approved enhancements are being saved to the database. |
complete | The process has finished successfully. |
error | An error occurred at some point in the flow. |
no-improvements | The analysis found no areas for improvement. |
Sources: apps/frontend/hooks/use-enrichment-wizard.ts:13-25, apps/frontend/hooks/use-enrichment-wizard.ts:70-151
State Machine Diagram
This diagram visualizes the state transitions managed by the wizardReducer.
Data Models
The frontend and backend communicate using a set of strictly-defined data models. These are defined as Pydantic schemas in the backend and TypeScript interfaces in the frontend.
Core Data Structures
| Model/Interface | Fields | Description |
|---|---|---|
EnrichmentItem | item_id, item_type, title, subtitle, current_description, weakness_reason | Represents a resume item (experience or project) identified for enhancement. |
EnrichmentQuestion | question_id, item_id, question, placeholder | Represents a single question generated by the AI to get more details about an EnrichmentItem. |
AnswerInput | question_id, answer | A user's answer to a specific question. |
EnhancedDescription | item_id, item_type, title, original_description, enhanced_description | Contains the newly generated bullet points (enhanced_description) to be added to an item. |
Sources: apps/frontend/lib/api/enrichment.ts:7-39, apps/backend/app/schemas/enrichment.py
API Response Schemas
The following diagram shows the relationship between the main response schemas.
This ER diagram illustrates the composition of the API responses for analysis and enhancement previews.