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 11 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. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Two blockers:
-
lucide-react
^1.16.0does not exist — the latest lucide-react is in the 0.x range.^1.16.0will fail to install. Check the actual latest version on npmjs.com and use that. -
lucide-react is not in the project's current dependencies — adding it requires updating both package.json and package-lock.json consistently, and using the correct version.
Please fix the version and verify the install works before pushing.
24e08e1 to
179a67c
Compare
|
@Priyanshu-byte-coder Completed fixes include:
The remaining lint warnings are pre-existing unrelated warnings ( |
|
@Priyanshu-byte-coder I have fixed that lucide react problem , The latest version is indeed version
|
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Several issues:
- 3 missing EOF newlines on changed files
- Extensive hardcoded colors — replace with CSS vars:
text-slate-*,bg-slate-*,border-slate-*→ usevar(--foreground),var(--muted-foreground),var(--card-muted),var(--border)from-blue-600 to-indigo-700,bg-blue-600,bg-blue-500,border-blue-500→var(--accent)text-white→var(--foreground)- Hardcoded
rgba()in shadow utilities → usevar(--border)where possible
lucide-react: "^1.16.0"— this version does not exist on npm (latest stable is 0.x). Remove or use the already-installed version from the rootpackage.json- Assets/ images committed — demo/design images don't belong in the repo; host externally or remove

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)