Skip to content

apoorva5ingh/ai-career-engine

Repository files navigation

🧠 AI Career Path + Job Intelligence Engine

Internship Project β€” Built for Endee.io AI Engineering Internship Evaluation
Demonstrates production-grade RAG pipeline architecture using Endee Vector Database

Python FastAPI Endee License: MIT


🎯 What It Does

A user types a career goal like "I want to become a Machine Learning Engineer" and the system:

  1. Embeds the query into a 384-dimensional vector using sentence-transformers
  2. Retrieves semantically relevant documents from 5 Endee collections in parallel
  3. Augments an LLM prompt with the retrieved context (RAG)
  4. Generates a structured career intelligence report containing:
    • Step-by-step learning roadmap (0–12 months)
    • Required skills ranked by relevance score
    • Real job roles with salary ranges and demand signals
    • Salary trends and market outlook
    • Recommended portfolio projects
    • Career timeline milestones

πŸ—οΈ System Architecture

User Input
    β”‚
    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     FastAPI Backend                              β”‚
β”‚                                                                  β”‚
β”‚  POST /api/v1/career/analyze                                     β”‚
β”‚       β”‚                                                          β”‚
β”‚       β–Ό                                                          β”‚
β”‚  EmbeddingEngine (sentence-transformers/all-MiniLM-L6-v2)       β”‚
β”‚       β”‚  query β†’ 384-dim float vector                            β”‚
β”‚       β”‚                                                          β”‚
β”‚       β–Ό                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Endee Vector DB ──────────────────┐    β”‚
β”‚  β”‚  Parallel cosine-similarity search across 5 collections β”‚    β”‚
β”‚  β”‚                                                          β”‚    β”‚
β”‚  β”‚  job_roles      β†’ top-5 semantically relevant jobs      β”‚    β”‚
β”‚  β”‚  skill_taxonomy β†’ top-5 relevant skills                  β”‚    β”‚
β”‚  β”‚  learning_paths β†’ top-5 resources                        β”‚    β”‚
│  │  salary_insights→ top-5 salary records                   │    │
β”‚  β”‚  projects       β†’ top-5 portfolio projects               β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚       β”‚  Retrieved SearchResult objects (id, score, metadata)    β”‚
β”‚       β”‚                                                          β”‚
β”‚       β–Ό                                                          β”‚
β”‚  RAGPipeline.build_prompt(query + retrieved_context)             β”‚
β”‚       β”‚                                                          β”‚
β”‚       β–Ό                                                          β”‚
β”‚  LLM Client (OpenAI / Groq / Ollama)                            β”‚
β”‚       β”‚  system: expert career counselor                         β”‚
β”‚       β”‚  user: career goal + retrieved context                   β”‚
β”‚       β”‚                                                          β”‚
β”‚       β–Ό                                                          β”‚
β”‚  CareerInsight (structured Python dataclass β†’ JSON)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β–Ό
HTML/JS Frontend (renders roadmap, skills, jobs, salary, projects)

πŸ“ Folder Structure

ai-career-engine/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                  # FastAPI app, startup, routing
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ vector_store.py      # Endee SDK integration + InMemoryFallback
β”‚   β”‚   β”œβ”€β”€ embeddings.py        # sentence-transformers wrapper + LRU cache
β”‚   β”‚   └── rag_pipeline.py      # RAG orchestration + LLM client + prompts
β”‚   └── api/
β”‚       β”œβ”€β”€ career_routes.py     # /career/analyze, /search/semantic, /stats
β”‚       └── health_routes.py     # /health
β”‚
β”œβ”€β”€ frontend/
β”‚   └── templates/
β”‚       └── index.html           # Single-file frontend (HTML + CSS + JS)
β”‚
β”œβ”€β”€ scripts/
β”‚   └── seed_data.py             # One-time dataset loader β†’ Endee collections
β”‚
β”œβ”€β”€ .env.example                 # Environment variable template
β”œβ”€β”€ requirements.txt             # All Python dependencies
└── README.md

🧰 Tech Stack

Layer Technology Purpose
Vector DB Endee Store & search 384-dim embeddings
Embeddings sentence-transformers (MiniLM) Convert text to dense vectors
RAG Custom pipeline Retrieval-augmented prompt construction
LLM OpenAI / Groq / Ollama Career insight generation from context
Backend FastAPI + Python 3.11 REST API, async, Pydantic validation
Frontend Vanilla HTML/CSS/JS Zero-dependency terminal-aesthetic UI

