🧠 Cortex

A living 3D brain that visualizes your CS knowledge.

Upload GitHub repos, PDFs, or text β€” Cortex scores your skills across 51 categories using Google Gemini, maps them onto a glowing interactive brain, and offers AI-powered learning advice through a built-in chatbot.

Built for HackCanada 2026.


✨ Features

  • 3D Knowledge Brain β€” Interactive Three.js neural network with 9 glowing regions representing skill groups. Regions light up as you upload evidence of your skills.
  • Multi-Source Ingestion β€” Upload GitHub repos (auto-fetched via API), PDFs, or plain text descriptions.
  • AI Scoring β€” Google Gemini analyses your content and scores 51 technical categories (0–1) with keyword fallback when the API is unavailable.
  • Profile Accumulation β€” Scores merge over time using EMA blending β€” more uploads = more accurate profile. Strong sources (GitHub) carry more weight than text prompts.
  • Chatbot Advisor β€” Ask Lumas (the AI advisor) for SWOT analyses, learning paths, project suggestions, and skill-gap insights β€” all grounded in your actual profile data.
  • Proficiency Tiers β€” Scores are translated into meaningful labels (Novice β†’ Beginner β†’ Intermediate β†’ Proficient β†’ Advanced β†’ Expert) so feedback feels human.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Next.js Frontend                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚BrainSceneβ”‚  β”‚ UploadPanel  β”‚  β”‚     ChatBot       β”‚  β”‚
β”‚  β”‚(Three.js)β”‚  β”‚(GitHub/PDF)  β”‚  β”‚  (Gemini-powered) β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚       β”‚               β”‚                   β”‚              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚           ProfileContext + categoryMapping          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚ REST API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FastAPI Backend                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                   /api router                       β”‚  β”‚
β”‚  β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”˜  β”‚
β”‚     β”‚                                              β”‚     β”‚
β”‚  β”Œβ”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”  β”‚
β”‚  β”‚ Profile Scoring β”‚                    β”‚   Chatbot   β”‚  β”‚
β”‚  β”‚  β”œ orchestrator β”‚                    β”‚  β”œ service   β”‚  β”‚
β”‚  β”‚  β”œ gemini_scorerβ”‚                    β”‚  β”œ router    β”‚  β”‚
β”‚  β”‚  β”œ profile_mgr  β”‚                    β”‚  β”” models    β”‚  β”‚
β”‚  β”‚  β”” categories   β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                     β”‚
β”‚     β”‚                                                    β”‚
β”‚  β”Œβ”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                     β”‚
β”‚  β”‚    Ingestion     β”‚                                     β”‚
β”‚  β”‚  β”œ github_proc  β”‚                                     β”‚
β”‚  β”‚  β”œ pdf_proc     β”‚                                     β”‚
β”‚  β”‚  β”” text_proc    β”‚                                     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧩 Tech Stack

Layer Technology
Frontend Next.js 14, React 18, TypeScript, Tailwind CSS
3D Visualization Three.js, @react-three/fiber, @react-three/drei
Backend Python 3.9+, FastAPI, Pydantic
AI Google Gemini (gemini-2.5-flash) via google-genai SDK
Ingestion GitHub REST API, PDF parsing, plain text

