AWS Builder Center
NeuroBridge: Helping Neurodivergent People Practice Difficult Conversations with AI on AWS

NeuroBridge: Helping Neurodivergent People Practice Difficult Conversations with AI on AWS

NeuroBridge is an AI-powered practice space for rehearsing difficult conversations before they happen. In this post, I share how I integrated Amazon Bedrock into our roleplay system, handled conversation history and prompts, added cost guardrails, and debugged real AWS issues involving model access, inference profiles, IAM, and account configuration.

Two days before our hackathon demo, I was staring at a  ValidationException: Operation not allowed  error that made absolutely no sense. The model was listed as available. The IAM policy was scoped correctly. The CLI command I'd just run should have worked. It didn't. I'll get to why in a bit, that one error ate more of my time than any other part of this project.

The Problem

The idea for NeuroBridge came from a pretty simple observation: a lot of people, especially neurodivergent folks, know exactly what they want to say in a hard conversation, but the moment is high-pressure and unpredictable, so they freeze, or the conversation goes somewhere they didn't prepare for. Job interviews, asking a professor for an extension, setting a boundary with a pushy coworker, these are skills, and skills need practice. But you can't exactly "practice" asking your manager for a raise on your actual manager.
So we built a place to rehearse it first.

What We Built

NeuroBridge is a rehearsal space where you pick a scenario (job interview, talking to a professor, asking for help, setting a boundary, that kind of thing) and an AI plays the other person. Not a chatbot giving you tips. An actual in-character roleplay: the professor is a little skeptical, the hiring manager stays professional, the pushy coworker keeps pushing. You respond like you would in real life, the conversation plays out, and only at the end do you get feedback: not a score, but a breakdown of tone, clarity, and composure, plus what went well and what to try differently next time.
The whole point was to keep the practice immersive. No scoring interruptions mid-conversation, no "great job!" after every line. Just the conversation, then a debrief.

Building It on AWS

Architecture at a glance


The part of the architecture I worked closest to was the AI request path:
Scenario + Conversation History
↓
Lambda Handler
↓
Amazon Bedrock
↓
AI Response
Figure 1: NeuroBridge AI request flow. Scenario instructions and conversation history are assembled before the Bedrock invocation, then the generated response is returned to the application.
Our stack: Cognito for auth (email/password sign-up, since we needed real user accounts fast), API Gateway fronting a handful of Lambda functions, DynamoDB for sessions and scenario data, S3 for future assets, and Amazon Bedrock running the actual roleplay conversations.
Bedrock was the core of the whole idea, we needed a model that could hold a persona across a multi-turn conversation without breaking character, and Converse API made building that conversation loop (system prompt + message history in, reply out) pretty clean once we got the request shape right.
Bedrock request flow
System Prompt + Message History
↓
Bedrock Converse API
↓
Model Response / Usage
↓
Lambda
↓
Frontend
Figure 2: Bedrock conversation flow. The important part is that every turn carries the scenario context and relevant conversation history rather than treating each message as an isolated prompt.

What I Worked On

In the overall NeuroBridge architecture, I owned the Bedrock integration and AWS-side debugging. I wasn't responsible for the frontend or CDK infrastructure, so this post focuses on the pieces I actually worked on.
My piece was the Bedrock integration itself and getting the AWS account into a state where any of this could actually run. I built the model-calling logic, constructing the system prompt from our scenario data, formatting conversation history for the Converse API, parsing the response back out, and wiring in the cost guardrails (capped output tokens, truncated history, a hard per-session message limit so nothing could spiral). I also did most of the CloudWatch log-diving and CLI-level debugging when things broke, which, as you'll see below, was a lot of this project.

What Fought Back

The fastest way to learn this stack was to follow the failure all the way down instead of assuming the first broken-looking component was the cause.
The 503 that wasn't about our code at all. Everything was deployed, IAM looked right, the model ID looked right, and every single message to our roleplay endpoint came back with a clean 503: "AI service temporarily busy or unavailable." No stack trace reached the frontend by design, that part worked. But debugging blind is rough. I ran the exact same request through the AWS CLI directly, bypassing our Lambda entirely, and got the identical error:  ValidationException: Operation not allowed . That told us something important: it wasn't our code. It was something at the account level.
Turned out Anthropic models on Bedrock require a one-time "use case" form before first invocation. We filled it out, and, even after approval, still hit issues, because our account also had a paused UPI autopay mandate, which blocks Bedrock invocation account-wide regardless of which model you're calling. AWS wants a valid payment method on file, even if you're spending zero dollars. We ended up switching AWS accounts and re-enabling billing to get past it.
Model ID isn't just a string, it's a routing decision. Once billing was sorted, we switched to Amazon Nova 2 Lite to sidestep the Anthropic approval flow entirely. First CLI test:  ValidationException: Invocation of model ID amazon.nova-2-lite-v1:0 with on-demand throughput isn't supported. Retry your request with the ID or ARN of an inference profile.  Nova 2 Lite in our region needed the inference profile ID ( global.amazon.nova-2-lite-v1:0 ), not the plain foundation model ARN, a distinction I hadn't hit before. Fixed the model ID string in both the Lambda code and the IAM policy resource ARN, redeployed, and that specific error went away.
Two Lambdas, two different bugs, same symptom. Our  send-message  Lambda and  generate-feedback  Lambda both call Bedrock, but they were written slightly differently, one used the Converse API command, the other used a raw  InvokeModel  call with a hand-built JSON body. When we fixed the model ID in one, the other still had a stale reference, and it threw the same generic 500 for a completely different reason. Lesson: don't assume a fix in one place propagated everywhere it needed to. Check each call site.

What We Learned

The biggest thing I took away: when something fails cleanly with no obvious cause, isolate the layer before you touch code. Every time I jumped straight to "let me fix the Lambda," I wasted time, because half of our real bugs weren't in the Lambda at all, they were account-level (billing, model access) or config-level (wrong ARN, stale env var). Testing the exact same call outside our stack, straight through the AWS CLI, saved us hours, because it told us definitively whether the problem was ours or AWS's.
Also: read the actual error string. "Operation not allowed" and "on-demand throughput isn't supported" are AWS being pretty direct about what's wrong, if you actually read past the exception name.

What's Next

If we had more time, I'd want proper retry/backoff tuning instead of our blunt one-retry cap, and I'd like to explore whether streaming responses from Bedrock would make the roleplay feel more real-time instead of waiting for the full reply.

The AWS takeaway

The biggest lesson wasn't just how to call Bedrock. It was learning to debug the entire path around the model: IAM, account configuration, model access, inference profiles, Lambda, and finally the application.

Closing

This was my first time actually running Bedrock in production instead of just reading about it, and it taught me more about AWS account plumbing, billing gates, model access approvals, inference profiles, than any tutorial would have. None of it was glamorous. Most of it was staring at CloudWatch logs at 1 AM. But the conversation finally came back in-character, and that felt pretty good.
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