πŸ”‘ How Endee Is Used

Endee serves as the semantic memory of the system β€” replacing traditional keyword search with meaning-aware retrieval.

Collections

Collection Documents Content
job_roles 10 Job titles, salaries, required skills, demand
skill_taxonomy 15 Skills, categories, importance, learning time
learning_paths 10 Courses, books, platforms with metadata
salary_insights 5 Compensation by role, location, YoY growth
projects 6 Portfolio projects with tech stacks

Upsert Example

from core.vector_store import VectorStore
from core.embeddings import EmbeddingEngine

engine = EmbeddingEngine()
store  = VectorStore()
await store.initialize()

vector = engine.embed_single("Machine Learning Engineer requires Python and PyTorch")

await store.upsert_vectors("job_roles", [{
    "id": "job_001",
    "values": vector,                          # 384-dim float list
    "metadata": {
        "job_title":    "Machine Learning Engineer",
        "salary_range": "$130k–$180k",
        "demand":       "Very High",
        "key_skills":   ["Python", "PyTorch", "MLOps"],
        "content":      "Machine Learning Engineer builds production ML systems..."
    }
}])

Semantic Search Example

query_vector = engine.embed_single("I want a career in deep learning")

results = await store.semantic_search(
    collection="job_roles",
    query_vector=query_vector,
    top_k=5
)

for r in results:
    print(f"[{r.score:.3f}] {r.metadata['job_title']} β€” {r.metadata['salary_range']}")

⚑ Installation & Setup

Prerequisites

  • Python 3.11+
  • Endee API key (sign up at endee.io)
  • OpenAI or Groq API key (or run Ollama locally for free)

1. Clone & install

git clone https://github.com/yourusername/ai-career-engine.git
cd ai-career-engine

python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt

2. Configure environment

cp .env.example .env
# Edit .env and fill in:
#   ENDEE_API_KEY=your_key_here
#   OPENAI_API_KEY=your_key_here  (or GROQ_API_KEY for free tier)

3. Seed the vector database

python scripts/seed_data.py

This embeds 46 career documents and upserts them into 5 Endee collections.

4. Start the server

cd backend
uvicorn main:app --reload --port 8000

5. Open the app

Navigate to http://localhost:8000 in your browser.


πŸ“‘ API Endpoints

Method Endpoint Description
POST /api/v1/career/analyze Full RAG career analysis
GET /api/v1/career/skills?role= Ranked skills for a role
GET /api/v1/career/jobs?goal= Job roles matching a goal
POST /api/v1/search/semantic Raw semantic search in any collection
GET /api/v1/stats Vector DB collection counts + cache stats
GET /api/v1/health Health check

Sample Request

curl -X POST http://localhost:8000/api/v1/career/analyze \
  -H "Content-Type: application/json" \
  -d '{"career_goal": "I want to become a Machine Learning Engineer", "top_k": 5}'

πŸš€ LLM Options (choose one)

Option Cost Setup
OpenAI GPT-4o-mini ~$0.01/query OPENAI_API_KEY=sk-...
Groq Llama-3 Free tier GROQ_API_KEY=gsk_... + update .env
Ollama (local) Free ollama pull llama3.2 + update .env

No LLM key? The system still works β€” it falls back to rule-based generation using the retrieved Endee data.


πŸ§ͺ Running Tests

pytest tests/ -v

πŸ› οΈ Key Design Decisions

Why Endee over SQL/keyword search?
A user saying "deep learning career" and "neural network engineer path" mean the same thing. SQL LIKE queries fail here. Endee's cosine similarity returns the same top results for both because the meaning is semantically close.

Why sentence-transformers (MiniLM)?
Fast (14k tokens/sec on CPU), small (22 MB), good quality for retrieval tasks. Outperforms TF-IDF and BM25 on semantic similarity benchmarks.

Why async throughout?
Parallel retrieval from 5 Endee collections simultaneously using asyncio. Without async, this would be ~5x slower (sequential).

Why a fallback for empty collections?
Graceful degradation β€” the system still produces useful output even before the DB is seeded, making it easier to demo.


πŸ‘€ Author

Apoorva Deep Singh β€” B.Tech CSE
Built as part of the Endee.io AI Internship Evaluation


This project demonstrates production-level RAG system design: vector database integration, semantic retrieval, LLM prompt engineering, async FastAPI, and clean modular architecture.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors