feat: add AI chatbot with contextual memory and persistent chat history#439
feat: add AI chatbot with contextual memory and persistent chat history#439Aayush20253534 wants to merge 10 commits into
Conversation
|
@Aayush20253534 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Thanks for your first PR on DevTrack! 🎉
A maintainer will review it within 48 hours. While you wait:
- Make sure CI is passing (type-check + lint)
- Double-check the PR description is filled out and the issue is linked
- Feel free to ask questions in Discussions if you need help
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Production-breaking bug: hardcoded http://localhost:3000.
The getMetric helper fetches http://localhost:3000${path} — this does not work on Vercel or any cloud deployment where serverless functions cannot reach localhost:3000. The chatbot will silently return no context data in production and the AI will answer with empty metrics. Fix: call the underlying service functions/utilities directly instead of making self-HTTP calls.
Additional required fixes:
-
Wrong user ID key —
session.user.email || session.user.name || 'unknown-user'is used to keychatbot_messages. GitHub OAuth email can be null/private; display names are not unique. Two users with the same display name and no public email share chat history. Usesession.githubId/resolveAppUserlike every other route. -
No message length validation —
messageis stored in Supabase and forwarded to Groq with no size limit. Add a max length (e.g., 2000 chars). -
Session data leaking to LLM —
session.useris dumped into the system prompt context wholesale. This may includeaccessTokenor other sensitive fields that should not be sent to Groq. Whitelist only what's needed (e.g.,githubLogin). -
GROQ_API_KEYmissing env var returns"GROQ_API_KEY is missing"verbatim to the client — leaks internal implementation detail. Return a generic error message. -
Missing Supabase migration —
chatbot_messagesis added toschema.sqlbut no timestamped migration file exists. Existing deployments won't get this table. -
Missing EOF newline on
supabase/schema.sql.
|
Implemented and addressed all requested review fixes:
The chatbot now supports:
|
|
@Priyanshu-byte-coder Please Review the changes by me , I have implemented them successfully along with the production bugs I was supposed to fix. |
Summary
Added an AI-powered DevTrack chatbot with Groq integration, dashboard-aware responses, contextual memory, and persistent user-specific chat history.
Closes #416
Type of Change
Changes Made
chatbot_messagestable.How to Test
Steps for the reviewer to verify this works:
GROQ_API_KEYto.env.local.chatbot_messagestable.npm run dev.What are my top repositories?.Screenshots (if UI change)
Checklist
npm run lintpasses locallynpm run type-check)