Skip to main content

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
It uses this context to provide personalized, relevant suggestions specific to your background.

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
GEMINI_API_KEY=your_gemini_api_key_here
1

Get Gemini API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new API key
  4. Copy the key
2

Add to environment

Create or update .env.local in your project root:
GEMINI_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3

Restart development server

Restart your Next.js server to load the new environment variable:
pnpm dev

API Endpoint

The AI assistant is powered by a Next.js API route at /api/chat.

Request Format

POST /api/chat
Content-Type: application/json

{
  "messages": [
    {
      "role": "user",
      "content": "Analyze my CV and suggest improvements"
    }
  ],
  "cvData": {
    "personalInfo": { ... },
    "experience": [ ... ],
    "education": [ ... ],
    // ... other CV sections
  }
}

Response Format

{
  "role": "assistant",
  "content": "Based on your CV, here are my suggestions..."
}

Rate Limiting

  • 20 requests per minute per IP address
  • Rate limit window: 60 seconds
  • Returns 429 Too Many Requests when exceeded
Rate limits apply per IP address. In production, consider implementing user-based rate limiting.

Component Integration

The AI Assistant is implemented in components/ai/AIChatbot.tsx and uses:
  • useAuth() - Check if user is authenticated
  • useChatbotAccess() - Verify chatbot is enabled
  • useFormContext<CVData>() - Access current CV data

Usage in Editor

import { AIChatbot } from '@/components/ai/AIChatbot';

export default function Editor() {
  return (
    <FormProvider {...methods}>
      {/* Other editor components */}
      <AIChatbot />
    </FormProvider>
  );
}
The chatbot appears as a draggable floating panel in the editor interface.

Access Control

The AI Assistant is only available to:
  • Authenticated users (signed in with Firebase)
  • When GEMINI_API_KEY is configured
Use the useChatbotAccess hook to check availability:
import { useChatbotAccess } from '@/hooks/useChatbotAccess';

function MyComponent() {
  const { isChatbotEnabled, loading } = useChatbotAccess();
  
  if (!isChatbotEnabled) {
    return <div>AI Assistant not available</div>;
  }
  
  return <AIChatbot />;
}

System Prompt

The assistant is configured with a professional system prompt that instructs it to:
  1. Act as an expert CV consultant and career coach
  2. Analyze content quality (spelling, grammar, action verbs, impact)
  3. Check completeness (missing sections, empty fields)
  4. Maintain professional tone
  5. Provide specific, actionable advice
  6. Generate high-quality professional text
  7. Never fabricate information about the user

Error Handling

The API route handles various error cases:
ErrorStatus CodeDescription
Invalid JSON400Request body is not valid JSON
Invalid request400Missing or invalid messages/cvData
Rate limit exceeded429Too many requests in time window
API key not configured500GEMINI_API_KEY environment variable missing
Service unavailable503Gemini API authentication error

Best Practices

Instead of “Improve my CV”, ask “How can I make my software engineer experience more impactful?”
The assistant works best when you have content in your CV. Fill in at least basic information before asking for help.
The AI provides suggestions, but you should review and adapt them to your specific situation and voice.
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

Build docs developers (and LLMs) love