AWS Builder Center

Decoding the "Brave" Truth: Building a British English Intent Analyzer with Claude 4.5 and AWS Step Functions

This article explores building a high-context intent analyzer using AWS Step Functions and Claude 4.5. By routing requests via cultural flags, the author demonstrates how a deterministic workflow outperforms autonomous agents in cost-predictability and reliability. It highlights the technical advantages of a "Lambda-less" architecture using JSONata and direct SDK integration, offering a lean, scalable way to manage LLM orchestration while optimizing inference costs.

1. Introduction

Hi, I'm Yamada!
I'm still working on my English, but I'm passionate about sharing technical insights. Let's say a British colleague says this to me:
"That's a very brave decision!"
As a beginner, I'd translate it literally:
It sounds like they're cheering me on! I was ready to celebrate... or so I thought.
In reality, depending on the context and the specific dialect of English, this sentence might mean the exact opposite of its literal definition. Much like the "Kyoto-ben" in Japan, British English is famous for its elegant, high-context delivery of "hon-ne" (true intent).
In this post, I’ll explore how to build an AWS Step Functions workflow that dynamically routes requests to the appropriate model—ensuring we don't miss the "sting" behind the "smile."
Note: My interpretation of British English might just be me overthinking it!

2. Architecture: Why Step Functions over Agents?

While Amazon Bedrock Agents are a powerful choice for autonomous tasks, I chose AWS Step Functions (SFn) for this project. Since we are using a flag to identify the cultural context (e.g., isBritish), SFn allows for a more predictable and cost-effective implementation.
This workflow uses a Choice state to branch logic based on the required depth of analysis:
  1. Reliability through Determinism: By routing requests through defined states, we eliminate the "wandering" logic of autonomous agents, ensuring consistent results for specific cultural flags.
  2. Predictability through Fixed Steps: Agents can loop unpredictably. SFn keeps the number of LLM calls fixed, making it much easier to manage costs and service quotas at scale.
  3. Lambda-less & JSONata: Using the Bedrock SDK integration directly within SFn means no Lambda overhead. Plus, JSONata allows us to transform prompts and structure JSON outputs natively within the state machine.

3. Cost Estimation for 10,000 Requests

Let's look at the numbers. Since English is more token-efficient than Japanese (fewer tokens per word), the costs are slightly lower, but the gap between "Direct" and "Autonomous" remains massive.
Comparison ItemStep Functions (Deterministic)Bedrock Agents (Autonomous)
Inference PathFixed (1 Analysis + 1 Verification)Variable (3-5 Reasoning loops)
Avg. Tokens/Req~1,200 tokens (Fixed)~4,500 - 8,000 tokens (Unpredictable)
Est. Cost (10k req)~$25.00$90.00 - $160.00+
By using the isBritish flag, we can selectively use Claude 4.5 Sonnet for high-stakes decoding while sticking to the lower-cost Haiku for standard tasks, optimizing our FinOps.

4. Putting it to the Test

Let’s run the workflow with the input: "That's a very brave decision."

Case A: Standard Mode (isBritish: false)

Prompt:
1
2
3
4
5
6
You are a communication expert who interprets text at face value.
Provide a straightforward interpretation without reading between the lines.

## Output Format
Output ONLY valid JSON. No markdown code blocks. No explanations.
{ "interpretation": "Direct interpretation", "suggestedReply": "Suggested response" }
1
2
3
4
5
6
7
{
"interpretation": "The speaker is acknowledging that someone has made a decision that requires courage or involves taking a risk. They are affirming that the choice is commendable for its boldness.",
"suggestedReply": "Thank you. I've thought it through carefully and believe it's the right choice for me.",
"mode": "direct",
"inputText": "That's a very brave decision.",
"guardrailApplied": false
}
Nice! Everyone is so supportive!

Case B: British Mode (isBritish: true)

Prompt:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
You are an expert in decoding British English understatement, politeness, and indirect communication.
You deeply understand the gap between what British people say and what they actually mean.

## Analysis Steps (Chain-of-Thought)
1. First, identify the surface meaning - what is literally being said
2. Then, consider the British cultural context and decode the true intent
3. Use location and relationship context to inform your interpretation
4. Finally, suggest an appropriate response that acknowledges the true meaning

## Important
Quote the original input text verbatim in your analysis. Do not paraphrase or omit.

## Output Format
Output ONLY valid JSON. No markdown code blocks. No explanations.
{ "politeVersion": "What they said (surface meaning)", "actualMeaning": "What they actually mean", "recommendedReply": "Suggested response" }
1
2
3
4
5
6
7
8
{
"politeVersion": "That's a very brave decision.",
"actualMeaning": "That's a terrible decision and you're going to regret it. I think you've made a serious mistake, but I'm too polite to say so directly. I'm distancing myself from this so when it fails, everyone knows I warned you.",
"recommendedReply": "I appreciate your feedback. Perhaps we could discuss any concerns you might have about the approach?",
"mode": "british",
"inputText": "That's a very brave decision.",
"guardrailApplied": false
}
Wait... what?! If I hadn't checked this, I would have walked off a cliff with a smile on my face!

5. Deep Dive: The "Logical Guardrail" using Step Functions

During testing, I realized something critical about Amazon Bedrock Guardrails.
Standard word filters and content policies are designed to catch "toxic" or "harmful" language. However, they are often powerless against "elegant insults." Because "Brave decision" contains zero offensive words, a traditional guardrail will see it as 100% safe.
This is where the Step Functions workflow becomes its own security layer:
  • Intent as a Guardrail: By branching into a "High-Context Analysis" state, we treat the meaning of the sentence as a safety check.
  • Orchestration Advantage: SFn makes it incredibly easy to insert this "Logical Guardrail" into any business process. If the actualMeaning is detected as a "Critical Risk" or "Sarcastic Denial," the workflow can automatically trigger a human escalation or a secondary validation.
  • Proactive Safety: This doesn't rely on blacklisting words; it uses the reasoning power of Claude 4.5 Sonnet to identify risks that look like compliments.

6. Conclusion

Decoding the "hon-ne" (a Japanese word for true, hidden intent) behind British English might seem like a fun experiment. However, this pattern of balancing cost with reasoning depth is a very practical approach when building production-grade AI.
By using AWS Step Functions to "hold the reins" of Claude 4.5, we get:
  • Strategic Model Allocation: Use the heavy-hitting Sonnet only when the cultural context demands it.
  • Total Visibility: I absolutely love the SFn execution console—seeing exactly where the logic branched and why is a debugger's dream.
  • Lambda-less Simplicity: Managing everything through JSONata and direct SDK calls keeps the stack lean, fast, and easy to maintain.
The intelligence of Claude 4.5 is staggering, but it's the AWS workflow that gives that intelligence a safe and predictable path to follow. Now, I can go back to my meetings knowing that "Very interesting!" might actually mean "That's the most boring thing I've ever heard."
I have huge respect for British culture and their sophisticated way of communicating.
Stay safe out there!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article