andreaslang.dev
I'm Andreas, a Lead Data Engineer at Altruistiq. Lately I'm mostly building production AI on AWS Bedrock with pydantic-ai. Posts here are tutorials with runnable code; bring an AWS account and Terraform, leave with something that works.
-
File tools and validate: the agent's feedback loop
The agent gets a workspace, file tools (list, read, write, edit, delete), and a `terraform_validate` tool it can invoke at any point. It writes HCL, sees errors, edits, validates again. To ship the terraform CLI next to the runtime, the Lambda flips from a zip package to a container image. The deliverable is the workspace, not a Pydantic result. A caller-side retry covers the case where the agent claimed done but validate still fails.
-
Model portability: swapping Bedrock for the Mistral API
Swap Bedrock for the Mistral API without touching the agent: an SSM model registry built at invoke time, plus EMF metrics so one CloudWatch dashboard covers every provider.
-
Audit trail via OTLP: every agent run as a trace
Stream every pydantic-ai run as an OTel trace into S3 with Object Lock for the audit copy, with Logfire as the live visualizer.
-
Bedrock and pydantic-ai with observability from day one
Stand up Bedrock in Terraform, make your first pydantic-ai call, and front it with a CloudWatch dashboard and daily-threshold alarm.