AI Architecture Patterns

One continuous payment-support story, starting simple and accumulating exactly the complexity a real production system needs β€” in the order a real one would need it. 16 patterns total, free to run locally, grounded in real AWS services.

01 Published

Grounded RAG For Payment Support

The model answers confidently with zero real data. Retrieve first β€” the real transaction record plus matching policy text β€” then generate. Require citations. Never guess.

AWS: Bedrock Knowledge Bases Β· S3 Vectors
02 Published

Prompt And Context Contract

It worked for one team. The second team plugged in and got a KeyError buried two layers deep. A versioned input/output contract catches the wrong shape before the prompt ever renders.

AWS: Bedrock Prompt Management
03 Draft β€” in review

Structured Output And Validation

The answer looks right but the downstream router rejects it because the status word isn't in the allowed list. Parse and validate model output before it touches any consumer.

AWS: Bedrock Β· Lambda
04 Draft β€” in review

Evaluator Optimizer

The answer cites the right source but still misses the point. A second model call scores faithfulness and relevance β€” catching what a grounding check can't.

AWS: Bedrock Β· CloudWatch
05 Draft β€” in review

Tool Calling

Some questions need an action, not just a lookup β€” checking a live balance, opening a ticket. The model requests a tool call; your code executes it and returns the result.

AWS: Bedrock Converse (Tool Use) Β· Lambda

What's next in the story

Patterns 06–16 aren't written yet β€” each one adds the next layer of production complexity the payment-support agent would actually need, in order. Numbered here because the order is the point: pattern 9 assumes pattern 6 already happened.

  1. 06
  2. 07
  3. 08
  4. 09
  5. 10
  6. 11
  7. 12
  8. 13
  9. 14
  10. 15
  11. 16