You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New: [AEA-5546] - Use prompts for better answers (#27)
## Summary
🎫 [AEA-5546](https://nhsd-jira.digital.nhs.uk/browse/AEA-5546) Use
prompts for better answers
:sparkles: New Feature
:robot: Operational or Infrastructure Change
### Details
This change improves the relevance of Slack bot answers by introducing a
prompt-building and query-rewriting layer before sending user questions
to Bedrock’s Knowledge Base retrieve_and_generate API.
Key updates:
- Added system prompt to instruct Bedrock on response style, source
restrictions, and EPS/NHS domain behaviour.
- Implemented query rewriting to:
- Strip Slack-specific noise (mentions, emojis, formatting).
- Expand EPS/NHS domain acronyms and terminology.
- Normalize and clarify vague user input.
- Modified get_bedrock_knowledgebase_response to send the prompt +
rewritten query instead of the raw Slack message.
- Externalised prompt content for easier iteration without code changes.
- Added logging to compare original vs rewritten queries and help with
post-deployment tuning.
Outcome: Bedrock receives clearer, more context-rich queries, resulting
in answers that are more relevant and better grounded in the knowledge
base.
0 commit comments