feat: add relevancy steering handler with LLM judge + Bedrock Guardra… - #30
Open
rajjayaaws wants to merge 1 commit into
Open
feat: add relevancy steering handler with LLM judge + Bedrock Guardra…#30rajjayaaws wants to merge 1 commit into
rajjayaaws wants to merge 1 commit into
Conversation
…ils scoring Add a Strands SDK steering plugin that validates agent responses for relevancy and grounding using two complementary approaches: 1. LLM Judge (Steering Hook): Checks KB query intent before tool calls and evaluates response faithfulness after generation 2. Bedrock Guardrails (ApplyGuardrail API): Scores contextual grounding and relevance against KB source data Both run inside a single steering handler, log scores to S3, and support passive (log only) or active (auto-retry) modes via environment variables. Includes: - relevancy_steering_handler.py: SteeringHandler with steer_before_tool and steer_after_model hooks - relevancy_logger.py: S3 score logger with local fallback - eval_runner.py + eval_test_cases.py: 50-case evaluation suite across L100-L400 user levels with Strands Evals integration - CFN: Bedrock Guardrail (contextual grounding) + S3 logging bucket - Updated README with steering config, log structure, and eval docs
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.
Add a Strands SDK steering plugin that validates agent responses for relevancy and grounding using two complementary approaches:
Both run inside a single steering handler, log scores to S3, and support passive (log only) or active (auto-retry) modes via environment variables.
Includes:
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.