A small RAG-style backend for the "ask about Ankit" chat widget on the
portfolio site. Currently a simple prompt + static-context implementation
(see context.py) - no vector DB yet. Upgrade to real
retrieval later if the content outgrows a single context file.
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\\Scripts\\activate
pip install -r requirements.txt
cp .env.example .env # then fill in GROQ_API_KEY
uvicorn main:app --reload --port 8000Test it:
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "What has Ankit built with LangGraph?"}'- Push this repo (or just the
backend/folder as its own repo) to GitHub. - On Render: New → Web Service → connect the repo.
- Root directory:
backend(if backend lives inside the main portfolio repo). - Build command:
pip install -r requirements.txt - Start command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Add environment variables:
GROQ_API_KEY,FRONTEND_URL(your Vercel URL). - Once deployed, set
RAG_API_URLin the Next.js project's environment variables (on Vercel) to this Render service's URL.
Render's free tier spins down after inactivity - the first request after idle can take several seconds. The chat widget on the frontend already accounts for this with a "waking up…" state.