-
Notifications
You must be signed in to change notification settings - Fork 5
✨(ai): add ai summarization for threads #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨(ai): add ai summarization for threads #286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces AI-powered thread summarization and a rule-based attachment reminder system. The changes enhance user experience by automatically summarizing long threads and preventing users from forgetting to attach files when mentioned in their messages.
Key changes:
- Adds AI thread summarization using the AlbertAPI with automatic generation for threads with sufficient content and manual refresh capabilities
- Implements attachment reminder detection that warns users when they mention attachments but haven't included any files
- Adds comprehensive configuration system to conditionally enable AI features based on required settings
Reviewed Changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/frontend/src/features/layouts/components/thread-view/components/thread-summary/index.tsx |
New React component for displaying and refreshing AI-generated thread summaries |
src/frontend/src/features/forms/components/message-form/index.tsx |
Enhanced message form with attachment detection logic using keywords from multiple languages |
src/backend/core/ai/thread_summarizer.py |
Core AI service integration for thread summarization using OpenAI-compatible API |
src/backend/core/models.py |
Added summary field to Thread model for storing AI-generated summaries |
src/backend/core/api/viewsets/thread.py |
New API endpoints for retrieving and refreshing thread summaries with proper permission checks |
Files not reviewed (1)
- src/frontend/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
src/frontend/src/features/forms/components/message-form/_index.scss
Outdated
Show resolved
Hide resolved
src/frontend/src/features/forms/components/message-form/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
I focused mainly on the backend
We should add `AI_FEATURE_THREAD_SUMMARY=1" env var to enable specific features individually ?
src/frontend/src/features/layouts/components/thread-view/components/thread-summary/_index.scss
Outdated
Show resolved
Hide resolved
src/frontend/src/features/layouts/components/thread-view/components/thread-summary/index.tsx
Show resolved
Hide resolved
src/frontend/src/features/layouts/components/thread-view/components/thread-summary/index.tsx
Outdated
Show resolved
Hide resolved
src/frontend/src/features/layouts/components/thread-view/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last few nitpicks from my side
src/frontend/src/features/layouts/components/thread-view/components/thread-summary/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me once JB's feedbacks are done
ea92afa to
e114144
Compare
e114144 to
e6beb79
Compare
Purpose
Some threads and messages can be very long. Summarizing them helps users quickly retrieve key information.
We also want to assist users in avoiding common mistakes when sending messages.
Proposal
Introduce an AI-powered summarization feature for threads.
Also add a simple rule-based system to detect forgotten attachments.
AI Summarization
AlbertAPIwith thealbert-largemodel.Attachment Reminder (non-AI)