πŸ“‚ Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                  # FastAPI entry point
β”‚   β”œβ”€β”€ chatbot/
β”‚   β”‚   β”œβ”€β”€ chat_service.py      # Gemini-powered conversational advisor
β”‚   β”‚   β”œβ”€β”€ router.py            # POST /chat/{user_id}, GET /chat/{user_id}/insights
β”‚   β”‚   └── models.py            # ChatRequest, ChatResponse, InsightsResponse
β”‚   β”œβ”€β”€ profile_scoring/
β”‚   β”‚   β”œβ”€β”€ categories.py        # 51 categories across 9 groups
β”‚   β”‚   β”œβ”€β”€ gemini_scorer.py     # Content β†’ category scores via Gemini
β”‚   β”‚   β”œβ”€β”€ profile_manager.py   # EMA merge, in-memory storage, history
β”‚   β”‚   β”œβ”€β”€ orchestrator.py      # Single entry-point: fetch β†’ score β†’ merge
β”‚   β”‚   β”œβ”€β”€ router.py            # Profile CRUD + scoring endpoints
β”‚   β”‚   └── models.py            # UserProfile, GeminiScoringResult, etc.
β”‚   └── ingestion/
β”‚       β”œβ”€β”€ github_processor.py  # Fetch README, file tree, languages via GitHub API
β”‚       β”œβ”€β”€ pdf_processor.py     # Extract text from PDFs
β”‚       └── text_processor.py    # Plain text processing
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ page.tsx             # Main page with brain + upload panel + chatbot
β”‚   β”‚   └── layout.tsx           # Root layout with ProfileProvider
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ BrainScene.tsx       # Three.js canvas with lighting + controls
β”‚   β”‚   β”œβ”€β”€ LowPolyBrain.tsx     # Node/edge rendering, BFS animation, glow
β”‚   β”‚   β”œβ”€β”€ UploadPanel.tsx      # GitHub URL / PDF upload form
β”‚   β”‚   └── ChatBot.tsx          # Chat UI panel
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── ProfileContext.tsx   # Global profile state + API calls
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ api.ts               # Backend API client
β”‚   β”‚   └── categoryMapping.ts   # 51 categories β†’ 9 brain regions
β”‚   └── public/
β”‚       └── brain_regions.json   # 1982 nodes, 5630 edges, 9 region segments
└── .env                         # API keys (not committed)

πŸš€ Getting Started

Prerequisites

1. Clone & install

git clone https://github.com/Devansh015/HackCanada.git
cd HackCanada

2. Backend setup

pip3 install fastapi uvicorn pydantic python-dotenv google-genai requests

3. Frontend setup

cd frontend
npm install

4. Environment variables

Create a .env in the project root:

GOOGLE_CLOUD_CONSOLE_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-2.5-flash

5. Run

Backend (from project root):

python3 -m uvicorn backend.main:app --reload --port 8000

Frontend (from frontend/):

npm run dev

Open http://localhost:3000.


πŸ”Œ API Endpoints

Profile Scoring

Method Endpoint Description
POST /api/profile/{user_id}/init Create blank profile
GET /api/profile/{user_id} Get current scores
GET /api/profile/{user_id}/top?n=5 Top-N categories
POST /api/profile/{user_id}/score-upload Score content & merge
GET /api/profile/{user_id}/history Upload history
POST /api/profile/{user_id}/reset Reset to zeros

Chatbot

Method Endpoint Description
POST /api/chat/{user_id} Send message, get AI reply
GET /api/chat/{user_id}/insights Auto-generated profile insights

Chat request:

{ "message": "Give me a SWOT analysis", "conversation_history": [] }

Chat response:

{ "reply": "Here's your analysis...", "suggestions": ["What should I learn next?"] }

🧠 Skill Categories (51)

Region Categories
Fundamentals (4) Variables, Functions, Control Flow, Recursion
OOP (9) OOP, Classes, Objects, Inheritance, Polymorphism, Encapsulation, Abstraction, Methods, Constructors
Data Structures (8) Data Structures, Arrays, Linked Lists, Stacks, Queues, Trees, Graphs, Hash Tables
Algorithms (6) Algorithms, Sorting, Searching, Dynamic Programming, Time Complexity, Space Complexity
Systems (8) Databases, SQL, Indexing, APIs, Operating Systems, Memory Management, Concurrency, Networking
Frontend (5) HTML/CSS, JavaScript/TypeScript, React, Responsive Design, UI/UX
Dev Practices (5) Git, Testing, CI/CD, Docker, Cloud Infrastructure
Product (3) Documentation, Project Management, System Design
Hackathon (3) Rapid Prototyping, Third-party Integrations, Creative Problem Solving

πŸ“Š Proficiency Tiers

Score Tier Meaning
0.00 Unassessed No evidence uploaded yet
0.01 – 0.15 Novice Minimal exposure
0.16 – 0.35 Beginner Some familiarity with basics
0.36 – 0.55 Intermediate Working knowledge, can apply in projects
0.56 – 0.75 Proficient Solid competence, works independently
0.76 – 0.90 Advanced Strong expertise
0.91 – 1.00 Expert Exceptional mastery

πŸ‘₯ Team

Built by Team Cortex at HackCanada 2026.


πŸ“„ License

MIT

Built With

Share this project:

Updates