π§ 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
- Python 3.9+
- Node.js 18+
- A Google Gemini API key
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
- backboard
- gemini
- python
- tailwindcss
- three.js
- typescript


Log in or sign up for Devpost to join the conversation.