feat: display AI-generated document summary in sidebar after ingestion#657
Open
vivek0369 wants to merge 2 commits into
Open
feat: display AI-generated document summary in sidebar after ingestion#657vivek0369 wants to merge 2 commits into
vivek0369 wants to merge 2 commits into
Conversation
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.
feat: display AI-generated document summary in sidebar after ingestion
Description
Closes #<ISSUE_NUMBER>
This PR completes the existing document summarization feature by surfacing AI-generated document summaries in the frontend sidebar after document ingestion.
The project already contains the necessary backend infrastructure:
Document.summarycolumn (Column(Text, nullable=True))backend/app/rag/summarizer.pyHowever, although summaries were being generated and persisted, they were never displayed in the user interface.
This contribution bridges that gap by updating the document sidebar to render document summaries in a clean, collapsible format, allowing users to quickly understand uploaded content before starting a conversation.
Changes Made
Frontend
File Modified
frontend/src/components/document/DocumentSidebar.tsxImplemented
Replaced the static summary rendering with a native collapsible
<details>/<summary>component.Added an "AI Summary" dropdown beneath each document when a summary is available.
Displayed the generated summary text inside the expandable section.
Applied existing design-system styling to maintain visual consistency:
text-xstext-muted-foregroundleading-relaxedmt-1Example
Why This Change Is Valuable
Improved User Experience
Users can immediately view a concise AI-generated overview of their uploaded documents without needing to ask questions first.
Makes Existing AI Functionality Visible
The summarization pipeline was already producing useful information, but users had no way to access it directly.
Low-Risk Enhancement
Completes a Partially Implemented Feature
This PR connects already-existing backend functionality with the frontend experience, maximizing value from existing code.
Testing Instructions
Start the application.
Upload a supported document (
PDF,DOCX, orTXT).Wait for document ingestion to complete.
Open the document sidebar.
Verify that documents containing summaries display an "AI Summary" dropdown.
Expand the dropdown.
Confirm that:
Screenshots
Before
After
(Add screenshots here before submission.)
Checklist
Related Issue
Closes #641