Overview
The Gemini AI integration provides:- Smart Job Matching: AI-powered compatibility scores with detailed strengths and weaknesses analysis
- CV Parsing: Automatic extraction of structured information from uploaded CVs
- Cover Letter Generation: Tailored cover letters based on your profile and job requirements
- CV Generation: Professional CVs customized for specific job applications
- Intelligent Caching: Optimized API usage with response caching and request deduplication
Getting Your API Key
Vega AI requires a Gemini API key to function. Google offers generous free tier access:Visit Google AI Studio
Go to Google AI Studio to create your API key.
Create API Key
Click “Create API Key” and select a Google Cloud project (or create a new one).
The free tier includes generous quotas suitable for personal use. See Google’s pricing page for details.
Configuration
Self-Hosted Setup
For self-hosted deployments, configure the Gemini API key through environment variables:Using Docker Secrets (Production)
For production deployments, use Docker secrets to securely manage your API key:docker-compose.yml
The
_FILE suffix tells Vega AI to read the value from a file instead of directly from the environment variable. This is more secure for sensitive data.AI Features
Job Matching & Analysis
The AI analyzes your profile against job requirements to provide: Match Score: 0-100 compatibility rating based on:- Work experience relevance and duration
- Skills alignment with job requirements
- Education background (weighted by experience level)
- Transferable skills and related technologies
- Strengths: Your standout qualifications for this role
- Weaknesses: Areas where you may need improvement
- Highlights: Key selling points to emphasize
- Feedback: Actionable recommendations for your application
The AI uses experience-based evaluation: candidates with 2+ years of experience are evaluated primarily on work history, while entry-level candidates (less than 2 years) have education weighted more heavily.
CV Parsing
Automatically extracts structured information from uploaded CVs:- Personal Information: Name, email, phone, location, professional title
- Work Experience: Company, job title, dates, location, responsibilities
- Education: Institution, degree, field of study, dates
- Certifications: Name, issuing organization, dates, credential details
- Skills: List of technical and professional skills
- Rejects non-CV documents (police reports, medical records, etc.)
- Ensures extracted data is accurate and properly formatted
- Handles various CV formats and layouts
Cover Letter Generation
Generates tailored cover letters based on:- Your professional profile (experience, education, skills)
- Job description and requirements
- Company information
- Your career goals and motivations
- Professional tone and structure
- Highlights relevant experience and skills
- Addresses specific job requirements
- 150-250 word length (customizable)
- Plain text format for easy copying
CV Generation
Creates professional CVs customized for specific job applications:- Intelligent Filtering: Only includes skills directly relevant to the job
- Achievement-Focused: Transforms responsibilities into impactful statements
- Contextual Bullet Points: 3-5 relevant points per role based on job requirements
- Professional Formatting: Properly formatted dates, locations, and sections
- Honest Presentation: Uses only your actual experience, never fabricates data
Advanced Configuration
Model Selection
Vega AI uses different Gemini models optimized for specific tasks:gemini-2.5-flash: Fast, cost-effective for most tasks (recommended)gemini-2.5-pro: Advanced model for complex analysis (higher cost)
Caching & Optimization
Vega AI includes built-in optimizations to reduce API usage: Response Caching:- Caches AI responses for 60 seconds by default
- Reduces redundant API calls for similar requests
- Automatically enabled for job matching and CV parsing
- Prevents duplicate concurrent requests
- Shares responses among simultaneous identical requests
- Improves performance under load
Temperature & Creativity
The AI uses optimized temperature settings for each task:- CV Parsing: 0.1 (low) - Consistent, accurate extraction
- Job Analysis: 0.3 (low-medium) - Objective evaluation
- Cover Letters: 0.4 (medium) - Balanced creativity and professionalism
- CV Generation: 0.4 (medium) - Professional while tailored
These values are automatically optimized and don’t need manual configuration.
API Usage & Quotas
Free Tier Limits
Google’s Gemini API free tier includes:- 15 RPM (requests per minute)
- 1 million TPM (tokens per minute)
- 1,500 RPD (requests per day)
Cloud Mode Quotas
If using Vega AI in cloud mode (https://vega.benidevo.com):- 10 AI analyses per month (free tier)
- Unlimited job tracking and browsing
- Admin users have unlimited quotas
Self-hosted instances have unlimited quotas by default, limited only by your Gemini API key limits.
Monitoring Usage
For self-hosted instances, monitor your Gemini API usage:- Visit Google AI Studio
- Check your API usage dashboard
- Set up billing alerts if needed
Implementation Details
Architecture
The Gemini integration is structured as:Request Flow
Error Handling
The integration includes robust error handling:- Automatic Retries: Up to 3 retries with exponential backoff
- Circuit Breaking: Prevents cascading failures
- Graceful Degradation: Fallback to default values when appropriate
- Detailed Logging: Comprehensive error messages for debugging
Code Example
Here’s how the Gemini client is initialized:internal/ai/llm/gemini/client.go
Troubleshooting
API Key Not Working
Problem: “Invalid API key” or authentication errors. Solutions:- Verify your API key is correct (no extra spaces or characters)
- Check that your API key is enabled in Google AI Studio
- Ensure your Google Cloud project has the Gemini API enabled
- Verify the API key hasn’t expired or been revoked
Rate Limit Errors
Problem: “Rate limit exceeded” or 429 errors. Solutions:- Wait a few minutes before retrying
- Enable response caching (should be enabled by default)
- Reduce concurrent AI operations
- Consider upgrading to a paid plan for higher limits
Poor AI Responses
Problem: AI generates inaccurate or low-quality responses. Solutions:- Improve your profile: Add more detailed work experience and skills
- Provide complete job descriptions: More context = better analysis
- Check model configuration: Ensure you’re using appropriate models
- Review prompts: The AI is only as good as the data it receives
Slow Response Times
Problem: AI features take too long to respond. Solutions:- Check your internet connection
- Verify Gemini API status at Google Cloud Status
- Ensure caching is enabled and working
- Consider using faster models (gemini-2.5-flash)
- Check for API quota limits
Best Practices
Optimize Profile
Keep your profile up-to-date with detailed work experience and skills for better AI analysis
Monitor Usage
Regularly check your API usage to avoid unexpected quota limits
Secure Keys
Always use environment variables or secrets management for API keys
Test Changes
Test configuration changes in development before deploying to production