Pr/merge import ub - #16
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a comprehensive Report Agent feature and significantly enhances existing agents (Search, Analysis, Embedding) with advanced capabilities. The changes represent a major feature addition that transforms the application from a document analysis tool into a research feasibility assessment platform.
Changes:
- Implemented a complete Report Agent with LLM-based research feasibility analysis, visualization generation (Plotly/Pyvis), and multi-format report building (Markdown/PDF)
- Enhanced Search Agent with adaptive cutoff, MMR-based diversity selection, and advanced reliability filtering
- Improved Analysis Agent with ReAct quality gate integration for evidence-based answering
- Upgraded Embedding Agent with LLM-based section splitting and improved chunking
- Added frontend support for report generation, display, and persistence
- Removed Docker configuration files (deployment strategy change)
Reviewed changes
Copilot reviewed 58 out of 59 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/requirements.txt | Added visualization libraries (plotly, pyvis, reportlab) and data processing tools (pandas, pint, networkx) |
| backend/app/agents/report_agent/* | New report agent implementation with 10+ modules including schemas, prompts, visualizer, LLM integration |
| backend/app/agents/search_agent/* | Enhanced filtering with adaptive cutoff, MMR selection, and reliability assessment |
| backend/app/agents/analysis_agent/* | Integrated ReAct quality gate for evidence validation |
| backend/app/agents/embedding_agent/* | Added LLM-based section splitting with fallback mechanism |
| frontend/src/services/reportAgentService.js | New service for report generation API calls |
| frontend/src/components/ChatPanel/* | Integrated report mode with library storage |
| frontend/src/stores/libraryStore.js | Added persistence and report management |
| backend/app/services/report_service.py | Report generation service layer |
| backend/app/api/v1/agents/report.py | Report API endpoints |
| .env.example* | New environment configuration examples for local and EC2 deployment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: "library-storage", // localStorage key | ||
| storage: createJSONStorage(() => localStorage), | ||
| partialize: (state) => ({ | ||
| // persist할 항목만 선택 |
There was a problem hiding this comment.
The Korean comment "persist할 항목만 선택" mixes Korean and English. For consistency and clarity, consider using either "저장할 항목만 선택" (Korean) or adding an English translation.
| */ | ||
|
|
||
| import apiClient from "./apiClient"; | ||
| import authService from "./authService"; |
There was a problem hiding this comment.
Unused import authService on line 7. The authService is imported but never used in this file. Consider removing this import to keep the code clean.
| method: "POST", | ||
| headers: headers, | ||
| credentials: 'include', // CORS 쿠키 포함 | ||
| body: formData, |
There was a problem hiding this comment.
The credentials: 'include' option has been removed from the fetch call. This could break authentication if the backend relies on cookies for session management. Verify that authentication still works correctly after this change, or document why this was removed.
|
|
||
| // 생성된 보고서를 Library의 Reports 탭에 저장 | ||
| if (response.report) { | ||
| const { useLibraryStore } = await import("../../stores/libraryStore"); |
There was a problem hiding this comment.
Missing error handling for the dynamic import. If the libraryStore module fails to import, the error will be caught by the outer catch block but may not provide a clear error message. Consider adding specific error handling for the import operation.
| # 기본값 사용 | ||
| breakdown = { | ||
| "선행연구": min(100, report.validation.feasibility_score + 10), | ||
| "방법론": report.validation.feasibility_score, | ||
| "실행가능성": max(0, report.validation.feasibility_score - 15), | ||
| "학술기여도": report.validation.feasibility_score, | ||
| } | ||
| logger.warning(f"[Visualizer] No feasibility breakdown in viz_data, using defaults") |
There was a problem hiding this comment.
Hardcoded fallback values in the feasibility breakdown may not accurately represent the actual assessment. Instead of using formula-based defaults like min(100, report.validation.feasibility_score + 10), consider either requiring these values from the LLM response or using a neutral default that indicates "data not available".
| # 기본값 사용 | |
| breakdown = { | |
| "선행연구": min(100, report.validation.feasibility_score + 10), | |
| "방법론": report.validation.feasibility_score, | |
| "실행가능성": max(0, report.validation.feasibility_score - 15), | |
| "학술기여도": report.validation.feasibility_score, | |
| } | |
| logger.warning(f"[Visualizer] No feasibility breakdown in viz_data, using defaults") | |
| # 기본값 사용: 세부 지표가 없는 경우, 전체 타당성 점수를 그대로 사용 | |
| breakdown = { | |
| "선행연구": report.validation.feasibility_score, | |
| "방법론": report.validation.feasibility_score, | |
| "실행가능성": report.validation.feasibility_score, | |
| "학술기여도": report.validation.feasibility_score, | |
| } | |
| logger.warning(f"[Visualizer] No feasibility breakdown in viz_data, using neutral defaults based on overall feasibility_score") |
| // Report일 때는 무조건 summary 모드 | ||
| const displayMode = isReport ? "summary" : viewMode; |
There was a problem hiding this comment.
The inline comment "// Report일 때는 무조건 summary 모드" contains mixed Korean and English. For code consistency, consider using either full English ("// For reports, always use summary mode") or full Korean, but not mixing them in technical comments.
| from zoneinfo import ZoneInfo | ||
| from io import BytesIO | ||
| from typing import Optional | ||
|
|
||
| from reportlab.lib.pagesizes import letter, A4 |
There was a problem hiding this comment.
The report builder uses zoneinfo.ZoneInfo which requires Python 3.9+. Ensure that the minimum Python version requirement is documented and that the deployment environment supports this. The Dockerfile removal suggests this might need clarification in deployment documentation.
No description provided.