Add User Profile API, Learning Insights, Log Export, Reminder Support, And AI-generated Tags

by ADMIN 93 views

🎯 Goals and Objectives

The primary objective of this ticket is to implement multiple backend enhancements aimed at improving user experience and enabling future frontend features. These enhancements include updating the /me endpoint to return the current user profile, adding a lightweight learning insights API, implementing optional AI-based tag generation, adding an API to download logs and summaries, and adding endpoint or logic to detect if a user should be reminded.

Update /me Endpoint to Return Current User Profile

The /me endpoint is a crucial part of any user-centric application, providing users with essential information about their account. To enhance user experience, we will update the /me endpoint to return the current user profile, including the following details:

  • Username: The username chosen by the user during registration.
  • Email: The email address associated with the user's account.
  • Summary Quota Remaining: The remaining summary quota for the user, indicating the amount of data they can store.
  • Last Log Date: The date and time of the user's last log entry.

By providing users with this information, we can help them better understand their account and make informed decisions about their usage.

Add Lightweight Learning Insights API

The learning insights API will provide users with valuable information about their usage patterns, helping them identify areas for improvement. The API will return the following insights:

  • Number of Logs in the Last 7/30 Days: The number of log entries made by the user in the last 7 days and 30 days, respectively.
  • Most Used Tags: The most frequently used tags by the user, indicating their areas of interest.
  • Time Since Last Log: The time elapsed since the user's last log entry, helping them track their progress.

By providing users with these insights, we can help them develop a better understanding of their usage patterns and make data-driven decisions.

Implement Optional AI-Based Tag Generation

To further enhance user experience, we will implement optional AI-based tag generation when creating new logs. This feature will use OpenAI to extract relevant tags from the content, providing users with a list of suggested tags. Users can then choose to add these tags to their log entry or create new ones.

To ensure that user-defined tags are not overwritten, we will store both user-defined and AI-generated tags. This approach will allow users to maintain control over their tags while still benefiting from the suggestions provided by the AI.

Add API to Download Logs and Summaries in JSON/TXT Format

To provide users with greater flexibility and control over their data, we will add an API to download logs and summaries in JSON and TXT format. This feature will enable users to export their data in a format that is easily readable and importable into other applications.

The API will support the following formats:

  • JSON: A lightweight, human-readable format that is easily parseable by applications.
  • TXT: A plain text format that is easily readable by humans.

By providing users with the ability to download their data in these formats, we can help them maintain control over their information and make it easier to integrate with other applications.

Add or Logic to Detect if a User Should be Reminded

To ensure that users stay engaged and active, we will add an endpoint or logic to detect if a user should be reminded. This feature will check if a user has not made a log entry in the last 3 days, triggering a reminder to encourage them to continue using the application.

By implementing this feature, we can help users stay on track and maintain their engagement with the application.

Notes and Considerations

When implementing these enhancements, we must consider the following notes and considerations:

  • Rate Limit Logic: The rate limit logic should remain enforced to prevent abuse and ensure that users do not exceed their quota.
  • AI-Generated Tags: AI-generated tags should not overwrite user tags, but rather extend them, providing users with a list of suggested tags to choose from.
  • Future Expandability: We should consider future expandability for feedback and rating per summary, enabling users to provide feedback on their summaries and helping us improve the application.

Q: What are the primary goals of this ticket?

A: The primary goals of this ticket are to update the /me endpoint to return the current user profile, add a lightweight learning insights API, implement optional AI-based tag generation, add an API to download logs and summaries, and add endpoint or logic to detect if a user should be reminded.

Q: Why is updating the /me endpoint important?

A: Updating the /me endpoint is crucial because it provides users with essential information about their account, including their username, email, summary quota remaining, and last log date. This information helps users understand their account and make informed decisions about their usage.

Q: What kind of insights will the learning insights API provide?

A: The learning insights API will provide users with valuable information about their usage patterns, including the number of logs in the last 7/30 days, most used tags, and time since last log. This information helps users identify areas for improvement and make data-driven decisions.

Q: How will AI-based tag generation work?

A: AI-based tag generation will use OpenAI to extract relevant tags from the content, providing users with a list of suggested tags. Users can then choose to add these tags to their log entry or create new ones. Both user-defined and AI-generated tags will be stored, allowing users to maintain control over their tags.

Q: Why is it important to store both user-defined and AI-generated tags?

A: Storing both user-defined and AI-generated tags is essential because it allows users to maintain control over their tags while still benefiting from the suggestions provided by the AI. This approach ensures that user-defined tags are not overwritten, and users can choose to add AI-generated tags to their log entry.

Q: What formats will the API support for downloading logs and summaries?

A: The API will support two formats for downloading logs and summaries: JSON and TXT. JSON is a lightweight, human-readable format that is easily parseable by applications, while TXT is a plain text format that is easily readable by humans.

Q: Why is it important to detect if a user should be reminded?

A: Detecting if a user should be reminded is essential because it helps users stay engaged and active. By checking if a user has not made a log entry in the last 3 days, we can trigger a reminder to encourage them to continue using the application.

Q: What are the considerations for implementing these enhancements?

A: When implementing these enhancements, we must consider the following notes and considerations:

  • Rate Limit Logic: The rate limit logic should remain enforced to prevent abuse and ensure that users do not exceed their quota.
  • AI-Generated Tags: AI-generated tags should not overwrite user tags, but rather extend them, providing users with a list of suggested tags to choose from.
  • Future Expandability: We should consider future expandability for feedback and rating per summary, enabling users to provide feedback on their summaries and helping us improve the application.

Q: What are the benefits of implementing these enhancements?

A: The benefits of implementing these enhancements include:

  • Improved User Experience: By providing users essential information about their account, usage patterns, and suggested tags, we can create a more user-friendly and engaging application.
  • Increased User Engagement: By detecting if a user should be reminded, we can encourage users to continue using the application and stay engaged.
  • Enhanced Data Analysis: By providing users with insights about their usage patterns, we can help them make data-driven decisions and improve their overall experience.

Q: What is the next step in implementing these enhancements?

A: The next step in implementing these enhancements is to begin coding and testing the new features. This will involve updating the /me endpoint, implementing the learning insights API, adding AI-based tag generation, and creating the API for downloading logs and summaries. Additionally, we will need to implement the endpoint or logic to detect if a user should be reminded.