AI Assistant
CV Builder includes an AI-powered assistant that provides intelligent suggestions to improve your resume content, powered by Google Gemini AI.Overview
The AI Assistant analyzes your CV data in real-time and provides:- Comprehensive CV reviews
- Content improvement suggestions
- Professional writing assistance
- Skill recommendations based on your experience
- Profile summary enhancement
The AI Assistant requires a Google Gemini API key to function. For authenticated users only.
Features
Contextual Analysis
The assistant has access to your complete CV data including:- Personal information
- Work experience
- Education
- Projects
- Skills
- Achievements
Quick Actions
Pre-configured quick actions for common tasks:Full CV Analysis
Get a comprehensive review of your entire CV with actionable improvements
Enhance Summary
Receive suggestions to make your profile summary more impactful
Skill Suggestions
Discover relevant skills to highlight based on your experience
Conversational Interface
Ask the assistant anything about your CV:- “How can I improve my work experience descriptions?”
- “What action verbs should I use?”
- “Is my CV ATS-friendly?”
- “Write a professional summary for me”
- “Suggest improvements for my [section]“
Setup
Environment Configuration
Add your Google Gemini API key to.env.local:
.env.local
Get Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the key
API Endpoint
The AI assistant is powered by a Next.js API route at/api/chat.
Request Format
Response Format
Rate Limiting
- 20 requests per minute per IP address
- Rate limit window: 60 seconds
- Returns
429 Too Many Requestswhen exceeded
Component Integration
The AI Assistant is implemented incomponents/ai/AIChatbot.tsx and uses:
useAuth()- Check if user is authenticateduseChatbotAccess()- Verify chatbot is enableduseFormContext<CVData>()- Access current CV data
Usage in Editor
Access Control
The AI Assistant is only available to:- Authenticated users (signed in with Firebase)
- When
GEMINI_API_KEYis configured
useChatbotAccess hook to check availability:
System Prompt
The assistant is configured with a professional system prompt that instructs it to:- Act as an expert CV consultant and career coach
- Analyze content quality (spelling, grammar, action verbs, impact)
- Check completeness (missing sections, empty fields)
- Maintain professional tone
- Provide specific, actionable advice
- Generate high-quality professional text
- Never fabricate information about the user
Error Handling
The API route handles various error cases:| Error | Status Code | Description |
|---|---|---|
| Invalid JSON | 400 | Request body is not valid JSON |
| Invalid request | 400 | Missing or invalid messages/cvData |
| Rate limit exceeded | 429 | Too many requests in time window |
| API key not configured | 500 | GEMINI_API_KEY environment variable missing |
| Service unavailable | 503 | Gemini API authentication error |
Best Practices
Be specific in your questions
Be specific in your questions
Instead of “Improve my CV”, ask “How can I make my software engineer experience more impactful?”
Provide context
Provide context
The assistant works best when you have content in your CV. Fill in at least basic information before asking for help.
Review suggestions critically
Review suggestions critically
The AI provides suggestions, but you should review and adapt them to your specific situation and voice.
Use quick actions for common tasks
Use quick actions for common tasks
Quick actions are pre-configured for the most common CV improvement tasks.
Limitations
- Requires internet connectivity
- Subject to Gemini API rate limits and quotas
- Maximum message length: 10,000 characters
- Chat history limited to last 20 messages
- Maximum response tokens: 1,000
Privacy & Security
- CV data is sent to Google Gemini API for processing
- No CV data is stored on Google’s servers permanently
- Messages are not persisted between sessions
- Rate limiting prevents abuse
- User authentication required for access
For privacy-conscious users, consider using the AI Assistant sparingly or only with anonymized data.
See Also
- API Chat Route - Component architecture
- Authentication - User authentication setup
- Firebase Setup - Environment configuration