paisable icon indicating copy to clipboard operation
paisable copied to clipboard

feat: AI-powered spending insights

Open archa8 opened this issue 1 year ago • 3 comments

Problem or Need

The application currently displays a user's financial data through lists, and charts. However, this is a reactive approach; it requires the user to manually analyze the data to find trends, anomalies, or areas for improvement. The app does not currently offer proactive advice or automatically highlight important patterns in a user's spending habits.

Proposed Solution

Introduce a new "Financial Insights" feature powered by the Google Gemini API. This feature will analyze a user's recent financial activity (transactions, budgets, etc.) and generate a short list of personalized, human-readable insights and suggestions. This transforms the application from a simple data tracker into an intelligent financial assistant.

Expected Behavior

  1. On the Dashboard, there is a new card or section titled "Your Weekly Insights" or "AI Financial Coach."
  2. When the page loads, this section shows a loading state while the AI generates its analysis.
  3. After a few moments, the section populates with 2-3 concise, bulleted insights, for example:
    • "Heads up! Your spending on 'Shopping' this month is 50% higher than your average."
    • "Great job! You are on track to stay well under your 'Food' budget for this month."
    • "Based on your current income and spending rate, you are projected to save an additional ₹3,500 by the end of the month."

Benefits

  • Proactive Guidance: Transforms the app from a passive data viewer into an active assistant that provides actionable advice.
  • Deeper Engagement: Provides users with novel, personalized content on their dashboard, encouraging regular use of the application.
  • Actionable Advice: Helps users spot trends and anomalies in their spending that they might have missed, helping them to make smarter financial decisions.

Possible Implementation

  • Backend:

    1. Create a new endpoint: GET /api/insights or similar.
    2. The controller for this endpoint will fetch the user's relevant financial data (e.g., transactions from the last 30-60 days, current budget progress).
    3. It will then construct a detailed prompt for the Gemini API. The prompt should provide the raw financial data as context and instruct the model to act as a "friendly financial coach," identifying the most important trends or anomalies and summarizing them in a few key points.
    4. The controller will call the Gemini API, parse the text response, and send the generated insights back to the frontend as an array of strings.
  • Frontend (DashboardPage.jsx):

    1. Create a new InsightsCard.jsx component.
    2. This component will have its own useEffect hook to call the new /api/insights endpoint on page load.
    3. It will manage and display a loading state while waiting for the AI to generate the response.
    4. It will then render the list of text-based insights returned from the API.
    5. Add the new <InsightsCard /> component to the main DashboardPage layout.

archa8 avatar Sep 29 '25 18:09 archa8

Hi @archa8 , Please assign this issue to me!

Priyanshiunique avatar Sep 29 '25 19:09 Priyanshiunique

@Priyanshiunique assigned to you Good luck!

archa8 avatar Sep 30 '25 01:09 archa8

Hey........I would Love to work on this.

h-banerjee avatar Sep 30 '25 13:09 h-banerjee