Inspiration
As students, we shouldn’t have to spend hours digging through folders just to answer questions like “Where is authentication handled?” or “Which component manages this UI state?” Learning real projects should feel guided, accessible, and supportive — not intimidating.
CodeMentor OS aims to bridge that gap. It gives students the feeling of having a senior engineer beside them: someone who can instantly point to the correct file, summarize what’s happening, and explain code with clarity and confidence — all grounded directly in the source.
By transforming codebases into intelligent, explorable learning spaces, CodeMentor OS aligns perfectly with the Hackpad mission: reducing friction, boosting productivity, and empowering students to learn faster and build better.
What it does
CodeMentor OS turns any public GitHub repository into a smart, searchable learning companion designed especially for students. With just a repo URL, it:
- Indexes the entire codebase using Elasticsearch for fast structured search
- Provides semantic search that understands meaning instead of keywords
- Generates AI-driven summaries, onboarding guides, and learning notes
- Gives assertive, code-grounded explanations using Gemini Flash
- Includes a modern file explorer with syntax highlighting
- Shows real-time indexing progress through a clean, polished UI
- Uses PostgreSQL caching to avoid unnecessary waiting on repeat queries
Instead of getting vague, generic answers, students get precise explanations backed by real code — making it easier to understand projects, contribute, debug, or simply learn how things work.
Tech Stack
- Frontend: Next.js 15, React 19, TypeScript, TailwindCSS (Hacker Console Theme)
- Backend: Next.js Serverless API Routes
- Database: PostgreSQL (Neon) for repo metadata + caching
- Search Engine: Elasticsearch for semantic search + ranking
- AI: Google Gemini 2.0 Flash for code interpretation and explanations
- GitHub Integration: Octokit REST API with retry + concurrency control
- Deployment: Vercel with optimized serverless handling
Architecture Highlights
- Background Indexing Pipeline: Ranks and fetches files, then indexes them into Elasticsearch.
- Semantic Retrieval Engine: Combines keyword search + embeddings + filename detection.
- Assertive Response Layer: Removes uncertainty and ensures clarity.
- Real-Time Progress Feedback: A smooth 0–100% progress tracker.
- Caching Layer: 24-hour TTL to accelerate repeated repo access.
Challenges
- GitHub API Rate Limits: Required concurrency caps, exponential backoff, and file prioritization.
- Elasticsearch Index Delays: Needed fallback retrieval when documents weren’t instantly searchable.
- Database Pooling Issues: Neon required connection retries and pooling adjustments.
- AI Tone Tuning: Early responses were hesitant; solved using tone-enforcement rules.
- File Size Constraints: GitHub rejects >1MB files; we skip large ones and batch the smaller ones.
- Vercel Execution Limits: Forced a fully async, job-based indexing system.
Accomplishments
- ⚡ Indexes 100+ file repos in under 30 seconds
- 🧠 Provides zero-speculation, code-grounded explanations
- 🔍 Smartly detects relevant files from user queries
- 🧱 Features robust error handling + retries
- 🎨 Includes a polished UI with real-time updates
- 🚀 Fast, smooth, responsive chat system
Learnings
- Elasticsearch, while powerful, requires careful tuning and patience
- Effective prompt design massively improves AI clarity
- Concurrency is a balancing act between speed and API limits
- Good UX boosts confidence and learning effectiveness
- Students benefit most when complexity is hidden behind simple interfaces
What's next
Short-Term
- 🔐 Private repository support with OAuth
- 🧩 Multi-repo comparison workspace
- 🧬 Code similarity search
- 🧾 AI-powered PR explanations
Medium-Term
- 💻 VS Code extension for inline learning
- 👥 Shared repo annotations for teams
- 🧱 Org-specific knowledge bases
- 📖 Auto-updated documentation
Long-Term
- ⚙️ Context-aware code generation
- 🔗 Visual dependency + architecture maps
- 🛡️ AI-assisted security scanning
- 🔁 Automated refactoring (e.g., class → hooks)
Built With
- elastic
- elasticsearch
- gemini
- neon
- nextjs
- postgresql
- react
- vercel
- webstorm
Log in or sign up for Devpost to join the conversation.