[FEAT] : add AI-Driven Goal Mentor (AI Feature) #2997
Open
hrshjswniii wants to merge 3 commits into
Open
Conversation
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Contributor
Author
|
Hiii @Priyanshu-byte-coder , do review the issue implemented and feel free to merge the Pr !! |
Owner
|
New feature/UI PRs are on hold during the code-quality sprint — see discussion #2651. We'll revisit this after the sprint; meanwhile tests, refactors, and bug-fix PRs are very welcome. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the AI-Driven Goal Mentor to suggest personalized, data-backed weekly and monthly coding goals. It leverages Gemini (or Groq) to analyze recent contributions, streaks, PRs, and active language statistics, caches results in the database, and exposes an interactive dashboard UI that allows developers to pre-fill and set goals with a single click.
Closes #2984
Type of Change
What Changed
ai_insights.insight_typeto supportpersonalityandgoal_suggestionsvalues, preventing database validation errors when storing generated insights.GoalMentorPromptParamsinterface and added thegoalMentorPrompttemplate function. The prompt instructs the model to return exactly 3 goals in a structured JSON schema alongside personalized logic/reasoning.ai_insights) and rate-limiting (5 requests/hour via Upstash Redis or local memory fallback).gemini-2.5-flash) as the primary generator, Groq (llama-3.3-70b-versatile) as the secondary fallback, and structured static heuristics as the tertiary local fallback.How to Test
GEMINI_API_KEYorGROQ_API_KEY).Expected result: AI suggestions populate successfully on mount or regeneration, and auto-populate the creation form correctly on click.
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
Caching is used to minimize external LLM token fees and guarantee dashboard loads stay fast. The API route fallbacks guarantee a fully-functioning experience even in local environment setups without keys.