-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support insight with RAG #266
Support insight with RAG #266
Conversation
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
==========================================
- Coverage 90.34% 88.64% -1.71%
==========================================
Files 59 60 +1
Lines 1575 1700 +125
Branches 377 419 +42
==========================================
+ Hits 1423 1507 +84
- Misses 150 191 +41
Partials 2 2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
…ithRAG # Conflicts: # CHANGELOG.md
…ithRAG # Conflicts: # CHANGELOG.md # common/constants/llm.ts # server/plugin.ts
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
…ithRAG # Conflicts: # server/plugin.ts
try { | ||
contextObj = (await incontextInsight.contextProvider?.()) ?? undefined; | ||
} catch (e) { | ||
console.error('Error executing contextProvider:', e); |
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.
please remove console logs
const response = await assistantClient.executeAgentByName(SUMMARY_AGENT_CONFIG_ID, { | ||
context: req.body.context, | ||
question: req.body.question, | ||
}); | ||
let summary; | ||
let insightAgentIdExists = false; | ||
try { | ||
if (req.body.insightType) { | ||
// We have separate agent for os_insight and user_insight. And for user_insight, we can | ||
// only get it by searching on name since it is not stored in agent config. | ||
if (req.body.insightType === 'os_insight') { | ||
if (!osInsightAgentId) { | ||
osInsightAgentId = await getAgent(OS_INSIGHT_AGENT_CONFIG_ID, client); | ||
} | ||
insightAgentIdExists = !!osInsightAgentId; | ||
} else if (req.body.insightType === 'user_insight') { | ||
if (req.body.type === 'alerts') { | ||
if (!userInsightAgentId) { | ||
userInsightAgentId = await searchAgentByName('KB_For_Alert_Insight', client); | ||
} | ||
} | ||
insightAgentIdExists = !!userInsightAgentId; | ||
} | ||
} |
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.
nit: we can refactor these two api calls run in parallel with Promise.all() as they don't depend on each other
const insightAgentId = | ||
req.body.insightType === 'os_insight' ? osInsightAgentId : userInsightAgentId; | ||
if (!insightAgentId) { | ||
context.assistant_plugin.logger.info( |
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.
maybe debug level or remove the log
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-assistant/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.x
# Create a new branch
git switch --create backport/backport-266-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4e68047cd0700c33c016cf5bf0ad43f66f2ed7ba
# Push it to GitHub
git push --set-upstream origin backport/backport-266-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.x Then, create a pull request where the |
Looks like we need to backport this PR to 2.x. Since #267 resolved some conflicts based on this PR, could you @qianheng-aws fix the backport to unblock #267 backport? |
* Support insight with RAG Signed-off-by: Heng Qian <[email protected]> * Add change in CHANGELOG.md Signed-off-by: Heng Qian <[email protected]> * Put footer in the same panel with content to match UX design Signed-off-by: Heng Qian <[email protected]> * Refine alert prompt Signed-off-by: Heng Qian <[email protected]> * set CSS scrollbar-width to thin Signed-off-by: Heng Qian <[email protected]> * Hide insight agent id from front-end Signed-off-by: Heng Qian <[email protected]> * Change summary agent config id Signed-off-by: Heng Qian <[email protected]> * Address comments Signed-off-by: Heng Qian <[email protected]> * Fix UT Signed-off-by: Heng Qian <[email protected]> * Change agent execute API Signed-off-by: Heng Qian <[email protected]> * Remove prompt from node JS server Signed-off-by: Heng Qian <[email protected]> * Replace CSS with component property Signed-off-by: Heng Qian <[email protected]> --------- Signed-off-by: Heng Qian <[email protected]> (cherry picked from commit 4e68047) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* Support insight with RAG Signed-off-by: Heng Qian <[email protected]> * Add change in CHANGELOG.md Signed-off-by: Heng Qian <[email protected]> * Put footer in the same panel with content to match UX design Signed-off-by: Heng Qian <[email protected]> * Refine alert prompt Signed-off-by: Heng Qian <[email protected]> * set CSS scrollbar-width to thin Signed-off-by: Heng Qian <[email protected]> * Hide insight agent id from front-end Signed-off-by: Heng Qian <[email protected]> * Change summary agent config id Signed-off-by: Heng Qian <[email protected]> * Address comments Signed-off-by: Heng Qian <[email protected]> * Fix UT Signed-off-by: Heng Qian <[email protected]> * Change agent execute API Signed-off-by: Heng Qian <[email protected]> * Remove prompt from node JS server Signed-off-by: Heng Qian <[email protected]> * Replace CSS with component property Signed-off-by: Heng Qian <[email protected]> --------- Signed-off-by: Heng Qian <[email protected]> (cherry picked from commit 4e68047) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
The alert analysis assistant has supported summary generation now. This PR provides insight with RAG if related insight has been configured. There could be 2 types of knowledge base:
1. OpenSearch’ technical knowledge base for cluster alerts, which is setup by default
2. Customized knowledge base for customer’s own alerts, which is configured by customers and setup by CloudFormation workflow.
Apart from supporting insight, this feature also refines the UX.
Screen Snapshot:
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.