Action Models with Bedrock Agents

In the last post, we saw how to give an AI model a “memory” using RAG. But the real game-changer in the Generative AI world is when you let the model actually do things.

In the second half of Chapter 11, Neylson Crepalde introduces Bedrock Agents. These are powerful tools that act as intermediaries between your AI model and external systems like databases or APIs.

What is an AI Agent?

Most GenAI models are just “thinkers.” They can talk to you, but they can’t change anything in the real world. An Agent changes that. Under the hood, an agent “understands” your request and automatically calls a backend function to perform an action.

To build an agent, you need three main things:

  1. OpenAPI Schema: A JSON file that defines the “capabilities” of your agent (e.g., “I can create an Excel file” or “I can search a database”).
  2. Backend Function: Usually an AWS Lambda function that contains the actual code to execute the task.
  3. Knowledge Base: (Optional) To give the agent context so it doesn’t hallucinate.

Hands-on: The AWS Competency Assistant

The book walks through a very cool project: an agent that helps companies build “case sheets” for the AWS Competency program.

Here is the workflow:

  • The user asks the agent to create a case study for a specific client.
  • The agent uses its OpenAPI schema to “understand” that it needs to call the generateCaseSheet function.
  • It triggers a Lambda function written in Python.
  • The function generates an Excel file, uploads it to Amazon S3, and registers the case in a DynamoDB table.
  • The agent then confirms to the user: “Success! Your case sheet ID is 123.”

Why this belongs on Kubernetes

You might be wondering why we are talking about Lambda and DynamoDB in a book about Kubernetes.

The reason is Hybrid Infrastructure. While the agent’s logic lives in Bedrock and the execution lives in Lambda, the application that interfaces with your users (like our Streamlit app) lives on Kubernetes.

By running your frontend on Kubernetes, you get industrial-grade scaling and security, while still being able to “reach out” to serverless tools like Bedrock and Lambda for the intelligence.

Setting up Permissions

One critical tip from the book: you have to give the Bedrock Agent permission to talk to your Lambda. This is done through a Resource-based policy on the Lambda function. If you forget this step, your agent will correctly “plan” the action but fail when it tries to pull the trigger.

We’ve now seen the full power of the modern stack—from raw TSV files to intelligent agents that can build spreadsheets. In the final few posts, we’ll talk about how to manage this whole ecosystem in a production environment.

Next: Beyond the Basics: The Kubernetes Ecosystem Previous: GenAI on K8s: Building with Amazon Bedrock

Book Details:

  • Title: Big Data on Kubernetes: A practical guide to building efficient and scalable data solutions
  • Author: Neylson Crepalde
  • ISBN: 978-1-83546-214-0

About

About BookGrill.net

BookGrill.net is a technology book review site for developers, engineers, and anyone who builds things with code. We cover books on software engineering, AI and machine learning, cybersecurity, systems design, and the culture of technology.

Know More