ContextPilot is an AI-powered Chrome side-panel assistant that understands the current webpage and can summarize, answer questions, draft content, and (optionally) help fill forms using saved profile details.
This repo contains:
backend/: Node.js + Express API, agent loop + tools, Supabase persistence, Gemini/Anthropic provider wrapper.extension/: Chrome Extension (Manifest V3) side panel UI + content extraction + form scanning/fill.
- Node.js 20+ (recommended: latest LTS)
- A Supabase project (URL + keys)
- A Gemini API key (Google AI Studio / Gemini API)
cd backend
npm installCreate backend/.env (example keys shown; do not commit secrets):
PORT=3001
NODE_ENV=development
AI_PROVIDER=gemini
GEMINI_API_KEY=YOUR_GEMINI_KEY
GEMINI_MODEL=gemini-2.5-flash
SUPABASE_URL=YOUR_SUPABASE_URL
SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY=YOUR_SUPABASE_SERVICE_ROLE_KEY
EXTENSION_ORIGIN=*
MAX_PAGE_CONTENT_CHARS=8000Run the backend:
npm run devHealth check:
curl -s http://localhost:3001/health- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the
extension/folder - Open the ContextPilot side panel on any webpage
If you deploy the backend (e.g., Railway), update extension/config.js:
API_BASE_URL: set to your deployed URL
- “Summarize this page”
- “Answer this question using this page: …”
- “Draft a professional reply to this email”
- “Extract pricing/specs from this page”
Recommended flow for best reliability:
- Save details:
“Save my details: Name: …, Email: …, Phone: …”
- On a form page:
“Fill this form for me”
The assistant will prepare a review payload and the extension will fill fields (it will not submit the form).
Backend test assets live in backend/test/.
API test suite:
cd backend
bash test/test-api.sh http://localhost:3001Environment check:
cd backend
bash test/check-env.shThis is Gemini model overload. ContextPilot retries automatically and can fall back to a more stable Gemini model when needed.
This is a quota/rate-limit response. ContextPilot respects Gemini’s retry delay and avoids quota-burning retries.
If you consistently see 429:
- Verify your quotas at
https://ai.dev/rate-limit - Reduce request volume (avoid sending multiple prompts rapidly)
- Wait the
Retry-Afterseconds shown and retry
- Never commit
.envfiles or API keys. - Use
SUPABASE_SERVICE_ROLE_KEYonly on the server (backend).