Agentcore optimization nys#1722
Merged
Merged
Conversation
- Add insights.py: runs FailureAnalysis, UserIntent, and ExecutionSummary batch insight jobs on the HR Assistant agent. Supports --generate-traces to send curated failure-mode sessions, --online to create a recurring daily OnlineEvaluationConfig, and --insight to select individual insight types. Uses both aws/spans and the runtime log group as data sources. - Update README with a full Failure Insights section covering all three insight types, data source requirements, CLI examples, and how to chain insights into a system prompt recommendation.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
- Add encoding="utf-8" to file read/write calls - Wrap long lines to stay within 100-char limit - Add pylint disable comments for intentional broad-exception-caught - Rename loop variable to avoid module-scope naming false positive - Remove f-string prefix from string literals without placeholders (ruff fix)
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
|
2696476 to
d592f27
Compare
5dfbb1c to
15cea49
Compare
akshseh
requested changes
Jun 22, 2026
akshseh
approved these changes
Jun 22, 2026
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.
Amazon Bedrock AgentCore Samples Pull Request
Adds insights sample to the optimize-your-agent section, because
AgentCore Insights is now publicly available and there was no end-to-end
code sample showing how to use it.
against an HR Assistant agent using the public SDK (bedrock-agentcore
1.15.0, boto3 1.43.32). Supports one-shot batch runs and recurring
daily OnlineEvaluationConfig via --online flag.
WHL references.
v0.20.1+), the FailureAnalysis signal taxonomy with all 7 category
strings, per-session detail structure (explanation, fixType,
recommendation, failureSpans), and the triage-to-optimization flow.
Insights is positioned as Step 3 in the CLI workflow, after deploy
and baseline evaluation.
User experience
After this change, a user can pip install -r requirements.txt, deploy the HR Assistant with deploy.py, and run python insights.py --name
--generate-traces to get a full failure analysis with clustered root causes, signal categories, per-session span-level evidence, and
fix recommendations — all using the public SDK. The README also shows the equivalent CLI workflow with agentcore run insights and how to
chain insights into a system prompt recommendation.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.