Generative AI with AWS Bedrock - First Impressions
AWS Bedrock logo.
Introduction
I have had a long-lasting interest in artificial intelligence. I did my master’s thesis on the topic in the 1990s at the Helsinki University of Technology, in the AI department, but at that time there were few AI jobs available. At that time, AI primarily involved expert systems and programming in Lisp and Prolog
In 2018, I began studying machine learning. I did the Coursera / Stanford Online Machine Learning course. However, there were no machine learning projects available at the corporation where I worked at that time.
Here are a couple of my blog posts from that period when I was studying machine learning
- Studying Machine Learning — First Impressions
- Writing Machine Learning Solutions — First Impressions
Will Power
Let’s go back to the year 2016 for a moment. I was working at a big corporation and I had a chance to work in my first public cloud (AWS) project. I was completely convinced by the idea of the public cloud. We had created the cloud infrastructure using Terraform, bit by bit. One day, we decided that the first version of the infrastructure was ready for deployment to the production AWS account. We ran the command terraform apply
and went for a lunch break. When we returned, the infrastructure was fully set up: virtual machines, database servers, queues, topics, alarms, everything. At that moment, I realized we had created a virtual data center in the cloud for our project. I am old enough to remember how things were before the cloud era. How many weeks it took to calculate the capacity for the applications servers and databases, order the machines, have the physical machines delivered to the data center, wait for someone to install the operating systems, install the databases, configure the network, etc. And now we had accomplished all of that during a lunch break. At that moment I realized: This is a huge paradigm shift, and I need to be part of this. At that moment I decided that I categorically refuse to work in any project that does not use public cloud. And I have kept that promise to myself. Just public cloud projects for me, to build my competence. And I have been working in public cloud projects since then, using all major public clouds: AWS, Azure, and Google Cloud. I also hold several professional certifications from these public clouds, see my About page.
Let’s fast-forward to the year 2024. I was helping in a couple of generative AI projects. While I was testing one generative AI application, I realized that instead of using a cryptic, hard-to-understand, hard-to-use and hard-to-navigate complex user interface, the end-users can just ask questions in their own language, and get answers from the AI model in their own language. That was the same kind of moment for me as the moment in 2016 when I realized the power of public cloud. Generative AI is going to be everywhere pretty soon. And I want to be part of that journey. I decided that from now on I only want to do public cloud projects that build generative AI systems. I want to build my competence in those technologies that are going to be the future. This new AI era is going to be a similar paradigm shift as the public cloud has already been. I started studying generative AI, for example I did the AWS Certified AI Practitioner certification. However, it is one thing to study and pass a certification exam, and another thing to actually build something with the technology. Therefore, I was looking for my first generative AI project.
My First Generative AI Project
So, in December 2024, I finally got my first generative AI project. The task was to develop a chatbot for a specific domain that could answer questions in natural language. This type of chatbot is known as a Retrieval Augmented Generation (RAG) Chatbot. The project required using the AWS platform, specifically Amazon Bedrock service, which is designed for building, training, and deploying generative AI models. I had never used AWS Bedrock before, so I was excited to start the project. I created the AWS infrastructure using Terraform as an IaC tool, since I have used Terraform for many years and I am pretty competent with the tool.
Building the infrastructure using Terraform for the Bedrock service was really easy. There are good tutorials and examples on how to do that. I also created OpenSearch serverless index to be used as data source for the AWS Bedrock knowledge base. I added a few test documents to the S3 bucket to be indexed by Bedrock large language model and stored as embedding vector data in OpenSearch service. Then I could use the AWS Bedrock test bench to try asking questions using natural language regarding the domain - and got valid answers.
Next Steps
Next steps in my project are to create an agent that can be used as an API to the knowledge base, and a simple application for the end-users so that they can use the application to ask questions in their own language and get answers from the AI model in their own language. Once these steps are completed, the chatbot project will be ready.
The generative AI services that public clouds provide make it very easy to build chatbots like this. It would be really interesting to have a chance to build more generative AI projects in the future, also in the Azure and Google Cloud platforms.
Conclusions
Generative AI is here. Today. If you are a developer, you should start learning it. It is going to be everywhere pretty soon. And it is going to be a huge paradigm shift. For us developers, and for the whole society.