Building a Multi-Agent Generative AI application with AWS Bedrock,Pinecone,AWS CDK and Python


Watch the complete Video on Youtube
https://www.youtube.com/watch?v=kKX-8L_R2XM
Prerequisites
Before proceeding make sure you have these dependencies
Python 3.11 and above
AWS CLI
Full access to a foundation model. For this workshop, we'll be using
ANTHROPIC_CLAUDE_3_5_SONNET_V1_0
. Therefore, navigate to the AWS Console, Bedrock, Model access and get access to the above model or something similar.AWS CDK
References
Components of AI Agents
An agent consists of the following components:
Foundation model
You choose a foundation model (FM) that the agent invokes to interpret user input and subsequent prompts in its orchestration process. The agent also invokes the FM to generate responses and follow-up steps in its process.For this workshop, we choose ANTHROPIC_CLAUDE_3_5_SONNET_V1_0
Instructions
You write instructions that describe what the agent is designed to do. With advanced prompts, you can further customize instructions for the agent at every step of orchestration and include Lambda functions to parse each step's output.
At least one of the following:
Action groups – You define the actions that the agent should perform for the user through providing the following resources:
One of the following schemas to define the parameters that the agent needs to elicit from the user (each action group can use a different schema):
An OpenAPI schema to define the API operations that the agent can invoke to perform its tasks. The OpenAPI schema includes the parameters that need to be elicited from the user.
A function detail schema to define the parameters that the agent can elicit from the user. These parameters can then be used for further orchestration by the agent, or you can set up how to use them in your own application.
(Optional) A Lambda function with the following input and output:
Input – The API operation and/or parameters identified during orchestration.
- Output – The response from the API invocation or the response from the function invocation.
Knowledge bases
Associate knowledge bases with an agent. The agent queries the knowledge base for extra context to augment response generation and input into steps of the orchestration process.
Prompt templates
Prompt templates are the basis for creating prompts to be provided to the FM. Amazon Bedrock Agents exposes the default four base prompt templates that are used during the pre-processing, orchestration, knowledge base response generation, and post-processing.
You can optionally edit these base prompt templates to customize your agent's behavior at each step of its sequence. You can also turn off steps for troubleshooting purposes or if you decide that a step is unnecessary. For more information, see Enhance agent's accuracy using advanced prompt templates in Amazon Bedrock.
Subscribe to my newsletter
Read articles from Rosius Ndimofor directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Rosius Ndimofor
Rosius Ndimofor
I love creating and writing about the creation of software.