Generative AI has revolutionized technology through generating content and solving complex problems. To fully take advantage of this potential, seamless integration with existing business systems and efficient access to data are crucial. Amazon Bedrock Agents provides the integration capabilities to connect generative AI models with the wealth of information and workflows already in place within an organization, enabling the creation of efficient and impactful generative AI applications.
Amazon Bedrock is a fully managed service that enables the development and deployment of generative AI applications using high-performance foundation models (FMs) from leading AI companies through a single API. Amazon Bedrock Agents allows you to streamline workflows and automate repetitive tasks across your company systems and data sources, while maintaining security, privacy, and responsible AI practices. Using these agents, you can enable generative AI applications to execute multiple tasks across your company systems and data sources. Businesses can now unlock the power of generative AI to automate tasks, generate content, and solve complex problems—all while maintaining connectivity to critical enterprise systems and data sources.
The post showcases how generative AI can be used to logic, reason, and orchestrate integrations using a fictitious business process. It demonstrates strategies and techniques for orchestrating Amazon Bedrock agents and action groups to seamlessly integrate generative AI with existing business systems, enabling efficient data access and unlocking the full potential of generative AI.
This solution also integrates with Appian Case Management Studio. Cases are a vital part of case management applications and represent a series of tasks to complete or a multi-step problem to solve. Appian Case Management Studio is an out-of-the box suite of applications that facilitates rapid development of case management apps. The fictitious business process used in this post creates a case in Appian for further review.
The following workflow shows the fictitious business process.
The workflow consists of the following steps:
The following diagram illustrates the architecture of the solution.
The system workflow includes the following steps:
You will need the following prerequisites before you can build the solution:
This solution is supported only in the us-east-1
AWS Region. You can make the necessary changes to the CloudFormation template to deploy to other Regions.
Depending on your needs, follow the corresponding steps to create an Appian account.
The Appian Community Edition provides a personal environment for learning and exploration at no additional cost. To sign up for Apian Community Edition, complete the following steps:
If you’re evaluating Appian for your organization, complete the following steps:
An Appian representative will contact you to discuss your needs. They might provide access to a trial environment or schedule a personalized demo.
By following these steps, you can create an Appian account suited to your personal learning or business evaluation needs. Whether you’re exploring Appian’s platform individually or assessing it for your organization, Appian provides resources and support to help you get started.
Note the following values, which we will use in the CloudFormation template below.
Complete the following steps to deploy the CloudFormation template:
us-east-1
QualityReviewStack
.After the successful deployment of the whole stack, an email will be sent to the email addresses provided earlier.
OpenAPISpecsS3Bucket
QualityFormsBucket
This post does not cover auto scaling of AWS Lambda. To integrate Lambda with AWS Application Auto Scaling, see AWS Lambda and Application Auto Scaling.
Complete the following steps to upload the Open API specifications to Amazon S3:
deviceclassification.json
)verifyQualityDocuments.json
)emailReviewers.json
)appian-case.json
)Complete the following steps to upload the quality form to the Amazon S3:
QualityFormsBucket
.Before we configure the agents, we will define a prompt. Prompts are the key to unlocking the full potential of Amazon Bedrock agents. Prompts are the textual inputs that guide the agent’s behavior and responses. Crafting well-designed prompts is essential for making sure that the agent understands the context, intent, and desired output.
When creating prompts, consider the following best practices:
Amazon Bedrock Agents supports advanced prompting techniques, Chain of thought (CoT) and Tree-of-thought (ToT) prompting. CoT prompting is a technique that enhances the reasoning capabilities of FMs by breaking down complex questions or tasks into smaller, more manageable steps. ToT prompting is a technique used to improve FM reasoning capabilities by breaking down larger problem statements into a treelike format, where each problem is divided into smaller subproblems. We use Tree-of-thought (ToT) prompting and start by breaking down the business process into logical steps and then incorporate model formatting.
The following is the prompt developed for Anthropic’s Claude 3 Sonnet:
The first step in configuring Amazon Bedrock Agents is to define their capabilities. Amazon Bedrock agents can be trained to perform a wide range of tasks, from natural language processing and generation to task completion and decision-making. When defining an agent’s capabilities, consider the specific use case and the desired outcomes.
To create an agent, complete the following steps:
Complete the following steps to create the action groups for the newly created agent:
checkdeviceclassification
and provide an optional description for your action group.DeviceClassification
.Action Group Name | Lambda Functin Name Containing | Open API Schema |
checkdeviceclassification | DeviceClassification | deviceclassification.json |
verifyqualitydocuments | VerifyQualityDocuments | verifyQualityDocuments.json |
emailreviewers | EmailReviewers | emailReviewers.json |
appiancase | Appian | appian-case.json |
To customize the agent’s behavior to your specific use case, you can modify the prompt templates for the preprocessing, orchestration, knowledge base response generation, and postprocessing steps. For more information, see Enhance agent’s accuracy using advanced prompt templates in Amazon Bedrock.
You can create an Amazon Bedrock knowledge base to retrieve information from your proprietary data and generate responses to answer natural language questions. As part of creating a knowledge base, you configure a data source and a vector store of your choice.
The prompt crafted earlier provides instructions that are not dependent on a knowledge base. To use a knowledge base, modify the prompt accordingly.
Complete the following steps to prepare the agent for deployment:
After the agent is saved, the Prepare button will be enabled.
To test the agent, we use the Amazon Bedrock agent console. You can embed the API calls into your applications.
If you use AWS published API calls to access Amazon Bedrock through the network, the client must adhere to the following requirements.
Complete the following steps to test the agent on the Amazon Bedrock console:
The agent will respond by asking for the type of device.
The CloudFormation template only deploys “HIV diagnostic tests” as a Type 3 device.
The agent fetches the classification of the device from the DynamoDB. You can update the CloudFormation template to add more values.
Because the classification of HIV diagnostic tests is Type 3, the agent will ask for the device name to verify if the quality document exists.
anytech
.The agent will verify if the document with the name anytech
exists in Amazon S3. (Earlier, you uploaded a dummy document for anytech
.)
The agent should now ask for an email address to receive the quality review request.
An email will be sent with the review details.
anytechorg
as the document name.We did not upload a document named anytechorg
, so the agent will create a case by asking for the following information:
The agent now creates a case.
Consider the following best practices for building efficient and well-architected generative AI applications:
To avoid incurring future charges, delete the resources you created. To clean up the AWS environment, complete the following steps:
Integrating generative AI with existing systems is crucial to unlocking its transformative potential. By using tools like Amazon Bedrock Agents, organizations can seamlessly connect generative AI to core data and workflows, enabling automation, content generation, and problem-solving while maintaining connectivity. The strategies and techniques showcased in this post demonstrate how generative AI can be orchestrated to drive maximum value across a wide range of use cases, from extracting intelligence from regulatory submissions to providing prescriptive guidance to industry. As generative AI continues to evolve, the ability to integrate it with existing infrastructure will be paramount to realizing its true business impact.
To get started with integrating generative AI into your business, explore How Amazon Bedrock Agents works and discover how you can unlock the transformative potential of this technology across your organization.
Stay up to date with the latest advancements in generative AI and start building on AWS. If you’re seeking assistance on how to begin, check out the Generative AI Innovation Center.
Our next iteration of the FSF sets out stronger security protocols on the path to…
Large neural networks pretrained on web-scale corpora are central to modern machine learning. In this…
At Google Cloud, we're deeply invested in making AI helpful to organizations everywhere — not…
Advanced Micro Devices reported revenue of $7.658 billion for the fourth quarter, up 24% from…
The US government’s primary foreign aid agency has employees stationed all over the world, many…