You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HiRank is an AI-powered college admission counseling platform. It leverages an intelligent backend system connected to vector databases, live statistics, and LLMs to provide students with personalized predictions and guidance for entrance exams (JEE Main, JEE Advanced, NEET, CEE).
The platform features a modern, responsive web interface, a robust FastAPI backend, intelligent data ingestion pipelines, and comprehensive administrative analytics.
🚀 Key Features
AI-Powered Admissions Counselor: Context-aware RAG pipeline powered by LangChain and Hugging Face Embeddings for dynamic Q&A about colleges, cutoffs, and admissions processes.
Intelligent Rank Prediction: The CutoffEngine analyzes real-world historical CSV data to filter and predict feasible colleges based on a student's rank, percentile, category, and target exams.
Automated Data Ingestion: Includes web scraping pipelines, subpage discovery, vector store chunking (ChromaDB), and page cleaners to keep the AI's knowledge base continuously up-to-date.
Administrative Analytics: Comprehensive admin dashboards for observing chat logs, API usage, active user counts, and system health.
Profile Enrichment: Automatically extracts structured data (exam type, rank, category) from conversational text to build implicit user profiles.
Modern Security: Built-in rate limiting (Redis), CSP headers, and robust Supabase authentication (Magic Links, OTP, OAuth).
Enterprise Infrastructure: Fully automated CI/CD to Azure Container Apps utilizing Azure Key Vault and Managed Identities.
💻 Tech Stack
Frontend
Framework: Next.js (App Router), React 18
Language: TypeScript
Styling: Tailwind CSS
API Client: Native fetch configured for /api/v1 routes
State & Context: React Context API
Backend
Framework: FastAPI (Python 3.11)
AI & Embeddings: LangChain, HuggingFace Inference Endpoints (HuggingFaceEndpointEmbeddings)
SSE Connection: Frontend opens a POST to /api/v1/chat with Accept: text/event-stream. Backend streams tokens via Server-Sent Events.
Auth & Quota Gate (usage_service.py): Checks atomic Redis counters. Anonymous users get 3 prompts; authenticated users get unlimited prompts with 5 Tavily searches/month. Fail-open if Redis is unreachable.
Supreme Orchestrator (orchestrator.py): Delegates to Intent Parser, routes to the appropriate agent.
Intent Parser (intent_agent.py): Classifies query into greeting, prediction, web_knowledge, off_topic, or clarification via regex + LLM fallback.
Specialized Agents:
Prediction Agent: Deterministic algorithms against CSV cutoff data. No LLM involved.
Web Knowledge Agent (3-Tier): Tier 1 = ChromaDB with freshness scoring → Tier 2 = Tavily live web search (restricted to .ac.in, .edu.in) → Tier 3 = Local structured data.
Verifier Agent: Hallucination guard. Ensures rank claims are backed by CSV evidence. Can downgrade or block responses.
Self-Healing: When Tavily discovers a new official URL, a Celery task permanently ingests it into ChromaDB with version-tagging.
See docs/ER_DIAGRAM.md for the full Mermaid ERD, schema design decisions, and RLS policies.
🛠️ Getting Started
Prerequisites
Python 3.11+
Node.js 18+
Redis (local or remote)
Supabase Account
1. Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # Or `venv\Scripts\activate` on Windows# Install dependencies
pip install -r requirements.txt
# Run the server
uvicorn app.main:app --reload --port 9000
2. Frontend Setup
cd frontend
npm install
# Run the development server
npm run dev
3. Environment Variables
Create a .env file in the backend/ directory. See .env.example for the required keys.
Variable
Required
Description
SUPABASE_URL
Yes
Supabase project URL
SUPABASE_SERVICE_KEY
Yes
Supabase service role key
SUPABASE_JWT_SECRET
Yes
JWT secret for token verification
GROQ_API_KEY
Yes
LLM inference via Groq
HUGGINGFACE_API_TOKEN
Yes
Embedding API
TAVILY_API_KEY
Yes
Live web search fallback
REDIS_URL
Yes
Redis connection for Celery, caching, rate limiting
FRONTEND_URL
No
CORS + OAuth redirect (default: http://localhost:3000)
🧪 Testing
The backend includes a comprehensive test suite covering security, remediation, vector stores, and rate limits.
cd backend
pytest tests/ -v
🚀 Deployment
Deployment is fully automated via GitHub Actions (.github/workflows/deploy-azure.yml).
Pushing to the main branch will:
Run linting and unit tests (ci.yml).
Build the Docker container for the backend.
Run database migrations via psql against Supabase.
Provision/Update Azure Key Vault and Managed Identities (infrastructure/azure/deploy.sh).
Deploy the latest image to Azure Container Apps.
About
HiRank is an AI-powered college admission counseling platform. It leverages an intelligent backend system connected to vector databases, live statistics, and LLMs to provide students with personalized predictions and guidance for entrance exams (JEE Main, JEE Advanced, NEET, CEE).